Tony,

We have a similar situation.Perhaps our solution could be modified for 
your situation.

The Cisco mib for the number of modules in a chassis or switches in a 
stack is this:

chassisSlotConfig OBJECT-TYPE
        SYNTAX        INTEGER (0..65535)
        MAX-ACCESS    read-only
        STATUS        current
        DESCRIPTION   "An indication of which slots in the chassis have
                      modules inserted. This is an integer value with
                      bits set to indicate configured modules. It can be
                      interpreted as a sum of f(x) as x goes from 1 to
                      the number of slots, where f(x) = 0 for no module
                      inserted and f(x) = exp(2, x-1) for a module
                      inserted."
        ::= { chassisGrp 15 }

Essentially breaks down to:
Slot    1       2       3       4       5       6       7       8       9
Switch

Result  1       3       7       15      31      63      127     255 511

So knowing the possible results, we created a calculation to translate the 
reply into the actual number.

<snmp-device-variables>
   (Polled OID)
switchCount, 1.3.6.1.4.1.9.5.1.2.15.0, DEFAULT, "Number of Switches in 
Stack"

  (Translations)
Count1, $switchCount == 3 ? "2" : $switchCount == 7 ? "3" : $switchCount 
== 15 ? "4" : $switchCount == 31 ? "5" : $switchCount == 63 ? "6" : "999", 
CALCULATION, "Switch Count"
Count2, $switchCount == 127 ? "7" : $switchCount == 255 ? "8" : 
$switchCount == 511 ? "9" : "999", CALCULATION, "Switch Count"

Count, $Count1 != 999 ? "$Count1" : $Count2 != 999 ? "$Count2" : "Not a 
stack", CALCULATION, "Switch Count"
RealCount, $Count1 != 999 ? "$Count1" : $Count2 != 999 ? "$Count2" : 1 , 
CALCULATION, "Switch Count"
</snmp-device-variables>

<snmp-device-thresholds>
 (a couple of the reporting thresholds used in the probe)

critical:       ${switch1} != 2 "Problem with Stack Switch 1"
Alarm   : ${RealCount} != 1 && ${stack1a} != 1 && ${stack1a} != "" && 
"${switch1}" != "" "Problem with Stack Switch 1 stackport 1"
</snmp-device-thresholds>

<snmp-device-display>
 \4\Number of Switches in Stack:\0\ ${Count} \P0M\
</snmp-device-display>

Count1 and Count2 could have been combined, the probe just kind of grew 
this way. Count and RealCount are used in two different places and 
required different results. 

Hope this helps.

Chris




"Tony Mumm" <[EMAIL PROTECTED]> 
Sent by: <[email protected]>
02/12/2008 11:16 AM
Please respond to
"InterMapper Discussion" <[email protected]>


To
"'InterMapper Discussion'" <[email protected]>
cc

Subject
[IM-Talk] BITS MIBs






Question for Dartware or others that have crossed this bridge?  Has anyone 
had
any experience using IM to decode BITS syntax MIB entries? 

This is a SNMP variable that has a series of bits that relates to a 
condition of
the device.  Those bits are lined up and returned to the SNMP client in 
the form
of hex.  We need to parse it down and alarm on each bit. 

Here is an example:

CardAlarmStatus OBJECT-TYPE
   SYNTAX     BITS  {
                 underRepair(0),
                 critical(1),
                 major(2),
                 minor(3),
                 alarmOutstanding(4) }

The SNMP agent maps these 5 conditions into the first 5 bits of a 8 bit
response.  So under normal conditions its:

0000 0000, or the response is 0x00

If underRepair is true, the first bit is set to 1:

1000 0000, or the hex response is 0x80.  (The left most is most 
significant).

If underRepair and Critical are true:

1100 0000, or the hex response is 0xC0.

Anyone crossed the bridge of parsing this stuff?

Thanks,

Tony

____________________________________________________________________
List archives: 
http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [EMAIL PROTECTED]


____________________________________________________________________
List archives: 
http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [EMAIL PROTECTED]

Reply via email to