pim eeb827665a Fix ifSpeed/ifHighSpeed for >1Gbps interfaces
Two related bugs left interfaces faster than 1Gbps reporting wrong
values to SNMP collectors:

1. ifSpeed (.5) was silently dropped for interfaces whose link speed
   exceeded 2.5Gbps. RFC 2863 requires ifSpeed to always be present
   and saturated at uint32 max (4294967295) when the real speed
   exceeds what fits in a Gauge32; ifHighSpeed carries the actual
   Mbps value. The row is now always emitted, capped at math.MaxUint32.

2. UpdateStats only rebuilt the MIB when the interface set changed.
   On startup, the stats routine connects to VPP and runs the first
   poll before the 1-second event-monitor poll has had a chance to
   call InitializeEventWatching, so the MIB is built from an empty
   interfaceDetails map and every row defaults to 1Gbps for life.

   Fix: filterValidInterfaces (which already calls
   GetAllInterfaceDetails to filter deleted interfaces from the stats
   segment) now also pushes those details through the MIB callback
   via a new InterfaceManager.NotifyDetails method. UpdateInterface-
   Details sets a staticFieldsDirty flag whenever Speed/MAC/MTU/
   admin/oper/name actually change, and UpdateStats forces a rebuild
   on the next poll while that flag is set. Identical re-pushes do
   not dirty the cache, so AgentX session re-registration only
   happens on real change.

Adds tests for the ifSpeed branches (0/nil/1G/10G/25G/100G) and for
the dirty-flag transitions (fresh push, identical re-push, changed
Speed).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 18:42:35 +02:00
2025-11-23 11:07:02 +01:00
2025-06-24 06:40:40 +02:00

VPP SNMP AgentX Bridge

SNMP AgentX daemon that exposes VPP interface statistics via standard IF-MIB.

Quick Start

# Build
make build

# Test  
make test

# Create Debian package
make pkg-deb

# Install package
sudo dpkg -i ../govpp-snmp-agentx_*.deb

Configuration

The Debian package installs a systemd service that reads configuration from /etc/default/govpp-snmp-agentx:

# Edit service configuration
sudo nano /etc/default/govpp-snmp-agentx

# Start service
sudo systemctl start govpp-snmp-agentx

Default configuration:

GOVPP_SNMP_AGENTX_FLAGS="-agentx.addr /var/agentx/master -vppcfg /etc/vpp/vppcfg.yaml -vppstats.period 10"

Documentation

  • Manual page: man govpp-snmp-agentx (after package installation)
  • Detailed documentation: docs/DETAILS.md

License

LGPL 3.0 (due to modified go-agentx dependency)

S
Description
An SNMP AgentX which passes GoVPP stats to SNMPd
Readme 316 KiB
Languages
Go 97.5%
Makefile 2.5%