[rrd-users] Traffic accounting - daily/weekly/monthly
Chris Roberts
croberts at bongle.co.uk
Tue Jan 3 13:28:19 MET 2006
Hello,
I'm collecting data into around 30,000 .rrd files for a large number of
users. These RRD files are created as follows:
/usr/local/rrdtool-1.2.11/bin/rrdtool create /rrd/file.rrd -b $starttime -s
300 DS:BytesIn:DERIVE:600:0:4294967295 DS:BytesOut:DERIVE:600:0:4294967295
DS:PacketsIn:DERIVE:600:0:4294967295 DS:PacketsOut:DERIVE:600:0:4294967295
RRA:AVERAGE:0.5:1:8064
And updated as such:
/usr/local/rrdtool-1.2.11/bin/rrdtool update /rrd/file.rrd
$timestamp:$bytesin:$bytesout:0:0
I didn't write these bits of code, so I'm not entirely sure if they're
storing the correct data for what I need - they currently create graphs okay
with no problems.
Now I need to extract from this data some traffic accounting information - I
need, for each RRD to extract a monthly total bytes transferred for each DS
(BytesIn/BytesOut) primarily and a daily total for each DS, for accounting
purposes (therefore these need to be actual data and not
averages/interpolations).
Currently I use a perl script that I found on the list to produce daily
totals for each RRD file which use:
/usr/local/rrdtool-1.2.11/bin/rrdtool fetch /rrd/file.rrd AVERAGE -s $start
-e $end
And then sum the output values. I have a concern with this regarding the use
of the AVERAGE statement. Also this only works for daily stats - I now need
a way to extract monthly stats and I'm concerned about the interpolated
data?
Is there an easy way to do what I need? With rrdtool graph I believe I can
create a total using a CDEF (although I don't know how to do it :)), is
there any way to do this from the command line? Is the data in the .rrd
accurate enough to do what I need to (which is simply produce a total number
of transferred BytesIn/BytesOut per month).
Any help greatly appreciated.
Cheers,
Chris.
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.11/219 - Release Date: 02/01/2006
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-users
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the rrd-users
mailing list