Linux userland helpers shared by linux, proxmox and openwrt (snmpd, lldpctl, apk, package names) #13

Open
opened 2026-10-06 17:31:30 +00:00 by christianmanivong · 1 comment
Owner

SNMP fix. napalm_linux/linux.py:2242 and napalm_proxmox/system_mixin.py:509 implement the same Debian snmpd fix:

  • the same snmpd.conf body (linux :2305, proxmox :538);
  • the same snmpget probe and success markers (linux :2362–2366, proxmox :583–586);
  • the same peer detection and ufw rule.

linux adds a sudo check, a table of package managers and an iptables fallback. proxmox is apt only.

Also shared

  • lldpctl: see NAPALM/napalm-device-types#10.
  • apk: linux.py:1068 (apk info -v, greedy split) and openwrt/packages_mixin.py:77 (apk list --installed, lazy split). The two splits disagree for names that contain -<digit>.
  • Package names: the same allowlist regex ^[a-zA-Z0-9_\-\.]+$, with or without +, appears in opnsense, linux, openwrt and proxmox.

Framed reports. In napalm-device-types itself, listening.py:72/:82 and systemd.py:154/:164 each carry _frame (cut a report out between begin/end markers) and _sections (split it into [section] blocks). _frame differs only in its error text. _sections differs in one check: listening requires a header without spaces. One report_frame(output, begin, end, what) and report_sections(lines) would serve both, and any later framed report.

Proposal: a Linux-userland module next to kernel.py/systemd.py. It holds the snmpd config and probe (snmp_probe_ok(output)), parse_apk_installed() and validate_package_name().

Prio P4.

From the NetOrk function index (NetOrk/netork#670); every location was checked against the current code. Paths are relative to each driver repo.

**SNMP fix.** `napalm_linux/linux.py`:2242 and `napalm_proxmox/system_mixin.py`:509 implement the same Debian snmpd fix: - the same `snmpd.conf` body (linux :2305, proxmox :538); - the same `snmpget` probe and success markers (linux :2362–2366, proxmox :583–586); - the same peer detection and ufw rule. linux adds a sudo check, a table of package managers and an iptables fallback. proxmox is apt only. **Also shared** - **lldpctl:** see NAPALM/napalm-device-types#10. - **apk:** `linux.py`:1068 (`apk info -v`, greedy split) and `openwrt/packages_mixin.py`:77 (`apk list --installed`, lazy split). The two splits disagree for names that contain `-<digit>`. - **Package names:** the same allowlist regex `^[a-zA-Z0-9_\-\.]+$`, with or without `+`, appears in opnsense, linux, openwrt and proxmox. **Framed reports.** In napalm-device-types itself, `listening.py`:72/:82 and `systemd.py`:154/:164 each carry `_frame` (cut a report out between begin/end markers) and `_sections` (split it into `[section]` blocks). `_frame` differs only in its error text. `_sections` differs in one check: listening requires a header without spaces. One `report_frame(output, begin, end, what)` and `report_sections(lines)` would serve both, and any later framed report. **Proposal:** a Linux-userland module next to `kernel.py`/`systemd.py`. It holds the snmpd config and probe (`snmp_probe_ok(output)`), `parse_apk_installed()` and `validate_package_name()`. Prio P4. From the NetOrk function index (NetOrk/netork#670); every location was checked against the current code. Paths are relative to each driver repo.
Author
Owner

Re-homed by docs/STRUCTURE.md (NAPALM/napalm-device-types#37, NetOrk/netork#1105): the Linux userland helpers go to napalm-unix (#35). The snmpd part becomes the steps of the SNMP fix template (#33); the config values come from the caller.

Re-homed by `docs/STRUCTURE.md` (NAPALM/napalm-device-types#37, NetOrk/netork#1105): the Linux userland helpers go to napalm-unix (#35). The snmpd part becomes the steps of the SNMP fix template (#33); the config values come from the caller.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-device-types#13