snmpc

package
v0.0.0-...-c02b23a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2020 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SnmpVersion_name = map[int32]string{
	0: "ZERO",
	1: "VERSION1",
	2: "VERSION2c",
	3: "VERSION3",
}
View Source
var SnmpVersion_value = map[string]int32{
	"ZERO":      0,
	"VERSION1":  1,
	"VERSION2c": 2,
	"VERSION3":  3,
}
View Source
var Type_name = map[int32]string{
	0: "GET",
	1: "SET",
	2: "BULKGET",
	3: "WALK",
}
View Source
var Type_value = map[string]int32{
	"GET":     0,
	"SET":     1,
	"BULKGET": 2,
	"WALK":    3,
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Community            string             `protobuf:"bytes,1,opt,name=community,proto3" json:"community,omitempty"`
	Version              SnmpVersion        `protobuf:"varint,2,opt,name=version,proto3,enum=dnc.snmpc.SnmpVersion" json:"version,omitempty"`
	Port                 uint64             `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
	Timeout              *duration.Duration `protobuf:"bytes,4,opt,name=timeout,proto3" json:"timeout,omitempty"`
	Retries              int32              `protobuf:"varint,5,opt,name=retries,proto3" json:"retries,omitempty"`
	MaxIterations        int32              `protobuf:"varint,6,opt,name=max_iterations,json=maxIterations,proto3" json:"max_iterations,omitempty"`
	MaxRepetitions       int32              `protobuf:"varint,7,opt,name=max_repetitions,json=maxRepetitions,proto3" json:"max_repetitions,omitempty"`
	NonRepeaters         int32              `protobuf:"varint,8,opt,name=non_repeaters,json=nonRepeaters,proto3" json:"non_repeaters,omitempty"`
	DynamicRepititions   bool               `protobuf:"varint,9,opt,name=dynamic_repititions,json=dynamicRepititions,proto3" json:"dynamic_repititions,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*Config) Descriptor

func (*Config) Descriptor() ([]byte, []int)

func (*Config) GetCommunity

func (m *Config) GetCommunity() string

func (*Config) GetDynamicRepititions

func (m *Config) GetDynamicRepititions() bool

func (*Config) GetMaxIterations

func (m *Config) GetMaxIterations() int32

func (*Config) GetMaxRepetitions

func (m *Config) GetMaxRepetitions() int32

func (*Config) GetNonRepeaters

func (m *Config) GetNonRepeaters() int32

func (*Config) GetPort

func (m *Config) GetPort() uint64

func (*Config) GetRetries

func (m *Config) GetRetries() int32

func (*Config) GetTimeout

func (m *Config) GetTimeout() *duration.Duration

func (*Config) GetVersion

func (m *Config) GetVersion() SnmpVersion

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) String

func (m *Config) String() string

func (*Config) XXX_DiscardUnknown

func (m *Config) XXX_DiscardUnknown()

func (*Config) XXX_Marshal

func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Config) XXX_Merge

func (m *Config) XXX_Merge(src proto.Message)

func (*Config) XXX_Size

func (m *Config) XXX_Size() int

func (*Config) XXX_Unmarshal

func (m *Config) XXX_Unmarshal(b []byte) error

type Oid

type Oid struct {
	// Name of the Oid, SysDescr or something else, No translation is being done.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The actual OID, 1.2.3.4.5.6.6.6.33
	Oid string `protobuf:"bytes,2,opt,name=oid,proto3" json:"oid,omitempty"`
	// What kind of data is expected: string, int, bits, mac, ip...
	Type metric.MetricType `protobuf:"varint,3,opt,name=type,proto3,enum=dnc.metric.MetricType" json:"type,omitempty"`
	// Description of what is expected of the parser
	Help string `protobuf:"bytes,4,opt,name=help,proto3" json:"help,omitempty"`
	// Search the data and parse it, Regexp
	Lookup string `protobuf:"bytes,5,opt,name=lookup,proto3" json:"lookup,omitempty"`
	// the next two might be dropped. this is set in the config
	// True if the oid should be looked up with a repeater
	Repeater bool `protobuf:"varint,6,opt,name=repeater,proto3" json:"repeater,omitempty"`
	// reps is determined by this. If dyanmic a dynamic lookup is used
	// this dyanamic is done on ifIndex so it's not going to work for
	// some other OID group.
	//
	// Types that are valid to be assigned to Reps:
	//	*Oid_Dynamic
	//	*Oid_Number
	Reps                 isOid_Reps `protobuf_oneof:"reps"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

Oid is item thack can be fetched through SNMP

func (*Oid) Descriptor

func (*Oid) Descriptor() ([]byte, []int)

func (*Oid) GetDynamic

func (m *Oid) GetDynamic() bool

func (*Oid) GetHelp

func (m *Oid) GetHelp() string

func (*Oid) GetLookup

func (m *Oid) GetLookup() string

func (*Oid) GetName

func (m *Oid) GetName() string

func (*Oid) GetNumber

func (m *Oid) GetNumber() int64

func (*Oid) GetOid

func (m *Oid) GetOid() string

func (*Oid) GetRepeater

func (m *Oid) GetRepeater() bool

func (*Oid) GetReps

func (m *Oid) GetReps() isOid_Reps

func (*Oid) GetType

func (m *Oid) GetType() metric.MetricType

func (*Oid) ProtoMessage

func (*Oid) ProtoMessage()

func (*Oid) Reset

func (m *Oid) Reset()

func (*Oid) String

func (m *Oid) String() string

func (*Oid) XXX_DiscardUnknown

func (m *Oid) XXX_DiscardUnknown()

func (*Oid) XXX_Marshal

func (m *Oid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Oid) XXX_Merge

func (m *Oid) XXX_Merge(src proto.Message)

func (*Oid) XXX_OneofWrappers

func (*Oid) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Oid) XXX_Size

func (m *Oid) XXX_Size() int

func (*Oid) XXX_Unmarshal

func (m *Oid) XXX_Unmarshal(b []byte) error

type Oid_Dynamic

type Oid_Dynamic struct {
	Dynamic bool `protobuf:"varint,7,opt,name=dynamic,proto3,oneof"`
}

type Oid_Number

type Oid_Number struct {
	Number int64 `protobuf:"varint,8,opt,name=number,proto3,oneof"`
}

type SnmpVersion

type SnmpVersion int32
const (
	// First must be zero in proto3
	// not a valid option for SNMPC
	SnmpVersion_ZERO SnmpVersion = 0
	// Enum begins here.
	SnmpVersion_VERSION1  SnmpVersion = 1
	SnmpVersion_VERSION2c SnmpVersion = 2
	SnmpVersion_VERSION3  SnmpVersion = 3
)

func (SnmpVersion) EnumDescriptor

func (SnmpVersion) EnumDescriptor() ([]byte, []int)

func (SnmpVersion) String

func (x SnmpVersion) String() string

type Task

type Task struct {
	// Unique ID of the task
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Track the status of the Task
	Status shared.Status `protobuf:"varint,2,opt,name=status,proto3,enum=dnc.shared.Status" json:"status,omitempty"`
	// if type is BulkGet all oids will be fetched bulked in one request
	Type Type `protobuf:"varint,3,opt,name=type,proto3,enum=dnc.snmpc.Type" json:"type,omitempty"`
	// Oids to fetch and process
	Oids []*Oid `protobuf:"bytes,4,rep,name=oids,proto3" json:"oids,omitempty"`
	// When fetched the Oids becomes metrics
	Metrics []*metric.Metric `protobuf:"bytes,5,rep,name=metrics,proto3" json:"metrics,omitempty"`
	// Configuration for SNMP-Client
	Config *Config             `protobuf:"bytes,6,opt,name=config,proto3" json:"config,omitempty"`
	Tags   map[string]*any.Any `` /* 149-byte string literal not displayed */
	// Set when the Task is created
	Created *timestamp.Timestamp `protobuf:"bytes,8,opt,name=created,proto3" json:"created,omitempty"`
	// Set when the progress of fetching it starts
	Started *timestamp.Timestamp `protobuf:"bytes,9,opt,name=started,proto3" json:"started,omitempty"`
	// Sets when DNC has fetched and parsed the data
	Completed *timestamp.Timestamp `protobuf:"bytes,10,opt,name=completed,proto3" json:"completed,omitempty"`
	// A difference between started and completed in MS
	ExecutionTime        *duration.Duration `protobuf:"bytes,11,opt,name=execution_time,json=executionTime,proto3" json:"execution_time,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*Task) Descriptor

func (*Task) Descriptor() ([]byte, []int)

func (*Task) GetCompleted

func (m *Task) GetCompleted() *timestamp.Timestamp

func (*Task) GetConfig

func (m *Task) GetConfig() *Config

func (*Task) GetCreated

func (m *Task) GetCreated() *timestamp.Timestamp

func (*Task) GetExecutionTime

func (m *Task) GetExecutionTime() *duration.Duration

func (*Task) GetId

func (m *Task) GetId() string

func (*Task) GetMetrics

func (m *Task) GetMetrics() []*metric.Metric

func (*Task) GetOids

func (m *Task) GetOids() []*Oid

func (*Task) GetStarted

func (m *Task) GetStarted() *timestamp.Timestamp

func (*Task) GetStatus

func (m *Task) GetStatus() shared.Status

func (*Task) GetTags

func (m *Task) GetTags() map[string]*any.Any

func (*Task) GetType

func (m *Task) GetType() Type

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) Reset

func (m *Task) Reset()

func (*Task) String

func (m *Task) String() string

func (*Task) XXX_DiscardUnknown

func (m *Task) XXX_DiscardUnknown()

func (*Task) XXX_Marshal

func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Task) XXX_Merge

func (m *Task) XXX_Merge(src proto.Message)

func (*Task) XXX_Size

func (m *Task) XXX_Size() int

func (*Task) XXX_Unmarshal

func (m *Task) XXX_Unmarshal(b []byte) error

type Type

type Type int32
const (
	Type_GET     Type = 0
	Type_SET     Type = 1
	Type_BULKGET Type = 2
	Type_WALK    Type = 3
)

func (Type) EnumDescriptor

func (Type) EnumDescriptor() ([]byte, []int)

func (Type) String

func (x Type) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL