[rrd-users] Re: SNMP Total Traffic

Alison L Greenwald alison at andrew.cmu.edu
Mon Jan 15 19:01:16 MET 2001

> From: "Aragon Gouveia" <aragon at cyberhost.co.za>
> Date: Mon, 15 Jan 2001 19:52:04 +0200
> Hi there,
> I'm currently using RRDtool to graph my network interfaces according to data
> rate. I was wondering if it were possible to graph according to total
> raffic over the interface in, say, a week? I need to know how many
> megabytes of data is being transfered over the interfaces for billing
> purposes. Is it possible with RRDtool? I can't figure out a way of doing it.
> Any help is appreciated!

As in you just want a bottom line number of bytes in/out?  Try
something like (in perl5):

open(DT,"rrdtool fetch $rrdname MAX -e $NOW -s $START |");
while(($time, $data) = split /\:/,<DT>,2){
  chomp $data;
  ($IN, $OUT)=split " ",$data;
  $in_total += $IN; $out_total +=$OUT;

I'm not sure of your exact needs and format, you may have a multiplier
that you need to put in there, or other funkyness, but this should be
a decent starting point.  There is an RRDs::fetch perl function, but I've
found it very hard to use, and this should be efficient enough.



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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list