[rrd-users] rpn equation

Simon Hobson linux at thehobsons.co.uk
Sun Nov 2 08:40:31 CET 2008

R Dicaire wrote:

>  > If that is the case, tehn you can use an "if" expression to set it to
>>  zero instead.
>Indeed that is the case, and now I recall a discussion on that very
>subject...could you give an example of an if statement please?

See http://oss.oetiker.ch/rrdtool/doc/rrdgraph_rpn.en.html

I think what you need is :


Which you read as :
   a,UN = check if a is known or not - returns true if a is unknown

   a,0,(a is unknown),IF = if a is unknown then leave 0 on the stack, 
else leave a on the stack.

Just substitute your real data source for a, and use this expression 
where you would otherwise have used the real data source.

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

More information about the rrd-users mailing list