feat(snmp): let a health profile mark a value unknown
driver / standard (pull_request) Failing after 15s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 58s
driver / test (3.12) (pull_request) Successful in 1m3s
driver / test (3.13) (pull_request) Successful in 56s
driver / lowest (pull_request) Successful in 35s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m1s
CI / driver (pull_request) Failing after 2m30s
driver / publish (pull_request) Skipped

SnmpValueSpec gains `unknown`. A driver whose device's agent answers a
value wrongly says so in its SNMP_HEALTH_PROFILE, and the application
reports no value for it instead of the standard reading or a default.
OpenBSD's net-snmp reports the CPU as never idle, so a reading of
ssCpuIdle shows every OpenBSD host at 100 % (NAPALM/napalm-bsd#7).
This commit is contained in:
christianmanivong committed 2026-11-01 22:11:19 +01:00
1 parent a809e6c02f
commit 9f6ffa8a25
4 files changed
+25 -3

No files matched your search

+3
View File
@@ -132,6 +132,9 @@ class MySwitchDriver(SwitchDriver):
A value is `oids` (the first that answers wins) or a `table` folded by `first`, `average`
or `max`, with an optional `pattern` for an agent that answers with text. What the profile
does not name, the application reads from the standard UCD-MIB and IF-MIB.
A value the agent gets wrong is `{"unknown": True}`: the application then reports no value
for it, rather than the standard reading or a default (OpenBSD's net-snmp reports its CPU
as never idle).
`KernelFactsMixin` (`get_kernel_facts`) is the exception that is mixed in by a driver
rather than by a role base: what a Linux kernel has built and loaded is read the same way