[mrtg] Determine daily traffic

Steve Shipway s.shipway at auckland.ac.nz
Sun Sep 2 22:12:45 CEST 2012

The rrdfetch will give you the average rate for that interval, in bits/sec

If you multiply the returned value by the interval size and divide by 8 you'll get it in bytes.

rrdtool fetch myfile.rrd AVERAGE -r 86400 -e 1346526000 -s e-24h
                             ds0                 ds1
1346544000: 4.3133558301e+04 2.2494106657e+03

Multiply 43133 (ds0, bits/sec) by 86400 (sec in the interval, 1 day) and divide by 8 (bit/byte) to get bytes/day... this example makes about 455 MBytes which sounds reasonable.

You could also use the Routers2 frontend to MRTG/RRD which calculates this for you and displays it on the page :)


Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.shipway at auckland.ac.nz
Ph: +64 9 373 7599 ext 86487

More information about the mrtg mailing list