snmp

package
v0.0.0-...-f4b89b6 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSNMPProvider

func NewSNMPProvider(_ context.Context, address string, port uint16, community string,
	pollInt time.Duration, version gosnmp.SnmpVersion, v3Params *V3Params, mibs []string,
	mock bool,
	monitor provider.Monitor) provider.GNMIProvider

NewSNMPProvider returns a new SNMP provider for the device at 'address' using a community value for authentication and pollInterval for rate limiting requests.

func PDUsFromString

func PDUsFromString(s string) []*gosnmp.SnmpPDU

PDUsFromString converts a set of formatted SNMP responses (as returned by snmpwalk -v3 -O ne <target> <oid>) to PDUs.

Types

type Snmp

type Snmp struct {
	// contains filtered or unexported fields
}

Snmp contains everything needed to implement an SNMP provider.

func (*Snmp) Alive

func (s *Snmp) Alive(ctx context.Context) (bool, error)

Alive checks if device is still alive if poll interval has passed.

func (*Snmp) DeviceID

func (s *Snmp) DeviceID(ctx context.Context) (string, error)

DeviceID returns the device ID.

func (*Snmp) InitGNMI

func (s *Snmp) InitGNMI(client gnmi.GNMIClient)

InitGNMI initializes the Snmp provider with a gNMI client.

func (*Snmp) OpenConfig

func (s *Snmp) OpenConfig() bool

OpenConfig indicates that this provider wants OpenConfig type-checking.

func (*Snmp) Origin

func (s *Snmp) Origin() string

Origin indicates that this provider streams to an OpenConfig model.

func (*Snmp) Run

func (s *Snmp) Run(ctx context.Context) error

Run sets the Snmp provider running and returns only on error.

type V3Params

type V3Params struct {
	SecurityModel gosnmp.SnmpV3SecurityModel
	Level         gosnmp.SnmpV3MsgFlags
	UsmParams     *gosnmp.UsmSecurityParameters
}

V3Params contains options related to SNMPv3.

Directories

Path Synopsis
cmd
smi

Jump to

Keyboard shortcuts

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