[rrd-users] RPN Problem with GAUGE & TOTAL

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Tue Mar 8 09:13:49 CET 2011

----- Original Message ----- 
From: <tank001 at gmx.de>
To: <rrd-users at lists.oetiker.ch>
Sent: Monday, February 28, 2011 5:48 PM
Subject: [rrd-users] RPN Problem with GAUGE & TOTAL

> Hi,
> I tried today to sum up all of the values at my rrd-Database using the 
> Command.
> My data is organized as GAUGE Type.
> I tried the following:
>  rrdtool graph dummy.png DEF:var=file.rrd:DATA:MAX VDEF:tot=var,TOTAL
> PRINT:tot:%.0lf
> Unfortunately the value I got was not correct at all. I expected that the
> Value would be STEP-SIZE (given at rrdtool create) times the SUM.
> Afterwards I changed my Database to ABSOLUTE Type. Then I got the correct
> SUM.
> Is there something special on the GAUGE type?

GAUGE and ABSOLUTE (and the others) define how incoming numbers are 
transformed to a rate.
After that, RRDtool doesn't know nor care how it got its data.  So, check 
your input side and resulting rates. The problem you have/think you have is 
already present in the rates you have.

TOTAL should give you the sum of { each rate multiplied with stepsize }. Or, 
another way to do the math, the total amount of time times the average rate 
in each bucket.

If during 5 minutes the router transmitted 10 bytes per second, then the 
total amount of bytes in that particular 5 minutes will have been 10 
(bytes/second) times 300 (seconds) = 3000 bytes.  The next bucket has a rate 
of 15, then the total for that bucket is 15*300=4500. The next bucket has 
rate 5, so 5*300=1500. And so on. Now add all those results, and you reach a 
grand total of (for instance) 400 buckets (graph width) times 3000 bytes 
(average amount per bucket)  = 1,200,000 bytes.
Or, in the other way of computing this: An average rate of 10 bytes per 
second on the entire graph of 400 buckets means 400 times 300 seconds = 
120000 seconds, multiplied with 10 bytes per second, ends up as 1200000 
seconds * (bytes/second) = 1,200,000 bytes.

also see my site http://www.vandenbogaerdt.nl/rrdtool/

More information about the rrd-users mailing list