^Newbie: Calculation of indexed SNMP-Values before graphing

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Enrie
Posts: 3
Joined: Mon Feb 06, 2006 10:54 am
Location: Germany

^Newbie: Calculation of indexed SNMP-Values before graphing

Post by Enrie »

In cacti (and also in a MIB-Browser) some SNMP-values of “KBytesTotal” will be negative. This is because the most significant Bit (“high Bit”) will be interpreted as the sign, but this is not true.
e.g.
Hex: BE200000 = Dec: - 1105199104; but it should be Dec: 3189768192.

How can we convert this negative value before it will “send” to the rrd-file to graph it?

Another Question:
In the NetApp-MIB some values (e. g. total capacity in KBytes) will be divided in least and most significant 32 Bits of a 64 Bit unsigned integer Value.
So we must put these values together to graph them

e. g.
OID1.1 = most significant Bits = Dec: 2
OID1.2 = least significant Bits = Dec: 368345420
64 Bit unsigned Integer = Dec: 2 x 4294967296 + 368345420 = 8958280012

How can we do this?
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

Anytime you need massage the data that goes into the RRD file, you have to use a script. Script queries can be made to work as front-ends to SNMP indexes pretty easily, just manipulate the array values you get and pipe them back through.

If you are willing to massage data after the fact (and are able to do so), use CDEFs in the graph template. You can do a fair amount of calculations in the CDEF formulas.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest