SNMP Tutorial: OIDs and Symbolic Names

Object Identifiers - OIDs

In SNMP terminology, the value ".1.3.6.1.2.1.1.3.0" is an Object Identifier that is usually shortened to just "OID". Each OID refers to a very specific and well-defined value on a system that supports SNMP. The periods in the OID act as separators and the string of values forms a sort of path to the end value. Similar values are typically grouped together in the path. Look at the following three examples:

System Description: .1.3.6.1.2.1.1.1.0
System Uptime: .1.3.6.1.2.1.1.3.0
System Name: .1.3.6.1.2.1.1.5.0

Notice that they all start with ".1.3.6.1.2.1.1" and vary only by the endings which are ".1.0", ".3.0", and ".5.0". That's because a standard has been defined that groups these values under the ".1.3.6.1.2.1.1" section. As you've probably already remarked, dealing with all of these numbers is awkward, to say the least. In the next section, we discuss symbolic names which will make things somewhat easier.

Symbolic Names

Instead of dealing with long strings of numbers, it would be much easier to use meaningful words and SNMP allows for that by using symbolic names. So instead of ".1.3.6.1.2.1.1.3.0" you can use "system.sysUpTime.0" to retrieve the uptime as in the following example:
localhost$ snmpget -M MIBs -v1 -c public myrouter system.sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (37676001) 4 days, 8:38:30.00
Everything is exactly the same as in the previous example except we used a symbolic name instead of the numeric OID. The symbolic name is much easier to remember than the numerical OID and generally, people will prefer to use it over the OID whenever possible.

Symbolic Names and the SNMP Protocol

It's important to note that symbolic names are not part of the SNMP protocol itself. They are supported by most tools that perform SNMP queries. The tools work by taking the symbolic name and translating it into the corresponding OID before making the SNMP query or other SNMP operation. The obvious question is "how does that translation happen?" and the answer involves Management Information Blocks otherwise known as MIBs.