SNMP: get_snmp_information reads the community table's Index column as the community #14

Closed
opened 2026-11-01 21:44:46 +00:00 by christianmanivong · 0 comments
Owner

What happens

get_snmp_information (tplink_jetstream.py:1463) parses show snmp community by taking the first word of every row after the dashes (comm_name = parts[0]), and its mode check reads parts[1]. A table recorded from a real JetStream switch (swt-l0-2-15, 2026-11-01) starts with an Index column:

Index     Name             Type           MIB-View
-----     ----             ----           --------
1         public           read-only      viewDefault

So get_snmp_information reports the community "1", and its mode check reads the name column instead of the type, so every community comes out read-only.

get_snmp_config had the same bug; PR #13 (branch fix/bugs-2026-11) fixes it with a header-based parser parse_snmp_communities in the new napalm_tplink_jetstream/parsers.py, against this recording as fixture. configure_snmp_agent's check searches the whole output and is unaffected.

The command is sent in three places (lines 1449, 1943, 2025) with three readings of its output; the driver sends show snmp community, the recording used show snmp-server community (presumably an abbreviation of the same keyword — unverified).

Expected

get_snmp_information uses parse_snmp_communities (once PR #13 is merged) and reads the access from the Type column.

Priority: P4 — wrong community name in get_snmp_information; netOrk reads SNMP settings through get_snmp_config.

Found during the bug sweep of 2026-11-01.

## What happens `get_snmp_information` (`tplink_jetstream.py:1463`) parses `show snmp community` by taking the first word of every row after the dashes (`comm_name = parts[0]`), and its mode check reads `parts[1]`. A table recorded from a real JetStream switch (swt-l0-2-15, 2026-11-01) starts with an Index column: ``` Index Name Type MIB-View ----- ---- ---- -------- 1 public read-only viewDefault ``` So `get_snmp_information` reports the community `"1"`, and its mode check reads the name column instead of the type, so every community comes out read-only. `get_snmp_config` had the same bug; PR #13 (branch `fix/bugs-2026-11`) fixes it with a header-based parser `parse_snmp_communities` in the new `napalm_tplink_jetstream/parsers.py`, against this recording as fixture. `configure_snmp_agent`'s check searches the whole output and is unaffected. The command is sent in three places (lines 1449, 1943, 2025) with three readings of its output; the driver sends `show snmp community`, the recording used `show snmp-server community` (presumably an abbreviation of the same keyword — unverified). ## Expected `get_snmp_information` uses `parse_snmp_communities` (once PR #13 is merged) and reads the access from the Type column. Priority: P4 — wrong community name in `get_snmp_information`; netOrk reads SNMP settings through `get_snmp_config`. Found during the bug sweep of 2026-11-01.
christianmanivong added the
prio
P4
bug
labels 2026-11-01 21:44:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-tplink-jetstream#14