-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontrollers.go
41 lines (32 loc) · 972 Bytes
/
controllers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package cntlr
import (
"github.com/NETWAYS/check_hp_firmware/hp/mib"
"github.com/NETWAYS/check_hp_firmware/snmp"
"github.com/gosnmp/gosnmp"
)
type CpqDaCntlrTable struct {
Snmp *snmp.Table
}
func GetCpqDaCntlrTable(client gosnmp.Handler) (*CpqDaCntlrTable, error) {
table := CpqDaCntlrTable{}
table.Snmp = &snmp.Table{
Client: client,
Oid: mib.CpqDaCntlrTable,
}
return &table, table.Snmp.Walk()
}
func (t *CpqDaCntlrTable) ListIds() []string {
return t.Snmp.GetSortedOIDs()
}
func (t *CpqDaCntlrTable) GetValue(id string, oid string) (interface{}, error) {
return t.Snmp.GetValue(id, oid)
}
func (t *CpqDaCntlrTable) GetStringValue(id string, oid string) (string, error) {
return t.Snmp.GetStringValue(id, oid)
}
func (t *CpqDaCntlrTable) GetUintValue(id string, oid string) (uint, error) {
return t.Snmp.GetUintValue(id, oid)
}
func (t *CpqDaCntlrTable) GetIntValue(id string, oid string) (int, error) {
return t.Snmp.GetIntValue(id, oid)
}