Previous Article: On-Box Storage: Option 2 - JUNOS Device Configuration as a Data Store
Next Article: On-Box Storage: Option 4 - JUNOS Accounting Files as a Data Store
For SLAX version 1.0 and higher, Junos OS provides the capability to store number and string data in a database and expose it as SNMP data using the Junos OS Utility MIB. This data is available from Junos OS to any authorized IP device as SNMP object Identifiers (OIDs). A common use of the Utility MIB is to provide SNMP instrumentation for system characteristics, counters, or gauges that are NOT otherwise exposed via SNMP. For example, you can write a script to collect or derive a non-SNMP value and then write it to the Utility MIB, where it then becomes readable to authorized SNMP-capable applications.
The Utility MIB can also be used as a “scratch pad” area where scripts can store data (such as, counter values), that can be referenced at a later time -- even after the script has exited.
The Utility MIB is just a set of tables – one for each basic data type: Counter32, Counter64, Integer, Unit, and String. Your application just adds or removes rows to these tables. It does NOT enable you to create “real” OID hierarchies.
(If the terminology in the previous 2 sentences is a little confusing, then you probably don’t need to care about this; it’s an SNMP thing.)
The names that the Utility MIB creates for the values you add are not necessarily “human-friendly”. The resulting OID names are derived by taking a string value for the name you choose (such as, “foo”), then converting it into a dotted decimal sequence of each of the characters in the name. So OID name for the 64-bit counter jnxUtilCounter64Value.”foo” would really be specified externally as this OID:jnxUtilCounter64Value.102.111.111 -- where the trailing 3 values (102.111.111) represent the decimal ASCII code values for the characters “f”, ”o”, “o”.
And actually, it’s a little more complicated. Any external SNMP applications that wish to collect SNMP data from your Utility MIB-based data store must use that ASCII decimal code translation to reference “jnxUtilCounter64Value.”foo” as a fully qualified OID in their SNMP PDU to JUNOS.
In other words, the full-qualified OID for JUNIPER-UTIL-MIB::jnxUtilCounter64Value.”foo” will have to be rendered as .220.127.116.11.4.1.2618.104.22.168.22.214.171.124.102.111.111 by the SNMP manager.
However, if you never need to expose your Utility MIB data to an off-box SNMP manager, then the “ugly OID syndrome” becomes a non-issue.
Written by Douglas McPherson
Solutions Consultant at Juniper