[rrd-users] RPN Question

Simon Hobson linux at thehobsons.co.uk
Tue Apr 17 15:17:22 CEST 2007

Wesley PA4WDH wrote:

>I have a lot of rrd's with the same DS in it. What i
>want to do is to calculate the sum of all the DS's and
>display that in a "total" graph.
>The problem is that those DS's have a lot of unknown
>values in it. What i need is a RPN that does:
>if (value_of_ds != unknown)
>return new_value+total_caluclated_so_far
>else return total_calculated_so_far
>I have tried this:

I would suggest keeping it simple to start with - it's tempting to go 
for a long formula that spans 10 lines of code, but it's a nightmare 
to debug !

So I would suggest something like (please check the syntax, I might 
have got the IF statement wrong) :

total=i1,i2,+,i3,+, .... in,+

Of course you could start combining stuff, one way being by simple 
substitution :

total=v1,UN,0,v1,IF,v2,UN,0,v2,IF,+,v3,UN,0,v3,IF,+  ... in=vn,UN,0,vn,IF,+

Or you could break down your running total as :


Where v1 .. vn are your data values.

More information about the rrd-users mailing list