Documentation ¶
Index ¶
- Constants
- type DeviceIfOctets
- type SnmpAuth
- type SnmpDevice
- type SnmpV2Client
- func (c *SnmpV2Client) BulkWalkAll(oid string) (map[string]SnmpValue, error)
- func (c *SnmpV2Client) Close() error
- func (c *SnmpV2Client) CollectDevice(device *SnmpDevice) error
- func (c *SnmpV2Client) CollectDeviceSystemInfo(device *SnmpDevice) (err error)
- func (c *SnmpV2Client) CollectIfOctets(device *SnmpDevice) (err error)
- func (c *SnmpV2Client) CollectOids(oids []string) (map[string]SnmpValue, error)
- type SnmpValue
Constants ¶
View Source
const ( VendorMikrotik = "14988" VendorH3C = "25506" VendorHuawei = "2011" VendorRuijie = "4881" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceIfOctets ¶
type SnmpDevice ¶
type SnmpDevice struct { SnmpAuth ShopId int64 ShopName string VendorName string VendorCode string SoftwareIdOid string SoftwareId string SnOid string UseSnOid bool Sn string SystemNameOid string SystemName string ModelOid string Model string CpuLoad float64 UptimeOid string Uptime int64 MemTotal int64 MemUsage int64 MemPercent float64 DiskUsage int64 DiskTotal int64 DiskPercent float64 IfOctetsMap map[int64]*DeviceIfOctets }
func NewH3CDevice ¶
func NewH3CDevice() *SnmpDevice
func NewHuaweiDevice ¶
func NewHuaweiDevice() *SnmpDevice
func NewMikrotikDevice ¶
func NewMikrotikDevice() *SnmpDevice
func NewRuijieDevice ¶
func NewRuijieDevice() *SnmpDevice
func (*SnmpDevice) IfaceDocments ¶
func (dev *SnmpDevice) IfaceDocments() ([]map[string]interface{}, error)
func (*SnmpDevice) SnmpDocment ¶
func (dev *SnmpDevice) SnmpDocment() (map[string]interface{}, error)
func (*SnmpDevice) ToJson ¶
func (dev *SnmpDevice) ToJson() string
type SnmpV2Client ¶
func NewSnmpV2Client ¶
func NewSnmpV2Client(target string, port int, community string) (*SnmpV2Client, error)
func NewSnmpV2Client2 ¶
func NewSnmpV2Client2(auth SnmpAuth) (*SnmpV2Client, error)
func (*SnmpV2Client) BulkWalkAll ¶
func (c *SnmpV2Client) BulkWalkAll(oid string) (map[string]SnmpValue, error)
func (*SnmpV2Client) CollectDevice ¶
func (c *SnmpV2Client) CollectDevice(device *SnmpDevice) error
CollectDevice 采集设备信息
func (*SnmpV2Client) CollectDeviceSystemInfo ¶
func (c *SnmpV2Client) CollectDeviceSystemInfo(device *SnmpDevice) (err error)
CollectDeviceSystemInfo 采集设备系统信息
func (*SnmpV2Client) CollectIfOctets ¶
func (c *SnmpV2Client) CollectIfOctets(device *SnmpDevice) (err error)
func (*SnmpV2Client) CollectOids ¶
func (c *SnmpV2Client) CollectOids(oids []string) (map[string]SnmpValue, error)
CollectOids 批量采集OID
type SnmpValue ¶
func (SnmpValue) Int64Value ¶
func (SnmpValue) MacAddr ¶
func (v SnmpValue) MacAddr() net.HardwareAddr
func (SnmpValue) StringValue ¶
Click to show internal directories.
Click to hide internal directories.