feat: declare the SNMP health OIDs instead of collecting them (0.2.0)
CI / test (3.10) (push) Successful in 32s
CI / test (3.11) (push) Successful in 32s
CI / test (3.12) (push) Successful in 33s
CI / test (3.10) (pull_request) Successful in 32s
CI / test (3.11) (pull_request) Successful in 29s
CI / test (3.12) (pull_request) Successful in 33s

netgear_smart no longer collects over SNMP. SNMP_HEALTH_PROFILE states
where the switch publishes uptime (standard sysUpTime), memory (total
and free in KiB) and CPU (a text value whose five-second figure
counts); 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.
This commit is contained in:
Christian Manivong committed 2026-10-16 12:03:00 +02:00
1 parent fc6219cd59
commit 6b305c3d47
3 files changed
+48 -75

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
"""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.
"""
import re
from napalm_netgear.netgear_smart import NetgearSmartDriver
PROFILE = NetgearSmartDriver.SNMP_HEALTH_PROFILE
def test_the_driver_does_not_collect_itself():
assert "get_health_metrics" not in vars(NetgearSmartDriver)
def test_uptime_from_the_standard_sysuptime():
assert PROFILE["uptime"] == {"oids": ["1.3.6.1.2.1.1.3.0"]}
def test_memory_from_total_and_free_in_kib():
assert PROFILE["memory"] == {
"total": {"oids": ["1.3.6.1.4.1.4526.100.1.1.4.2.0"]},
"free": {"oids": ["1.3.6.1.4.1.4526.100.1.1.4.1.0"]},
"unit": "KiB",
}
def test_cpu_is_the_five_second_figure_in_a_text_value():
cpu = PROFILE["cpu"]
assert cpu["oids"] == ["1.3.6.1.4.1.4526.100.1.1.4.9.0"]
text = " 5 Secs ( 3.2%) 60 Secs ( 4.1%) 300 Secs ( 2.0%)"
assert re.search(cpu["pattern"], text).group(1) == "3.2"