InterMapper.comiMapper Community 
 
SNMP OIDs in Custom Probes

Introduction

InterMapper supports two kinds of OID's: Numeric and Symbolic. The Symbolic OIDs become available when a MIB has been imported into InterMapper.

In addition, InterMapper supports three kinds of OID expressions: Get-Next, Trap-Conditional, and Index-Derived.

Numeric OID's

Numeric OID's contain only numbers separated by periods. Preceding periods are ignored. A trailing period is allowed if there is only one subid.

Examples:

  .1
  1.
  1.3.6

Invalid examples:

   1 (no period)
   1.3.6. (trailing period but with multiple subids)
   1.3.6.blah  (not numeric)
   1.3.6.1.2.1.system.sysUpTime.0  (not numeric)

Unlike Net-SNMP, InterMapper ascribes no special meaning to OID's that begin with a period; all numeric OID's are considered absolute.

Errors in numeric OID's are reported by the system to the Event Log when the error is in a custom probe. The error message will have the form:

   Syntax error in OID "1.3.6.1..1.2"

Symbolic OID's

A symbolic OID begins with a letter, after ignoring any preceding periods. InterMapper must be able to locate a MIB file that defines the symbols used.

There are three types of symbolic OID's:

  1. Simple symbols specify a starting symbol and zero or more trailing subid's.
  2. Relative symbols specify a starting symbol and one of more subid symbols.
  3. Scoped symbols specify the name of the MIB, the scope operator ::, followed by a simple or relative symbol.

Relative and scoped symbols are handy when a symbol is ambiguous, i.e. the same symbol name is defined differently in two separate MIB files. You should prefer the scoped OID form, when possible.

Symbolic names are case-sensitive.

Examples:

   Simple: sysUpTime
           sysUpTime.0
           enterprises.9.2.3.4.5

   Relative: system.sysUpTime
             system.sysUpTime.0

   Scoped: SNMPv2-MIB::sysUpTime
           SNMPv2-MIB::system.sysUpTime.0

Invalid Examples:

   Simple:  sysUpTiime  (misspelled; not found)
            sysupTime   (wrong case)
            sys%pTime   (disallowed character %)
            sysUpTime.0.  (bad; trailing period)

   Relative: system.ifIndex  (bad; ifIndex isn't under system)

   Scoped: SNMPv2-MIB.sysUpTime  (bad; must use :: for scoped OID)
           IF-MIB::sysUpTime    (bad; wrong MIB module for sysUpTime)

Errors in symbolic OID's are reported by the system to the Event Log when the error is in a custom probe. The error message will have the form:

   Syntax error in OID "sys%pTime" 

Limitations of Symbolic OID's

  1. Symbolic OID's will only work if the necessary MIB file is loaded into InterMapper. If InterMapper cannot resolve the symbolic OID using a MIB file, this is considered a syntax error in the symbolic OID. At this time, there is no way to bundle a MIB file with a probe as one file; this is a future direction.
  2. It may happen that two or more MIB files define the same symbol. When this happens, InterMapper may pick the wrong definition. You can avoid this by using the scoped OID form.

Get-Next OID Expressions

InterMapper has a special syntax for "get-next" style OID's - attach a + to the end of the OID.

Normally, when you specify a variable to query in a custom SNMP probe, you specify the complete OID, including the instance. For example, you might specify "sysUpTime.0" or "ifInOctets.13". For sysUpTime, the .0 specifies the (only) instance. For ifInOctets, the .13 specifies the value for ifIndex 13.

There are occasions when you want to query a variable using a preceding OID. For example, you might want to query the value of ifInOctets for the first interface, but you can't assume the ifIndex of the first interface is 1. Here's how you would specify the OID:

    ifInOctets+

To retrieve the value of ifInOctets for the interface whose ifIndex follows 13, specify the OID with a plus:

    ifInOctets.13+

The plus sign must immediately follow the OID. Technically, it's not part of the OID, but considered an operator in InterMapper's OID expression language.

Note: Get-Next OID expressions will not work for custom SNMP probes that specify get-request queries.

Trap-Conditional OID Expressions

Trap-conditional OID expressions allow you to assign a variable only when it occurs in the varbind list of a certain trap. For example, you might want to set the value of your probe's "sysUpTimeCrashed" variable to value of the "sysUpTime.0" variable included in the varbind list of a "systemCrashed" trap. However, you don't want to set "sysUpTimeCrashed" when you see the sysUpTime.0 value in any other received trap. To restrict the assignment of sysUpTime.0 to only the systemCrashed trap, you need to specify both the systemCrashed trap OID and the sysUpTime.0 OID using the ?: operator. This combination is called a "Trap-Conditional" OID, or "Trap OID" for short.

Examples:

     systemCrashed?:sysUpTime.0
     sysTrapOID?:sysContact
     SOMEMIB::sysTrapOID.1?:SMIv2-MIB::sysContact

Supported in 4.4, the legacy format for trap OID's is a numeric OID followed by an OID:

     1.3.6.1.2.1::sysUpTime.0

The legacy format does not allow use of a symbolic name for a trap OID; this conflicts with the scoped format above. The use of :: for Trap-conditional OID expressions is deprecated. Please use ?: in the future.

Index-Derived OID Expressions

When querying tables from SNMP devices, it is often useful to assign the value of a variable from a row's OID index. This technique will work even if the values used to index the row have an access of "not-accessible".

Take ipNetToMediaTable as an example. This table is indexed by two variables: ipNetToMediaIfIndex and ipNetToMediaNetAddress. The other two variables in this table are ipNetToMediaPhysAddress and ipNetToMediaType. Since the format of the table's row index is known, you only need to query ipNetToMediaPhysAddress and ipNetToMediaType; you can derive ipNetToMediaIfIndex and ipNetToMediaNetAddress from the index value.

To specify the value of an OID, derived from another OID, you can use the Index-Derived OID Expression.

Examples:

   ipNetToMediaType[0:1]
   ipNetToMediaType[1:4]
   ipNetToMediaType[1:]

In this example, the notation <oid>[a:b] means to fetch the OID <oid> and retrieve the value from the subid's of the index as follows:

   [a:b] means to start with the a'th subid and collect b subid's.
   [a:] means to start with the a'th subid and collect the rest.

   subid's use zero-based indexes.