SNMP¶
The richest backend, available on every Fully Managed and Smart Managed Pro model. Plus switches have no SNMP agent at all.
Switches that speak it¶
What it can do, per switch¶
Operation |
m4300-24x |
m4300-16x |
gsm7252ps |
gsm7228ps |
gs728tpp |
|---|---|---|---|---|---|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
— [SNMP-1] |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
— [SNMP-2] |
— [SNMP-2] |
— [SNMP-2] |
— [SNMP-2] |
— [SNMP-2] |
|
— [SNMP-3] |
— [SNMP-3] |
— [SNMP-3] |
— [SNMP-3] |
— [SNMP-3] |
|
✓ |
✓ |
✓ |
✓ |
— [SNMP-4] |
|
— [SNMP-5] |
— [SNMP-5] |
— [SNMP-5] |
— [SNMP-5] |
— [SNMP-5] |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
— [SNMP-1] |
✓ |
✓ |
✓ |
✓ |
|
— [SNMP-1] |
✓ |
✓ |
✓ |
✓ |
|
— [SNMP-1] |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
— [SNMP-6] |
— [SNMP-6] |
— [SNMP-6] |
— [SNMP-6] |
— [SNMP-6] |
|
— [SNMP-7] |
— [SNMP-7] |
— [SNMP-7] |
— [SNMP-7] |
— [SNMP-7] |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
— [SNMP-8] |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
— [SNMP-9] |
|
✓ |
✓ |
✓ |
✓ |
✓ |
|
✓ |
✓ |
✓ |
✓ |
— [SNMP-4] |
|
✓ |
✓ |
✓ |
✓ |
— [SNMP-4] |
|
model ‘gs728tpp’ registers no Netgear vendor OID subtree, and the logging columns are vendor-only
model ‘gs728tpp’: this model’s SNMP agent cannot create a VLAN: every RowStatus mechanism (createAndGo, createAndGo+name in one PDU, createAndWait->name->active, the name column alone, and createAndGo carrying an egress PortList) is answered inconsistentValue – measured on the device. Membership, PVID and delete DO work over SNMP; create a VLAN over the HTTP backend
model ‘gs728tpp’ registers no Netgear vendor OID subtree, and the management-IP write columns are vendor-only
Transports¶
Mode |
Implementation |
Notes |
|---|---|---|
Synchronous |
|
Shells out to |
Asynchronous |
|
Uses pysnmp from the |
Both satisfy the same SnmpClient protocol, so a reader neither knows nor
cares which is underneath — and either can be pointed at a mock.
Note
The net-snmp CLI route was chosen deliberately: ezsnmp fails to build on
arm64, and shelling out to the reference implementation removes a whole class
of encoding disagreements. The cost is a system dependency —
apt install snmp.
What is read from where¶
Almost everything comes from standard MIBs, which is why it works across models that share no vendor OIDs at all:
Data |
Source |
|---|---|
Port status |
|
Counters |
|
VLANs and PVIDs |
|
MAC table |
|
LLDP |
|
PoE |
|
Management IP |
|
Sensors |
Vendor fan/PSU/temperature columns where present; otherwise the
|
Vendor subtrees¶
Two Netgear enterprise subtrees appear in this fleet, and which one a model uses is recorded in its registry entry:
1.3.6.1.4.1.4526.10— Fully Managed (M4300, GSM7252PS).1.3.6.1.4.1.4526.11— Smart Managed Pro (S3300 / GSM7228PS).Neither — the GS728TPP implements no vendor OIDs whatsoever. A walk of
1.3.6.1.4.1.4526answersnoSuchObject; itssysObjectIDof4526.100.4.27is only an identifier value, not a data subtree.
Code guards on oids.has_vendor_oids(model) instead of assuming a subtree is
there, which is what makes the vendor-free model work at all.
Warning
A model’s sysObjectID product identifier and its vendor data subtree
are different things. The S3300’s product OID is 4526.100.10.19 while its
data lives under 4526.11. Confusing the two is what made model
auto-detection fail on that switch.
Model identification¶
detect_model reads sysObjectID and sysDescr. sysObjectID is
preferred: it is an unambiguous product identifier, so it can separate SKUs
whose sysDescr text is indistinguishable — the S3300-52X from the
unregistered S3300-28X, for instance. The OID map holds only values proven by a
live capture, never one read off a specification sheet, and an unmatched switch
yields key=None rather than a guess.
VLAN writes¶
Two dialects, selected by SwitchModel.snmp_vlan_write:
"qbridge"Read-modify-write of
dot1qVlanStaticEgressPortsanddot1qVlanStaticUntaggedPorts. Verified on the GSM7252PS and the S3300 — and it is the only mechanism either publishes: a walk of the vendor switchport table returns zero rows on both, versus 1520 and 1440 rows on the two M4300s."fastpath_switchport"Writes go to the vendor switchport table
1.3.6.1.4.1.4526.10.1.2.8.37.1: column 2 is the port mode (access/trunk/general), column 3 the access VLAN, column 6 the allowed-VLAN bitmap. Columns 7 and 8 (untagged and tagged bitmaps) arenotWritable.
On FASTPATH 12.x the standard columns are effectively unusable:
dot1qVlanStaticEgressPorts is writable only while no interface on the
switch is in access mode, and an untagged membership write is expressed as
access mode — so the standard dialect would disable itself on first use.
dot1qVlanStaticUntaggedPorts is worse than read-only: a SET returns
noError and is then silently discarded. dot1qVlanStaticRowStatus :=
notInService also commitFails, so there is no RFC 2674
suspend-modify-activate route either.
PortList widths¶
A PortList bitmap’s width is a property of the device, not of its port
count. The three measured here are 79, 131 and 45 bytes on switches with 52, 28
and 52 ports. None is derivable from the port count, and writing a bitmap of the
wrong width is a wire-conformance defect.
The writer preserves the width the device itself reported. The mock seeds the measured widths per model rather than computing them — because a mock that derives a value with the same formula as the code under test can only ever agree with that code. That is exactly how this defect went unnoticed.
Gotchas¶
An unauthorised request is silently dropped. No error, no refusal — the
agent does not answer at all, which is indistinguishable from an unreachable
host. If writes “time out”, check the write community before anything else. One
switch here has no private community at all; it publishes pib and
public, both read-write.
The untagged varbind in a combined write is ignored. On Smart firmware,
setting a port’s egress bit auto-untags it, and that side effect beats an
untagged varbind in the same PDU. Two PDUs, egress first, work — see
snmp_vlan_split_membership_writes.
An absent optional OID is not an error. Readers treat a missing optional
subtree honestly: power_mw is None where there is no vendor power column,
rather than 0. But a model that claims a vendor sensor subtree and walks
empty raises, rather than returning [] — that silent-empty is what hid the
GS728TPP’s vendor-OID mismatch.
API¶
netgear_switch.snmp_read—SnmpReader,AsyncSnmpReader,read_system_info.netgear_switch.protocols.snmp.oids— every OID this library uses, with the measurement notes attached.netgear_switch.protocols.snmp.parse— pure parsers over walk output.