(1) In what format does the Perl module return a BITS flavor of OID?
- It sort of looks like a hex string ... but not quite.
- I'm using net-snmp-5.7.3
(2) Seems to me that SNMP.pm does not translate a string of bits into
English. Am I correct?
(3) So I figured I'd do it myself. But I'm struggling to see how. How might
I translate the hex string which SNMP.pm gives me into English, given that I'm
willing to build a one-off translator for each object?
Here is an example:
host$ snmpget -c public test-esx
IEEE8023-LAG-MIB::dot3adAggPortActorOperState.10701
IEEE8023-LAG-MIB::dot3adAggPortActorOperState.10701 = BITS: BC lacpActivity(0)
aggregation(2) synchronization(3) collecting(4) distributing(5)
host% cat test-script
[....]
say "dot3adAggPortActorOperState_before =
'$dot3adAggPortActorOperState_before'";
[...]
host% ./test-script
[...]
dot3adAggPortActorOperState_before = 'BC '
[...]
host% cat IEEE8023-LAG-MIB
[...]
dot3adAggPortActorOperState OBJECT-TYPE
SYNTAX LacpState
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"A string of 8 bits, corresponding to the current
operational values of Actor_State as transmitted by the
Actor in LACPDUs. The bit allocations are as defined in
6.3.2.1.20. This attribute value is read-only."
REFERENCE
"6.3.2.1.21"
::= { dot3adAggPortEntry 21 }
[...]
LacpState ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"The Actor and Partner State values from the LACPDU."
SYNTAX BITS {
lacpActivity(0),
lacpTimeout(1),
aggregation(2),
synchronization(3),
collecting(4),
distributing(5),
defaulted(6),
expired(7)
}
In the example above, I would have predicted the following
lacpActivity = 1
lacpTimeout = 0
aggregration = 1
synchronization = 1
collecting = 1
distributing = 1
defaulted = 0
expired = 0
[In other words, five of the eight bits are set to 1, while the remaining three
are set to zero.]
To my way of thinking this would produce something like the following:
10 11 11 00 = A B B 0 = ABB0
Or, perhaps the other way around, if the bits appear in the opposite order:
00 11 11 01 = 0 BB 1 = 0BB1
But instead, SNMP.pm spits out 'BC ', i.e. B followed by C followed by a pair
of spaces. I don't see how to translate 'BC ' back into a string of bits,
which I could then parse to produce English text.
(4) Am I headed off into the weeds? Or might there cheese at the end of this
tunnel?
--sk
Stuart Kendrick
Seattle, WA USA
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users