[rrd-users] RRDs::fetch perl method

Daniel J McDonald dmcdonald at digicontech.com
Fri Apr 6 22:43:49 MEST 2001


I've played with rrdtool for a while, and ran it all neatly packaged up in
MRTG and 14all.cgi for a while, but now I want to play a little:

I'm trying to gather 1 day averages.  Based on the documents and faqs I have
read, I should be able to do something like:

[dmcdonald at netmon dmcdonald]$  /usr/local/rrdtool/bin/rrdtool fetch
/home/httpd/mrtg/172.16.0.1_fa0_0.rrd AVERAGE -r 86400 -s end-0
                      ds0           ds1

 986589300: 4.6913362181e+04 2.8086596653e+04
 986589600: nan nan
[dmcdonald at netmon dmcdonald]$

Except that I get the same number when I do:
[dmcdonald at netmon dmcdonald]$  /usr/local/rrdtool/bin/rrdtool fetch
/home/httpd/mrtg/172.16.0.1_fa0_0.rrd AVERAGE -r 300 -s end-0
                      ds0           ds1

 986589300: 4.6913362181e+04 2.8086596653e+04
 986589600: nan nan
[dmcdonald at netmon dmcdonald]$

So, either the -r flag doesn't work, or I've misinterpreted what it does....

I also tried to get the information in perl, copying liberally form a script
posted by Steve Rader:
#!/usr/bin/perl -w

use RRDs;

my $file = '/home/http/mrtg/172.16.0.1_fa0_0.rrd';
my $interval = 86400;
my @opts;
push @opts, $file;
push @opts, "AVERAGE";
push @opts, "-r $interval";

my ($start,$step,$names,$data) =
    RRDs::fetch @opts;

print localtime($start);

When I run this, I get "unitialized value" errors on $start, and if I use
debug and try to step into the RRDs::fetch  line, I don't hit a subroutine.

what's up with that?

Daniel J McDonald - CCIE 2495, CNX
Principal Network Specialist
Digicon Technologies
http://www.digicontech.com
dmcdonald at digicontech.com

Digicon - A Cisco Systems Partner, Silver Certified.


--
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