Documentation ¶
Index ¶
- Variables
- func GetAuthProtocol(authProtocolStr string) (gosnmp.SnmpV3AuthProtocol, error)
- func GetPrivProtocol(privProtocolStr string) (gosnmp.SnmpV3PrivProtocol, error)
- func GetValueFromPDU(pduVariable gosnmp.SnmpPDU) (string, valuestore.ResultValue, error)
- func PacketAsString(packet *gosnmp.SnmpPacket) string
- func ResultToColumnValues(columnOids []string, snmpPacket *gosnmp.SnmpPacket) (valuestore.ColumnResultValuesType, map[string]string)
- func ResultToScalarValues(result *gosnmp.SnmpPacket) valuestore.ScalarResultValuesType
- type Replacer
- type TraceLevelLogWriter
Constants ¶
This section is empty.
Variables ¶
var MockValidReachableGetNextPacket = gosnmp.SnmpPacket{ Variables: []gosnmp.SnmpPDU{ { Name: "1.3.6.1.2.1.1.2.0", Type: gosnmp.ObjectIdentifier, Value: "1.3.6.1.4.1.3375.2.1.3.4.1", }, }, }
MockValidReachableGetNextPacket valid reachable packet
Functions ¶
func GetAuthProtocol ¶
func GetAuthProtocol(authProtocolStr string) (gosnmp.SnmpV3AuthProtocol, error)
GetAuthProtocol converts auth protocol from string to type
func GetPrivProtocol ¶
func GetPrivProtocol(privProtocolStr string) (gosnmp.SnmpV3PrivProtocol, error)
GetPrivProtocol converts priv protocol from string to type
func GetValueFromPDU ¶
func GetValueFromPDU(pduVariable gosnmp.SnmpPDU) (string, valuestore.ResultValue, error)
GetValueFromPDU converts gosnmp.SnmpPDU to ResultValue See possible types here: https://github.com/gosnmp/gosnmp/blob/master/helper.go#L59-L271
- gosnmp.Opaque: No support for gosnmp.Opaque since the type is processed recursively and never returned: is never returned https://github.com/gosnmp/gosnmp/blob/dc320dac5b53d95a366733fd95fb5851f2099387/helper.go#L195-L205
- gosnmp.Boolean: seems not exist anymore and not handled by gosnmp
func PacketAsString ¶
func PacketAsString(packet *gosnmp.SnmpPacket) string
PacketAsString used to format gosnmp.SnmpPacket for debug/trace logging
func ResultToColumnValues ¶
func ResultToColumnValues(columnOids []string, snmpPacket *gosnmp.SnmpPacket) (valuestore.ColumnResultValuesType, map[string]string)
ResultToColumnValues builds column values - ColumnResultValuesType: column values - nextOidsMap: represent the oids that can be used to retrieve following rows/values
func ResultToScalarValues ¶
func ResultToScalarValues(result *gosnmp.SnmpPacket) valuestore.ScalarResultValuesType
ResultToScalarValues converts result to scalar values
Types ¶
type TraceLevelLogWriter ¶
type TraceLevelLogWriter struct{}
TraceLevelLogWriter is a log writer for gosnmp logs, it removes sensitive info