Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct { AuthProtocol string `toml:"auth_protocol"` // Values: "MD5", "SHA", "". Default: "" AuthPassword string `toml:"auth_password"` PrivProtocol string `toml:"priv_protocol"` // Values: "DES", "AES", "". Default: "" PrivPassword string `toml:"priv_password"` EngineID string `toml:"-"` Community string `toml:"community"` // Parameters for Version 1 & 2 ContextName string `toml:"context_name"` // Parameters for Version 3 SecLevel string `toml:"sec_level"` // Values: "noAuthNoPriv", "authNoPriv", "authPriv" SecName string `toml:"sec_name"` Timeout internal.Duration `toml:"timeout"` // Timeout to wait for a response. Retries int `toml:"retries"` MaxRepetitions uint32 `toml:"max_repetitions"` // Parameters for Version 2 & 3 EngineBoots uint32 `toml:"-"` EngineTime uint32 `toml:"-"` Version uint8 `toml:"version"` // Values: 1, 2, 3 }
type GosnmpWrapper ¶
GosnmpWrapper wraps a *gosnmp.GoSNMP object so we can use it as a snmpConnection.
func NewWrapper ¶
func NewWrapper(s ClientConfig) (GosnmpWrapper, error)
func (GosnmpWrapper) Close ¶ added in v0.0.35
func (gsw GosnmpWrapper) Close() error
Close returns the value of GoSNMP.Target.
func (GosnmpWrapper) Get ¶
func (gsw GosnmpWrapper) Get(oids []string) (*gosnmp.SnmpPacket, error)
Get wraps GoSNMP.GET(). If any error is encountered, it will just once reconnect and try again.
func (GosnmpWrapper) Host ¶
func (gsw GosnmpWrapper) Host() string
Host returns the value of GoSNMP.Target.
func (*GosnmpWrapper) SetAgent ¶
func (gsw *GosnmpWrapper) SetAgent(agent string) error
SetAgent takes a url (scheme://host:port) and sets the wrapped GoSNMP struct's corresponding fields. This shouldn't be called after using the wrapped GoSNMP struct, for example after connecting.
Click to show internal directories.
Click to hide internal directories.