[rrd-users] rpn to convert NaN to 0

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Sat Mar 14 19:47:19 CET 2009


----- Original Message ----- 
From: "R Dicaire" <kritek at gmail.com>
To: <rrd-users at lists.oetiker.ch>
Sent: Saturday, March 14, 2009 6:49 PM
Subject: [rrd-users] rpn to convert NaN to 0


> Hi folks, I have a CDEF that derives its value from two different
> rrds, adds them, then displays the result. Sometimes one of the
> sources doesn't update one of the rrds (on purpose, as this particular
> thing being monitored isn't always running) so that rrd stores NaN.
> However since num+NaN doesn't return num, the graph wont display CDEF
> contents.
>
> CDEF:ices=icecast,vicecast,+
>
> Sometimes the vicecast rrd is NaN, so I'd like to 'if vicecast=NaN
> then set vicecast=0'.
> Would I need two CDEFs, one to convert NaN to 0, then another to add them?
> What rpn statement would I need to convert NaN to 0?


Please see the tutorial; it contains exactly this example. 



More information about the rrd-users mailing list