Add watchInterfaceEvents() listener
This commit is contained in:
@ -13,9 +13,9 @@ import (
|
||||
"github.com/posteo/go-agentx/value"
|
||||
"go.fd.io/govpp/api"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
|
||||
"govpp-snmp-agentx/logger"
|
||||
"govpp-snmp-agentx/vppstats"
|
||||
"govpp-snmp-agentx/vpp"
|
||||
)
|
||||
|
||||
// IF-MIB OID bases:
|
||||
@ -72,8 +72,8 @@ type VPPConfig struct {
|
||||
}
|
||||
|
||||
type VPPInterface struct {
|
||||
Description string `yaml:"description"`
|
||||
SubInterfaces map[string]VPPInterface `yaml:"sub-interfaces"`
|
||||
Description string `yaml:"description"`
|
||||
SubInterfaces map[string]VPPInterface `yaml:"sub-interfaces"`
|
||||
}
|
||||
|
||||
type InterfaceMIB struct {
|
||||
@ -172,7 +172,7 @@ func (m *InterfaceMIB) UpdateStats(interfaceStats *api.InterfaceStats) {
|
||||
}
|
||||
|
||||
func (m *InterfaceMIB) addInterfaceToMIB(iface *api.InterfaceCounters) {
|
||||
idx := int(iface.InterfaceIndex) + *vppstats.IfIndexOffset
|
||||
idx := int(iface.InterfaceIndex) + *vpp.IfIndexOffset
|
||||
|
||||
// Add ifEntry (classic interface table) entries
|
||||
m.addIfEntry(iface, idx)
|
||||
|
Reference in New Issue
Block a user