Discussion:
[opennms-discuss] HexString encoded values with SNMP
Mark Cave-Ayland
2006-03-31 13:16:34 UTC
Permalink
Hiya folks,

I'm currently trying to read some Tx/Rx counters from a fibre switch network
consisting of a mixture of Brocade Silkworm and Qlogic SANbox switches using
SNMP and the Fibre Alliance MIBS (FA-MIBS).

The problem I am currently coming up against is that according to the FA-MIB
specification, the Tx/Rx counters are returned as a 64-bit HexString encoded
counter, similar to as shown below:


[***@th2 ~]# snmpwalk -v 2c -c public brocade1 1.3.6.1.3.94.4.5.1.4
SNMPv2-SMI::experimental.94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.1 = Hex-STRING: 00 00 00 00 09 48 6F 11
SNMPv2-SMI::experimental.94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.2 = Hex-STRING: 00 00 00 00 00 00 01 16
SNMPv2-SMI::experimental.94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.3 = Hex-STRING: 00 00 00 00 00 86 47 18
SNMPv2-SMI::experimental.94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.4 = Hex-STRING: 00 00 00 00 00 CF 8A 59
SNMPv2-SMI::experimental.94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.5 = Hex-STRING: 00 00 00 00 EF 12 77 69
SNMPv2-SMI::experimental.94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.6 = Hex-STRING: 00 00 00 00 00 48 74 5E
SNMPv2-SMI::experimental.94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.7 = Hex-STRING: 00 00 00 00 01 1D 99 52
SNMPv2-SMI::experimental.94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.8 = Hex-STRING: 00 00 00 00 00 00 00 31


My problem at the moment is trying to get this information into OpenNMS
since I can't find a type that will correctly decode the HexString into a
64-bit integer (or double) that can be stored with RRDTool. Would I be right
in thinking that I need to create a new custom type (called something like
counter_hexstring64) in order to read in these values? Or has anyone else
managed to find a workaround for this?


Many thanks,

Mark.

------------------------
WebBased Ltd
17 Research Way
Plymouth
PL6 8BT

T: +44 (0)1752 797131
F: +44 (0)1752 791023

http://www.webbased.co.uk
http://www.infomapper.com
http://www.swtc.co.uk

This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it or
use it for any purpose nor disclose or distribute its contents to any other
person.
Matt Brozowski
2006-03-31 13:28:14 UTC
Permalink
Post by Mark Cave-Ayland
Hiya folks,
I'm currently trying to read some Tx/Rx counters from a fibre
switch network
consisting of a mixture of Brocade Silkworm and Qlogic SANbox
switches using
SNMP and the Fibre Alliance MIBS (FA-MIBS).
The problem I am currently coming up against is that according to the FA-MIB
specification, the Tx/Rx counters are returned as a 64-bit
HexString encoded
SNMPv2-SMI::experimental.
94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.1 = Hex-STRING: 00 00 00 00 09 48 6F 11
SNMPv2-SMI::experimental.
94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.2 = Hex-STRING: 00 00 00 00 00 00 01 16
SNMPv2-SMI::experimental.
94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.3 = Hex-STRING: 00 00 00 00 00 86 47 18
SNMPv2-SMI::experimental.
94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.4 = Hex-STRING: 00 00 00 00 00 CF 8A 59
SNMPv2-SMI::experimental.
94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.5 = Hex-STRING: 00 00 00 00 EF 12 77 69
SNMPv2-SMI::experimental.
94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.6 = Hex-STRING: 00 00 00 00 00 48 74 5E
SNMPv2-SMI::experimental.
94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.7 = Hex-STRING: 00 00 00 00 01 1D 99 52
SNMPv2-SMI::experimental.
94.4.5.1.4.16.0.0.96.105.192.13.255.0.0.0.0.0.0.0.0
.8 = Hex-STRING: 00 00 00 00 00 00 00 31
My problem at the moment is trying to get this information into OpenNMS
since I can't find a type that will correctly decode the HexString into a
64-bit integer (or double) that can be stored with RRDTool. Would I be right
in thinking that I need to create a new custom type (called
something like
counter_hexstring64) in order to read in these values? Or has
anyone else
managed to find a workaround for this?
Man, that looks rough. Why didn't they just use 64 bit counters or
gauges? Sheesh!

I don't think OpenNMS can convert this at the moment (though we can
do many others)

Write an enhancement bug about being able to register a custom
converter for a particular mib variable
that we can use to do the conversion. I'll be working on the
collector in HEAD over the next several weeks.


Matt
________________________________________________________________________
___
Matt Brozowski, OpenNMS Maintainer Main: +1 919 812 4984
The OpenNMS Group, Inc. Fax: +1 503 961 7746
Email: ***@opennms.org URL: http://www.opennms.com
Mark Cave-Ayland
2006-03-31 13:58:10 UTC
Permalink
________________________________________
From: opennms-discuss-***@lists.sourceforge.net
[mailto:opennms-discuss-***@lists.sourceforge.net] On Behalf Of Matt
Brozowski
Sent: 31 March 2006 14:28
To: opennms-***@lists.sourceforge.net
Subject: Re: [opennms-discuss] HexString encoded values with SNMP

(cut)

Man, that looks rough. Why didn't they just use 64 bit counters or gauges?
Sheesh!

I don't think OpenNMS can convert this at the moment (though we can do many
others)

Write an enhancement bug about being able to register a custom converter for
a particular mib variable
that we can use to do the conversion. I'll be working on the collector in
HEAD over the next several weeks.


Matt



Hi Matt,

No problem - would you like it filed under cvs-stable in Bugzilla? Also can
OpenNMS correctly interpret unsigned 64 bit counters? If so, I may have a
stab at implementing a 64-bit counter by writing my own custom hex decoder
for the 1.2 series, as we're looking at network capacity issues and I need
to come up with some numbers quite quickly.


Many thanks,

Mark.

------------------------
WebBased Ltd
17 Research Way
Plymouth
PL6 8BT

T: +44 (0)1752 797131
F: +44 (0)1752 791023

http://www.webbased.co.uk
http://www.infomapper.com
http://www.swtc.co.uk

This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it or
use it for any purpose nor disclose or distribute its contents to any other
person.
Matt Brozowski
2006-04-03 16:07:37 UTC
Permalink
Post by Mark Cave-Ayland
No problem - would you like it filed under cvs-stable in Bugzilla? Also can
OpenNMS correctly interpret unsigned 64 bit counters? If so, I may have a
stab at implementing a 64-bit counter by writing my own custom hex decoder
for the 1.2 series, as we're looking at network capacity issues and I need
to come up with some numbers quite quickly.
That would be fine. Make sure you select the data-collection
component. I'm not exactly sure what you mean here but we do collect
the 64 unsigneds for the high speed network counters.

Matt


________________________________________________________________________
___
Matt Brozowski, OpenNMS Maintainer Main: +1 919 812 4984
The OpenNMS Group, Inc. Fax: +1 503 961 7746
Email: ***@opennms.org URL: http://www.opennms.com
Mark Cave-Ayland
2006-04-04 08:00:09 UTC
Permalink
[mailto:opennms-discuss-***@lists.sourceforge.net] On Behalf Of Matt
Brozowski
Sent: 03 April 2006 17:08
Subject: Re: [opennms-discuss] HexString encoded values with SNMP
Post by Mark Cave-Ayland
No problem - would you like it filed under cvs-stable in Bugzilla? Also
can
Post by Mark Cave-Ayland
OpenNMS correctly interpret unsigned 64 bit counters? If so, I may have
a
Post by Mark Cave-Ayland
stab at implementing a 64-bit counter by writing my own custom hex
decoder
Post by Mark Cave-Ayland
for the 1.2 series, as we're looking at network capacity issues and I
need
Post by Mark Cave-Ayland
to come up with some numbers quite quickly.
That would be fine. Make sure you select the data-collection component.
I'm not exactly
sure what you mean here but we do collect the 64 unsigneds for the high
speed network
counters.
Matt
Hi Matt,

I was just interested to see if OpenNMS already had code to handle 64-bit
unsigneds mainly because I know that longs in Java are 64-bit signed.
Looking at the code, I think that 64-bit values may actually be stored as
Doubles, but just wanted to check that OpenNMS would still handle the
wraparound on a 64-bit counter correctly, given that FP arithmetic can
introduce rounding errors.

If support for unsigned 64-bit counters already works, then I will probably
have a stab at coming up with some custom code for the 1.2.x series as I
need to get some performance stats to feed back to my project manager ASAP
:)


Kind regards,

Mark.

------------------------
WebBased Ltd
17 Research Way
Plymouth
PL6 8BT

T: +44 (0)1752 797131
F: +44 (0)1752 791023

http://www.webbased.co.uk
http://www.infomapper.com
http://www.swtc.co.uk

This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it or
use it for any purpose nor disclose or distribute its contents to any other
person.

Loading...