SNMP: drivers declare a health profile as data; deprecate HealthMetricsMixin #32

Closed
opened 2026-10-14 08:22:57 +00:00 by christianmanivong · 0 comments
Owner

HealthMetricsMixin (health_metrics.py) and _ucd_metrics.py collect CPU, memory, load and interface counters over SNMP. The collector is a classmethod that the application calls with its own snmp_get/snmp_walk; the driver is not even connected while it runs. It is mixed into five role bases, and four drivers (procurve, netgear, tplink-jetstream, yealink) override it with proprietary OIDs.

Change

  • Add SnmpHealthProfile (TypedDict) to models: the OIDs a device publishes uptime, CPU, memory and interface counters under, plus the two switches the mixin carries today (_SNMP_SKIP_IF, _SNMP_TX_ERR_IS_DROP).
  • A driver whose device answers standard UCD-MIB/IF-MIB declares nothing. Others set SNMP_HEALTH_PROFILE as a class attribute.
  • Mark HealthMetricsMixin, collect_ucd_metrics and the OID constants deprecated; remove them in 5.0.
  • Rule test: no module imports asyncio.

Part of NetOrk/netork#1105. Plan: NAPALM/napalm-device-types docs/STRUCTURE.md (branch docs/structure-plan).

Prio P3: the first step after the docs; the application side waits on it.

`HealthMetricsMixin` (`health_metrics.py`) and `_ucd_metrics.py` collect CPU, memory, load and interface counters over SNMP. The collector is a classmethod that the application calls with its own `snmp_get`/`snmp_walk`; the driver is not even connected while it runs. It is mixed into five role bases, and four drivers (procurve, netgear, tplink-jetstream, yealink) override it with proprietary OIDs. **Change** - Add `SnmpHealthProfile` (TypedDict) to `models`: the OIDs a device publishes uptime, CPU, memory and interface counters under, plus the two switches the mixin carries today (`_SNMP_SKIP_IF`, `_SNMP_TX_ERR_IS_DROP`). - A driver whose device answers standard UCD-MIB/IF-MIB declares nothing. Others set `SNMP_HEALTH_PROFILE` as a class attribute. - Mark `HealthMetricsMixin`, `collect_ucd_metrics` and the OID constants deprecated; remove them in 5.0. - Rule test: no module imports `asyncio`. Part of NetOrk/netork#1105. Plan: NAPALM/napalm-device-types `docs/STRUCTURE.md` (branch `docs/structure-plan`). Prio P3: the first step after the docs; the application side waits on it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-device-types#32