[rrd-users] Subtraction and NaN values

Eduardo Bragatto eduardo at bragatto.com
Tue Feb 19 17:35:37 CET 2008


Hi there --

I'm using net-snmp to gather some information from a few hundred  
servers and I noticed the memBuffer doesn't exist on a few FreeBSD  
servers, causing the DS to be filled with NaN values.

The problem occurs when I use memBuffer on a RPN subtraction like this:

CDEF:memUsedReal 
=memTotalReal,memAvailReal,-,memShared,-,memBuffer,-,memCached,-

Since memBuffer is NaN, memUsedReal is always also NaN for the FreeBSD  
servers. If I take "memBuffer,-" out the CDEF line above works flawless.

I've tried to fix it by using IF to change NaN to 0 before the above  
CDEF line, thus not causing a problem at the subtraction:

CDEF:memBuffer=UNKN,DSmemBuffer,EQ,DSmemBuffer,0,IF

I was expecting memBuffer to have 0 or the value from DSmemBuffer if  
it's not NaN.

Does anybody knows what I'm doing wrong?

[]s
Eduardo.



More information about the rrd-users mailing list