What is SNMP?
SNMP extension YAML reference
SNMP (Simple Network Management Protocol) is how you read data from network devices. Your extension asks a device for a value at a specific address โ called an OID โ and the device responds.
๐ก Think of OIDs like file paths: 1.3.6.1.2.1.1.5.0 = the device's hostname. Each number navigates deeper into the device's data tree.
The OID Tree
Scalar vs Table OIDs
Type OID Example What It Returns .0 suffix?
โโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโ
Scalar 1.3.6.1.2.1.1.5.0 One value (hostname) YES, required
Table 1.3.6.1.2.1.2.2.1.10 One row per interface NO, never
โ ๏ธ #1 SNMP bug: Scalar OIDs MUST end in .0. Table OIDs must NOT end in .0. Getting this wrong = no data, no error message.
SNMP Versions
Version Auth When to Use
โโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโ
SNMPv2c Community string (password) Simple, most common
SNMPv3 Username + auth + encryption Secure environments
Finding OIDs
Three ways to find the OIDs you need:
- Vendor MIB files โ download from vendor website, open in MIB browser
- snmpwalk โ
snmpwalk -v2c -c public 192.168.1.1dumps all OIDs - Online MIB databases โ oid-info.com, circitor.fr/Mibs
๐ Try it: Run snmpwalk -v2c -c public <device-ip> 1.3.6.1.2.1.1 to see the system branch of any SNMP device.