snmphelper

package module
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: LGPL-2.1 Imports: 6 Imported by: 3

README

snmphelper

Helpers on top of gosnmp

Documentation

https://pkg.go.dev/github.com/aretaja/snmphelper

Documentation

Overview

Package snmphelper implements some functions on top of gosnmp.

Index

Constants

View Source
const Version = "1.1.3"

Version of release

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Host, User, Prot, Pass, Slevel, PrivProt, PrivPass string
	Ver                                                int
	MaxRepetitions, Timeout                            uint32 // Defaults: MaxRepetitions: 5, Timeout: 2
	Snmp                                               *gosnmp.GoSNMP
}

SNMP session object

func (*Session) Get

func (s *Session) Get(oids []string) (SnmpOut, error)

Do SNMP get

func (*Session) New

func (s *Session) New() (*Session, error)

Initializes and returns *gosnmp.GoSNMP in Session.Snmp

func (*Session) Set added in v1.1.0

func (s *Session) Set(setPdus []SetPDU) (SnmpOut, error)

Do SNMP set

func (*Session) Walk

func (s *Session) Walk(oid string, bulk bool, stripoid bool) (SnmpOut, error)

Do SNMP walk or bulkwalk

type SetPDU added in v1.1.0

type SetPDU struct {
	Oid string
	// Integer, OctetString, IPAddress, Gauge32
	Vtype string
	Value interface{}
}

Return pointer to new SnmpPDU

type SnmpOut

type SnmpOut map[string]snmpValue

Session.Result data type. SNMP query results will appear here.

Jump to

Keyboard shortcuts

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