Homeโ€บ๐Ÿ“ก SNMP Extensionsโ€บModule 11 min read ยท 2/16

SNMP Fundamentals

Tutorial

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

OID Tree: 1.3.6.1.2.1 (MIB-2) iso.org.dod .1 system .2 interfaces .1.5.0 sysName .1.3.0 sysUpTime .2.2.1.10 ifInOctets Scalar (single value, ends in .0) Table (one row per interface)

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:

  1. Vendor MIB files โ€” download from vendor website, open in MIB browser
  2. snmpwalk โ€” snmpwalk -v2c -c public 192.168.1.1 dumps all OIDs
  3. 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.