feat(snmp): let a health profile mark a value unknown #72

Merged
christianmanivong merged 4 commits from feat/health-profile-unknown into main 2026-11-01 23:01:41 +00:00
Owner

SnmpValueSpec gets a key unknown: bool. A health-profile entry such as "cpu": {"unknown": True} says the application should report no value for it — not the standard reading, not a default. It stands alone, without oids or table.

Why: NAPALM/napalm-bsd#7 — OpenBSD's net-snmp reports 0 % idle, so the standard reading shows the host at 100 % CPU. Decision: an explicit "unknown" in the contract rather than relying on an empty oids list.

Docs: docstrings, README SNMP section, CHANGELOG [Unreleased] → Added (MINOR). Tested: test_a_value_the_agent_gets_wrong_is_declared_unknown and the updated shape test (failed first); pytest 1039 passed, ruff, mypy clean.

Merge order: this first and release; then napalm-bsd (floor bump) and netOrk (pins).

`SnmpValueSpec` gets a key `unknown: bool`. A health-profile entry such as `"cpu": {"unknown": True}` says the application should report **no** value for it — not the standard reading, not a default. It stands alone, without `oids` or `table`. Why: NAPALM/napalm-bsd#7 — OpenBSD's net-snmp reports 0 % idle, so the standard reading shows the host at 100 % CPU. Decision: an explicit "unknown" in the contract rather than relying on an empty `oids` list. Docs: docstrings, README SNMP section, CHANGELOG [Unreleased] → Added (MINOR). Tested: `test_a_value_the_agent_gets_wrong_is_declared_unknown` and the updated shape test (failed first); pytest 1039 passed, ruff, mypy clean. Merge order: this first and release; then napalm-bsd (floor bump) and netOrk (pins).
christianmanivong added 1 commit 2026-11-01 21:20:16 +00:00
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
9f6ffa8a25
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).
christianmanivong added 3 commits 2026-11-01 22:56:40 +00:00
# Conflicts:
#	CHANGELOG.md
models.py is over the file size limit and may not grow; the unknown
key pushed it past its recorded length. SnmpHealthProfile,
SnmpValueSpec, SnmpMemorySpec and SnmpInterfacesSpec move to
napalm_device_types/snmp_health_profile.py. The package exports them
as before and models re-exports them, so existing imports keep working.
The baseline records the smaller models.py.
Merge remote-tracking branch 'origin/main' into feat/health-profile-unknown
driver / standard (pull_request) Successful in 19s
driver / lint (pull_request) Successful in 18s
driver / types (pull_request) Successful in 1m7s
driver / test (3.12) (pull_request) Successful in 1m8s
driver / test (3.13) (pull_request) Successful in 1m9s
driver / lowest (pull_request) Successful in 40s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 1m11s
CI / driver (pull_request) Successful in 2m57s
driver / publish (pull_request) Skipped
e98d4763f3
# Conflicts:
#	CHANGELOG.md
christianmanivong merged commit 6aadcc3d91 into main 2026-11-01 23:01:41 +00:00
christianmanivong deleted branch feat/health-profile-unknown 2026-11-01 23:01:41 +00:00
Sign in to join this conversation.