72 Commits

Author SHA1 Message Date
Pim van Pelt b17396b1e5 Rework build system; cut release 1.3.1-1
Replace the dpkg-buildpackage / debhelper rig with the same pattern
used in vpp-maglev: a Makefile that cross-compiles CGO-free static
binaries for amd64 and arm64, plus a debian/build-deb.sh that stages
the .deb directly with dpkg-deb. The two arch packages drop into
build/ and run on any glibc/musl Linux of the matching arch.

VERSION is parsed once from debian/changelog and injected at link
time via -ldflags "-X 'main.Version=...' -X 'main.Commit=...' -X
'main.Date=...'", so 'govpp-snmp-agentx --version' is the source of
truth for which build is running. main.go's Version constant becomes
a var to make this work; the old sync-version make target is gone.

Removes the now-unused debian/{control,rules,postinst,prerm,*.debhelper}
files and adds build/ to .gitignore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 18:42:58 +02:00
Pim van Pelt 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
Pim van Pelt 06a1f4401d Release 1.2.3-1 v1.2.3-1 2025-11-23 11:07:02 +01:00
Pim van Pelt b450e02b8d Filter interface data from stats segment by known vpp_iface; this avoids an issue in VPP where deleted interfaces remain in the stats segment 2025-11-23 11:05:05 +01:00
Pim van Pelt 5e36d5c926 Release 1.2.2-1 v1.2.2-1 2025-11-23 10:36:13 +01:00
Pim van Pelt 16bebb0ece Simplify the ifmib integration, stop using reflection, and move to counter updates
Update tests.
2025-11-23 10:31:23 +01:00
Pim van Pelt cdc8765a9e Cut release 1.2.1-1 v1.2.1-1 2025-11-22 06:26:55 +01:00
Pim van Pelt 9596e16887 A few cosmetic changes in session handling 2025-11-22 06:18:01 +01:00
Pim van Pelt 4935f5a8ef Refactor code: clear old OIDs in the Session before updating them 2025-11-22 06:17:23 +01:00
Pim van Pelt b6d2e3b629 Upgrade go-agentx to v0.3.0, containing my ordering fix v1.2.0-1 2025-11-21 10:08:23 +01:00
Pim van Pelt a0d5c61643 Remove redundant constructor, h/t sergio 2025-11-15 22:42:04 +01:00
Pim van Pelt 27c7a5bcae Cut 1.1.6-1 release 2025-11-08 01:40:57 +01:00
Pim van Pelt 9e9103c184 Remove fork of go-agentx because upstream was fixed 2025-11-08 01:36:05 +01:00
Pim van Pelt b358cc2443 Bump dh from 13.11 to 13.24 2025-11-08 01:32:28 +01:00
Pim van Pelt ead795674c lint fix: staticcheck and null derefs 2025-07-03 07:13:42 +02:00
Pim van Pelt dce4750b0f Bump version v1.1.5-1 v1.1.5-1 2025-07-02 23:16:20 +02:00
Pim van Pelt d65e055710 Fix test 2025-07-02 22:31:23 +02:00
Pim van Pelt 8ed14834f5 tighten up logging 2025-06-24 07:51:37 +02:00
Pim van Pelt 3401c96112 Make statsmanager and interfacemanager independent. Add reconnect logic for EventMonitoring 2025-06-24 07:36:10 +02:00
Pim van Pelt 1889934a9c Release 1.1.4-1 v1.1.4-1 2025-06-24 07:06:09 +02:00
Pim van Pelt e93156324d Add tests 2025-06-24 07:03:34 +02:00
Pim van Pelt bdaa2e366b Refactor vpp.go to have the connection mgmt and vpp_*.go to have one Manager each 2025-06-24 07:00:52 +02:00
Pim van Pelt 96b9dd501d Update paths 2025-06-24 06:40:40 +02:00
Pim van Pelt 70cb134dcf Add a note about stats-collect-rx and stats-collect-tx 2025-06-24 06:37:30 +02:00
Pim van Pelt 15216782d1 Debian package 1.1.3-1 v1.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
Pim van Pelt 0d19d50d62 Add make sync-version to keep changelog and main.go Version the same. Update docs. Cut 1.1.2-1 2025-06-23 20:56:59 +02:00
Pim van Pelt 686bbe46b0 Add IF-MIB::ifHighSpeed for >2.5Gbps interfaces
Cut a Debian release.
2025-06-23 20:47:25 +02:00
Pim van Pelt ccc2b5ad4d Cut v1.1.0-1 2025-06-23 19:16:02 +02:00
Pim van Pelt 4f368e625d Use interface details to populate the ifmib, on startup and after each event 2025-06-23 19:11:28 +02:00
Pim van Pelt 35165b0464 Add watchInterfaceEvents() listener 2025-06-23 19:02:02 +02:00
Pim van Pelt 42dbbded3d Simplify debian dependencies, cut release 1.0.3-1 2025-06-19 15:57:53 +02:00
Pim van Pelt f16a2b41ea Remove toolchain 2025-06-19 15:48:43 +02:00
Pim van Pelt 5533ab00de Shorten Makefile 2025-06-17 01:26:23 +02:00
Pim van Pelt 1cbca296c4 Refactor README into a terse synopsis and a larger DETAILS.md doc 2025-06-17 01:06:37 +02:00
Pim van Pelt a73c7cbf91 Update README 2025-06-17 00:59:57 +02:00
Pim van Pelt 1ddc77ec73 Cut a new release with envfile 2025-06-17 00:57:24 +02:00
Pim van Pelt 6063db7311 Move to an envfile for the debian package 2025-06-17 00:55:45 +02:00
Pim van Pelt 7f81b51c1f Move Go code to src/ 2025-06-17 00:47:08 +02:00
Pim van Pelt c0bcdd5449 Make a simple change, bump version to 1.0.1 2025-06-17 00:40:36 +02:00
Pim van Pelt fa437ddaf1 Simplify service file, no longer require permissions on /run/vpp, and set optimal perms on agentx 2025-06-17 00:37:15 +02:00
Pim van Pelt 0b4ff36130 Add manpage 2025-06-17 00:27:35 +02:00
Pim van Pelt 82db92f344 Add an initial 'make pkg-deb' and debian/ control directory 2025-06-17 00:22:01 +02:00
Pim van Pelt adf033318a Add systemd service file 2025-06-16 23:54:55 +02:00
Pim van Pelt 6969e609c0 Fix golangci-lint issues 2025-06-16 23:36:36 +02:00
Pim van Pelt 4fdd0769a5 go mod tidy 2025-06-11 00:27:06 +02:00
Pim van Pelt d408ec2867 move to untimestamped logs, tag the lots INFO and DEBUG. Update tests 2025-06-11 00:22:16 +02:00
Pim van Pelt 0a0e3e7055 Add tests. They are quite basic ... 2025-06-11 00:02:04 +02:00
Pim van Pelt cb8acc4c13 Add LICENSE, add copyright to all files 2025-06-10 23:52:49 +02:00
Pim van Pelt cc08a0218a Simplify - only use queryInterfaceStats() and always do liveness check within it 2025-06-10 14:39:15 +02:00