[rrd-users] Re: Unexpected NaN values

Alex van den Bogaerdt alex at ergens.op.het.net
Sat Nov 4 02:31:19 MET 2006


On Fri, Nov 03, 2006 at 07:05:04PM -0500, jeffrey.j.petter at verizon.com wrote:


[snip story about negative numbers]

(could you please quote in a proper way, so I can do too? Thanks)

The problem seems to be that a number that should be treated as an
unsigned integer, is treated as a signed integer somewhere in the
chain.

This could be your device, or it could be your monitoring program.

It's like a mileage counter rolling over from 499,999 to -500,000.

For a one-byte counter, the numbers would look like:

... 125, 126, 127, -128, -127, -126 ...
To solve, 256 - (negative number multiplied by -1)
which is: 2^8 - (negative number multiplied by -1)

A two byte counter:

... 32764, 32765, 32766, 32767, -32768, -32767, -32766 ...
To solve, 65536 - (negative number multiplied by -1)
which is: 2^16 - (negative number multiplied by -1)

One byte counters: 2^8 - (negative number multiplied by -1)
Two byte counters: 2^16 - (negative number multiplied by -1)
Four byte counters: 2^32 - (negative number multiplied by -1)
Eight byte counters: 2^64 - (negative number multiplied by -1)

Find out which one it is (it won't be one or two) and work
around it in your script.

Alternatively, reset the counters as soon as they are going
into the danger zone.  This may mean rebooting your device.

I don't think rrdtool should cope with this.  Would it need
to assume the counter to be 1, 2, 4 or another amount of bytes?

Of course, hunting down the bug and fixing it at the proper
place in stead of working around it would be nice.  Try fetching
values from your device manually if you can.  Don't use the same
software your monitoring program uses right now.  Still getting
negative numbers? Then the device is suspect.  Getting positive
numbers? Then the snmp query program is suspect.

HTH
-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list