[rrd-users] Getting Total Bytes from COUNTER Data Source

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Sun Dec 11 10:10:01 CET 2011


----- Original Message ----- 
From: "Chris Mason" <chris at noodles.org.uk>
To: <rrd-users at lists.oetiker.ch>
Sent: Sunday, December 11, 2011 9:54 AM
Subject: [rrd-users] Getting Total Bytes from COUNTER Data Source


> Hi,
> 
> I am plotting interface stats (bits per second) using a COUNTER/DERIVE
> data source and I am wondering if it is possible to determine total
> bytes (e.g. for the last week I saw 3.2 GB in and 0.2 GB out). In
> theory, I am storing the total interface bytes every 300 seconds and
> to get total bytes it would be the (last entry - first entry).
> However, would I be correct in assuming that rrdtool doesn't actually
> store those values, but converts them to per-second values?
> 
> How would people go about achieving this - is it possible?


One week is 7 days of 24 hours of 60 minutes of 60 seconds => 604800 seconds.

If you see 3.2GB in a week, then it will be 3,200,000,000 / 604800 bits per second, roughly 5291 bits per second.

If you know the average of 5291, and you know the time range, then just reverse the computation to get 3.2GB:  {$average} * 604800 = 3.2GB

You cannot do computations with the computed average, but you can multiply the input by 604800 and get the same result:

CDEF:total=ds0,604800,*
PRINT:total:AVERAGE:%6.2lf


Or just use TOTAL. See the manual page.



More information about the rrd-users mailing list