Enumerated Values in Custom Probes

An enumeration in a MIB allows a designer to represent text strings as numeric values. This numeric representation is more compact, and therefore efficient, but makes it hard for humans to read. InterMapper has several techniques for displaying the enumerated values for easier interpretation.

There are several ways to do this:

  1. InterMapper can automatically display these "enumerations" if the MIB has been imported. To do this, simply declare the variables to be of type "STRING" instead of "DEFAULT". This is described in the Probe Variables page of the Developer Guide.
  2. If no MIB file is available, you can create a calculation variable to select a string based on the numeric value returned. If you have two choices, you should use the "xxxx ? yyyy : zzzz" expression that can be read as:

    
        if xxxx is true then return yyyy
        otherwise return zzzz
    

    The calculation variable will look like this:

    
        xxxxStr, ($xxxx == 0 ? "yyyy" : "zzzz"), CALCULATION, "replacement string for xxxx"
    
  3. If there are three or more possibilities, you can chain the expression in this format: "aaaa ? bbbb : cccc ? dddd : eeee ? ffff : gggg" which can be read as:

    
    if aaaa is true then return bbbb
    else if cccc is true return dddd
    else if eeee is true return ffff
    else return gggg
    

    Generally, the aaaa, cccc, and eeee test to see if a single variable is equal to 1, 2, 3, etc. The calculation variable will then look like this:

    aaaaStr, ($aaaa==0 ? "bbbb" : $aaaa==1 ? "dddd" : $aaaa==2 ? "ffff" : "gggg"), CALCULATION, "replacement string for aaaa"