snmpp

package
v0.0.0-...-5224d69 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSnmpPort  = 161
	DefaultCommunity = "public"
)

Variables

View Source
var OidPattern = regexp.MustCompile(`\.?\d+(\.\d+)*`)

Functions

func If

func If[T any](b bool, s1, s2 T) T

func IsSymbolName

func IsSymbolName(oid string) bool

func JoinLines

func JoinLines(s string) string

func LoadMibs

func LoadMibs(verbose bool) *smi.MIB

func Or

func Or(a, b string) string

func ParseOIDSymbolName

func ParseOIDSymbolName(dotOid string, mib *smi.MIB) (symbolName, description string, sym *smi.Symbol)

func SymbolString

func SymbolString(symbol *smi.Symbol, suffix smi.OID) (symbolName, description string)

Types

type ClientConfig

type ClientConfig struct {
	Timeout time.Duration `toml:"timeout" usage:"Timeout to wait for a response."`

	Retries              int    `toml:"retries" flag:",r" usage:"Number of retries to attempt."`
	Version              int    `toml:"version" flag:",v" usage:"SNMP version; can be 1, 2, or 3."`
	UnconnectedUDPSocket bool   `` /* 215-byte string literal not displayed */
	Community            string `toml:"community" usage:"SNMP community string, Parameters for Version 1 & 2"`

	MaxRepetitions int `toml:"max_repetitions" usage:"The GETBULK max-repetitions parameter, Parameters for Version 2 & 3"`

	ContextName  string `toml:"context_name" flag:",n" usage:"Context Name. for SNMPv3"`
	SecLevel     string `toml:"sec_level" usage:"Security Level; one of none, authNoPriv, or authPriv. for SNMPv3"`
	UserName     string `toml:"user_name" flag:",u" usage:"User Name. for SNMPv3"`
	AuthProtocol string `toml:"auth_protocol" flag:",a" usage:"Authentication protocol; one of MD5, SHA, SHA224, SHA256, SHA384, SHA512. for SNMPv3"`
	AuthPassword string `toml:"auth_password" flag:",A" usage:"Authentication password"`
	// Protocols "AES192", "AES192", "AES256", and "AES256C" require the underlying net-snmp tools
	// to be compiled with --enable-blumenthal-aes (http://www.net-snmp.org/docs/INSTALL.html)
	PrivProtocol string `toml:"priv_protocol" usage:"Privacy protocol used for encrypted messages; one of DES, AES, AES192, AES192C, AES256, AES256C"`
	PrivPassword string `toml:"priv_password" flag:",X" usage:"Privacy password used for encrypted messages"`

	EngineID    string `toml:"engine_id"`
	EngineBoots int    `toml:"engine_boots"`
	EngineTime  int    `toml:"engine_time"`
}

func (*ClientConfig) CreateGoSNMP

func (o *ClientConfig) CreateGoSNMP(target string, verbose bool) *g.GoSNMP

func (*ClientConfig) SetVersion3Parameters

func (o *ClientConfig) SetVersion3Parameters(gs *g.GoSNMP)

Jump to

Keyboard shortcuts

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