What is SNMP?
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 database column addresses. You ask for 1.3.6.1.2.1.1.5.0 and get back "SWITCH-01" (the hostname).
OIDs โ Object Identifiers
Every piece of data has a dotted-number address. Here are the ones you'll use most:
| OID | Name | Returns | Type |
|---|---|---|---|
1.3.6.1.2.1.1.5.0 | sysName | Hostname | Scalar |
1.3.6.1.2.1.1.3.0 | sysUpTime | Uptime in ticks | Scalar |
1.3.6.1.2.1.1.1.0 | sysDescr | Device description | Scalar |
1.3.6.1.2.1.2.2.1.2 | ifDescr | Interface names | Table |
1.3.6.1.2.1.31.1.1.1.6 | ifHCInOctets | Bytes in (64-bit) | Table |
1.3.6.1.2.1.31.1.1.1.15 | ifHighSpeed | Speed in Mbps | Table |
OIDs under 1.3.6.1.2.1 are standard (work on any device). OIDs under 1.3.6.1.4.1.{vendor} are vendor-specific (need MIB files).
Scalar vs Table โ The #1 Rule
This is the most important concept in SNMP extensions. Get it wrong and your extension breaks silently.
Scalar = one value per device. OID ends in .0:
1.3.6.1.2.1.1.5.0 โ sysName = "SWITCH-01" (one value)
Table = multiple rows (one per interface, CPU, sensor). OID does NOT end in .0:
1.3.6.1.2.1.2.2.1.2 โ ifDescr
.1 = "GigabitEthernet0/1"
.2 = "GigabitEthernet0/2"
.3 = "Vlan100"
This extension has 1 bug. The sysUpTime OID is scalar (one value per device) but it's missing .0 at the end. Fix it.
MIB Files
A MIB maps OID numbers to human-readable names. Standard MIBs ship with ActiveGate. Vendor MIBs go in your extension's snmp/ folder:
extension.zip/
โโโ extension.yaml
โโโ snmp/
โโโ CISCO-PROCESS-MIB.my โ vendor MIB
Standard vs Vendor MIBs
| MIB | OID Prefix | What It Covers | Bundled? |
|---|---|---|---|
| IF-MIB | 1.3.6.1.2.1.2 | Interfaces (traffic, status) | โ Yes |
| SNMPv2-MIB | 1.3.6.1.2.1.1 | System info (name, uptime) | โ Yes |
| ENTITY-MIB | 1.3.6.1.2.1.47 | Physical components | โ Yes |
| CISCO-PROCESS-MIB | 1.3.6.1.4.1.9.9.109 | Cisco CPU/Memory | โ Bundle it |
| CISCO-ENVMON-MIB | 1.3.6.1.4.1.9.9.13 | Cisco temp/fans/PSU | โ Bundle it |
This interface metric has .0 at the end but it's in a table: true subgroup. Table OIDs should NOT end in .0. Remove it.
What's Next
In Module 2, you'll turn these OIDs into real metrics with types and metadata.