Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Hex to decimal conversion

 
Post new topic   Reply to topic    Cacti Forum Index -> Feature Requests
Author Message
dalaro



Joined: 18 Jun 2008
Posts: 3

PostPosted: Fri Jun 20, 2008 5:48 pm    Post subject: Hex to decimal conversion Reply with quote

Hi,

I've got some devices that use the Fibre Alliance MIB. This MIB encodes 64-bit interface counters as hex strings. Cacti considers these hex-strings non-numeric and sends unknown values to the associated RRDs. There a quite a few devices that use this MIB; for example, QLogic SANBoxes and Cisco MDS devices.

People have worked around this problem by creating a separate script query for the device (e.g. this bit of advice or this cisco mds template). The query is essentially identical to normal cacti SNMP functionality, except it does hex to decimal conversion on the returned value. This is a valid approach, but it duplicates code and increases the administration overhead on those devices. It's not as tightly-integrated and easy to use, imho, as an SNMP query.

I modified Cacti to convert pure hex output values into decimal, treating them as numbers. Informational or "input" data (in the SNMP query XML sense) are not modified. Only data bound for RRDs get the conversion. I think this isreasonable because RRDs store numbers. If the user configures Cacti to send hex values into RRDs, it seems sensible to treat them as such (instead of unknown).

Now I'm using plain SNMP queries to read my hex-string counters, and things are comparatively tidier in my configuration.

I'd appreciate your thoughts on this. If it sounds like a good idea, I've got diffs.

Thanks
Dan
Back to top
dalaro



Joined: 18 Jun 2008
Posts: 3

PostPosted: Tue Jun 24, 2008 12:17 pm    Post subject: Reply with quote

Here are patches with the functionality I want. I'm running these on my install and polling some QLogic SANBoxes with it.

One patch is for cacti proper, the other is for spine. So far, I've only added hex-to-dec conversion under spine; haven't changed cmd.php because there hasn't been a need. If this gets integrated, though, I can supply a tested patch for cmd.php too.

Any feedback is appreciated



hexdec_conv_spine.patch.gz
 Description:

Download
 Filename:  hexdec_conv_spine.patch.gz
 Filesize:  1.26 KB
 Downloaded:  113 Time(s)


hexdec_conv_cacti.patch.gz
 Description:

Download
 Filename:  hexdec_conv_cacti.patch.gz
 Filesize:  645 Bytes
 Downloaded:  93 Time(s)

Back to top
BSOD2600
Cacti Moderator


Joined: 08 May 2004
Posts: 6876
Location: WA, USA

PostPosted: Tue Jun 24, 2008 1:28 pm    Post subject: Reply with quote

Please create a feature bug, with the details/attachment of these posts. also post a link to this post in the bug. http://www.cacti.net/bugs.php
Back to top
dalaro



Joined: 18 Jun 2008
Posts: 3

PostPosted: Tue Jun 24, 2008 5:38 pm    Post subject: Reply with quote

Thank you. Created issue #0001271.

http://bugs.cacti.net/view.php?id=1271
Back to top
zivley



Joined: 13 Nov 2007
Posts: 47

PostPosted: Thu Jul 31, 2008 7:01 am    Post subject: Reply with quote

Great to see someone has the same problem than me and have already found the workaround!
Will someone be kind and tell me how to apply those patches??
Thanks in advance
Ziv
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Feature Requests All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group