snmp

package
v0.0.0-...-a6be157 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IntegerConversionError = errors.New("invalid data type. can't convert to Int")
	StringConversionError  = errors.New("invalid data type. can't convert to String")
	NilError               = errors.New("SNMP PDU returned nil value")
)

Functions

func BulkFill

func BulkFill(conn *gosnmp.GoSNMP, oids []string, records interface{ RecordInterface }) error

BulkFill takes a list of OIDs to Bulk walk over and create a list of SNMP records. A map of SNMP indices is createt from the first element in "oids", so make sure the first OID in the list has all the indices you want. New indices will be ignored.

func SliceOID

func SliceOID(oid string) (string, int)

func ToInt

func ToInt(result *gosnmp.SnmpPDU) (int, error)

func ToInt32

func ToInt32(result *gosnmp.SnmpPDU) (int32, error)

func ToInt64

func ToInt64(result *gosnmp.SnmpPDU) (int64, error)

func ToString

func ToString(result *gosnmp.SnmpPDU) (string, error)

func ToUint

func ToUint(result *gosnmp.SnmpPDU, snmp *gosnmp.GoSNMP) (uint, error)

func ToUint32

func ToUint32(result *gosnmp.SnmpPDU) (uint32, error)

func ToUint32Map

func ToUint32Map(results map[int]*gosnmp.SnmpPDU) (map[int]uint32, error)

func ToUint64

func ToUint64(result *gosnmp.SnmpPDU) (uint64, error)

func WalkSubtree

func WalkSubtree(snmp *gosnmp.GoSNMP, oids []string) (map[string]map[int]*gosnmp.SnmpPDU, error)

Types

type RecordInterface

type RecordInterface interface {
	SNMPSetValue(pdu *gosnmp.SnmpPDU, create bool) error
}

Jump to

Keyboard shortcuts

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