The driver no longer collects over SNMP. SNMP_HEALTH_PROFILE states where the switch publishes uptime (TimeTicks), CPU and memory (tables with one row per stack unit, first row as before); the application polls and computes (napalm-device-types docs/STRUCTURE.md). Interface counters now come from the 64-bit ifXTable where the switch has it, as the application reads them for every device.
26 lines
963 B
Python
26 lines
963 B
Python
"""The switch's SNMP health OIDs, declared as data (napalm-device-types docs/STRUCTURE.md).
|
|
|
|
The driver does not collect over SNMP; the application polls with this profile.
|
|
"""
|
|
|
|
from napalm_tplink_jetstream.tplink_jetstream import TPLinkJetstreamDriver
|
|
|
|
PROFILE = TPLinkJetstreamDriver.SNMP_HEALTH_PROFILE
|
|
|
|
|
|
def test_the_driver_does_not_collect_itself():
|
|
assert "get_health_metrics" not in vars(TPLinkJetstreamDriver)
|
|
|
|
|
|
def test_uptime_in_timeticks_from_the_tp_link_mib():
|
|
# swt-l2-3-38 answered 129434122 (2026-10-16): TimeTicks, about 15 days.
|
|
assert PROFILE["uptime"] == {"oids": ["1.3.6.1.4.1.11863.6.1.1.9.0"]}
|
|
|
|
|
|
def test_cpu_and_memory_per_unit_take_the_first_row():
|
|
# One row per stack unit; a single switch answers row 1 only.
|
|
assert PROFILE["cpu"] == {"table": "1.3.6.1.4.1.11863.6.4.1.1.1.1.3", "fold": "first"}
|
|
assert PROFILE["memory"] == {
|
|
"percent": {"table": "1.3.6.1.4.1.11863.6.4.1.2.1.1.2", "fold": "first"}
|
|
}
|