Skip to content

snmp/unbound: read statistics with stats_noreset - #646

Open
phastier wants to merge 1 commit into
librenms:masterfrom
phastier:unbound-stats-noreset
Open

phastier wants to merge 1 commit into
librenms:masterfrom
phastier:unbound-stats-noreset

Conversation

@phastier

@phastier phastier commented Oct 21, 2026 •

Copy link
Copy Markdown

snmp/unbound reads the statistics with unbound-control stats, which resets the counters after each read. The extend therefore only works when the poller is the only consumer of the statistics and statistics-cumulative is off. With statistics-cumulative: yes (the configuration recommended by the LibreNMS Unbound documentation) the extend returns the raw cumulative counter, which the application stored as a level: observed on three hosts of a fleet on 2026-10-21, the graphs showed 137 448 "queries" instead of about 9 queries per second.

This change reads with stats_noreset, so the extend never resets counters that other tools rely on (a SIEM, a benchmark harness) and the result is correct whether or not statistics-cumulative is set.

Companion change in the application (counters stored as DERIVE): librenms/librenms#20987

Tested on seven Debian 13 / Ubuntu hosts (unbound 1.22–1.24, statistics-cumulative: yes): the extend returns 218–241 fields, the application polls and the recreated RRD files show rates.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XnCY4bbvajtcKnidKWUNWm

`unbound-control stats` resets the counters after each read, so the extend
only worked when the poller was the only consumer of the statistics and
`statistics-cumulative` was off. With `stats_noreset` the counters are left
untouched for other tools (a SIEM, a benchmark harness) and the result is
correct in both configurations; the LibreNMS application stores them as
DERIVE (companion pull request in librenms/librenms).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XnCY4bbvajtcKnidKWUNWm
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants