Compare commits

..

2 Commits

Author SHA1 Message Date
Pim van Pelt
15216782d1 Debian package 1.1.3-1 2025-06-24 06:28:18 +02:00
Pim van Pelt
067e324cca Make a compromise: Use Rx.Packets and Tx.Packets if the *Unicast.Packets is empty. Add a comment in the code to explain why 2025-06-24 06:25:46 +02:00
3 changed files with 32 additions and 5 deletions

9
debian/changelog vendored
View File

@@ -1,3 +1,12 @@
govpp-snmp-agentx (1.1.3-1) bookworm; urgency=medium
* Use fallback packet counters when VPP unicast stats are unavailable
* Fix unicast packet reporting for interfaces without detailed stats collection
* Add VPP configuration comments for stats-collect feature requirements
* Improve packet counter accuracy across different VPP configurations
-- Pim van Pelt <pim@ipng.ch> Mon, 24 Jun 2025 00:00:00 +0000
govpp-snmp-agentx (1.1.2-1) bookworm; urgency=medium
* Add startup version logging to INFO log level

View File

@@ -294,7 +294,12 @@ func (m *InterfaceMIB) addIfEntry(iface *api.InterfaceCounters, idx int) {
// ifInUcastPkts (.11)
item = m.handler.Add(fmt.Sprintf("%s.11.%d", ifEntryOID, idx))
item.Type = pdu.VariableTypeCounter32
item.Value = uint32(iface.RxUnicast.Packets)
// iface.Rx*cast.Packets is only set if "set interface feature X stats-collect-rx arc device-input" is configured
if iface.RxUnicast.Packets == 0 {
item.Value = uint32(iface.Rx.Packets)
} else {
item.Value = uint32(iface.RxUnicast.Packets)
}
// ifInNUcastPkts (.12) - multicast + broadcast
item = m.handler.Add(fmt.Sprintf("%s.12.%d", ifEntryOID, idx))
@@ -324,7 +329,12 @@ func (m *InterfaceMIB) addIfEntry(iface *api.InterfaceCounters, idx int) {
// ifOutUcastPkts (.17)
item = m.handler.Add(fmt.Sprintf("%s.17.%d", ifEntryOID, idx))
item.Type = pdu.VariableTypeCounter32
item.Value = uint32(iface.TxUnicast.Packets)
// iface.Tx*cast.Packets is only set if "set interface feature X stats-collect-tx arc interface-output" is configured
if iface.TxUnicast.Packets == 0 {
item.Value = uint32(iface.Tx.Packets)
} else {
item.Value = uint32(iface.TxUnicast.Packets)
}
// ifOutNUcastPkts (.18) - multicast + broadcast
item = m.handler.Add(fmt.Sprintf("%s.18.%d", ifEntryOID, idx))
@@ -385,7 +395,11 @@ func (m *InterfaceMIB) addIfXTable(iface *api.InterfaceCounters, idx int) {
// ifHCInUcastPkts (.7)
item = m.handler.Add(fmt.Sprintf("%s.7.%d", ifXTableOID, idx))
item.Type = pdu.VariableTypeCounter64
item.Value = iface.RxUnicast.Packets
if iface.RxUnicast.Packets == 0 {
item.Value = iface.Rx.Packets
} else {
item.Value = iface.RxUnicast.Packets
}
// ifHCInMulticastPkts (.8)
item = m.handler.Add(fmt.Sprintf("%s.8.%d", ifXTableOID, idx))
@@ -405,7 +419,11 @@ func (m *InterfaceMIB) addIfXTable(iface *api.InterfaceCounters, idx int) {
// ifHCOutUcastPkts (.11)
item = m.handler.Add(fmt.Sprintf("%s.11.%d", ifXTableOID, idx))
item.Type = pdu.VariableTypeCounter64
item.Value = iface.TxUnicast.Packets
if iface.TxUnicast.Packets == 0 {
item.Value = iface.Tx.Packets
} else {
item.Value = iface.TxUnicast.Packets
}
// ifHCOutMulticastPkts (.12)
item = m.handler.Add(fmt.Sprintf("%s.12.%d", ifXTableOID, idx))

View File

@@ -16,7 +16,7 @@ import (
"govpp-snmp-agentx/vpp"
)
const Version = "1.1.2-1"
const Version = "1.1.3-1"
func main() {
debug := flag.Bool("debug", false, "Enable debug logging")