Documentation ¶
Index ¶
- func FetchAllOIDsUsingGetNext(session Session) []string
- func FetchSysObjectID(session Session) (string, error)
- func GetNextColumnOidNaive(oid string) (string, error)
- type Factory
- type GosnmpSession
- func (s *GosnmpSession) Close() error
- func (s *GosnmpSession) Connect() error
- func (s *GosnmpSession) Get(oids []string) (result *gosnmp.SnmpPacket, err error)
- func (s *GosnmpSession) GetBulk(oids []string, bulkMaxRepetitions uint32) (result *gosnmp.SnmpPacket, err error)
- func (s *GosnmpSession) GetNext(oids []string) (result *gosnmp.SnmpPacket, err error)
- func (s *GosnmpSession) GetVersion() gosnmp.SnmpVersion
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchAllOIDsUsingGetNext ¶
FetchAllOIDsUsingGetNext fetches all available OIDs Fetch all scalar OIDs and first row of table OIDs.
func FetchSysObjectID ¶
FetchSysObjectID fetches the sys object id from the device
func GetNextColumnOidNaive ¶
GetNextColumnOidNaive will return the next column OID for a given OID This is a naive algorithm based on detecting `.1.` (the table Entry oid that contains), increase the next digit and returns it. Caveat: if the input OID index contain `.1.` the function won't return the next column OID but all the OID elements until `.1.`.
Types ¶
type Factory ¶
type Factory func(config *checkconfig.CheckConfig) (Session, error)
Factory will create a new Session
type GosnmpSession ¶
type GosnmpSession struct {
// contains filtered or unexported fields
}
GosnmpSession is used to connect to a snmp device
func (*GosnmpSession) Close ¶
func (s *GosnmpSession) Close() error
Close is used to close the connection
func (*GosnmpSession) Connect ¶
func (s *GosnmpSession) Connect() error
Connect is used to create a new connection
func (*GosnmpSession) Get ¶
func (s *GosnmpSession) Get(oids []string) (result *gosnmp.SnmpPacket, err error)
Get will send a SNMPGET command
func (*GosnmpSession) GetBulk ¶
func (s *GosnmpSession) GetBulk(oids []string, bulkMaxRepetitions uint32) (result *gosnmp.SnmpPacket, err error)
GetBulk will send a SNMP BULKGET command
func (*GosnmpSession) GetNext ¶
func (s *GosnmpSession) GetNext(oids []string) (result *gosnmp.SnmpPacket, err error)
GetNext will send a SNMP GETNEXT command
func (*GosnmpSession) GetVersion ¶
func (s *GosnmpSession) GetVersion() gosnmp.SnmpVersion
GetVersion returns the snmp version used
type Session ¶
type Session interface { Connect() error Close() error Get(oids []string) (result *gosnmp.SnmpPacket, err error) GetBulk(oids []string, bulkMaxRepetitions uint32) (result *gosnmp.SnmpPacket, err error) GetNext(oids []string) (result *gosnmp.SnmpPacket, err error) GetVersion() gosnmp.SnmpVersion }
Session interface for connecting to a snmp device
func NewGosnmpSession ¶
func NewGosnmpSession(config *checkconfig.CheckConfig) (Session, error)
NewGosnmpSession creates a new session