-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdrives.go
41 lines (32 loc) · 982 Bytes
/
drives.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 drive
import (
"github.com/NETWAYS/check_hp_firmware/hp/mib"
"github.com/NETWAYS/check_hp_firmware/snmp"
"github.com/gosnmp/gosnmp"
)
type CpqDaPhyDrvTable struct {
Snmp *snmp.Table
}
func GetCpqDaPhyDrvTable(client gosnmp.Handler) (*CpqDaPhyDrvTable, error) {
table := CpqDaPhyDrvTable{}
table.Snmp = &snmp.Table{
Client: client,
Oid: mib.CpqDaPhyDrvTable,
}
return &table, table.Snmp.Walk()
}
func (t *CpqDaPhyDrvTable) ListIds() []string {
return t.Snmp.GetSortedOIDs()
}
func (t *CpqDaPhyDrvTable) GetValue(id string, oid string) (interface{}, error) {
return t.Snmp.GetValue(id, oid)
}
func (t *CpqDaPhyDrvTable) GetStringValue(id string, oid string) (string, error) {
return t.Snmp.GetStringValue(id, oid)
}
func (t *CpqDaPhyDrvTable) GetUintValue(id string, oid string) (uint, error) {
return t.Snmp.GetUintValue(id, oid)
}
func (t *CpqDaPhyDrvTable) GetIntValue(id string, oid string) (int, error) {
return t.Snmp.GetIntValue(id, oid)
}