[rrd-users] Re: Starting problems

Jeroen Timmer TimmerJ at vertis.nl
Tue Feb 5 23:00:06 MET 2002


Content-Type: text/plain

It seems that everything is in order ... But.
Sometimes I get the right graph .. And the sometimes I get an all different
graph ?!!?

I've attached the 2 different graphs.

This is the way I do it :

Crontab:
*/4 * * * * /usr/local/rrdtool-1.0.33/bin/start_rrdtool

Start_rrdtool:
Cd /usr/local/rrdtool-1.0.33/bin
./router


Router script:

#!/usr/bin/perl

# RRD script

use lib qw( /usr/local/rrdtool-1.0.33/lib/perl ../lib/perl );
use RRDs;



# Get the InOctets of the router and get the value of the complete string


@in =`snmpget <ip> public 2.2.1.10.4`; 
for (@in){
	@regel=split;
	$in=$regel[3];
    	}

	
# Get the OutOctets of the router and get the value of the complete string

@out =`snmpget <ip> public 2.2.1.16.4`;
for (@out){
	@regel=split;
	$out=$regel[3];
	}



# Make the update of router.rrd

 RRDs::update ("/usr/local/rrdtool-1.0.33/bin/router.rrd","N:$in:$out");
 my $ERR=RRDs::error;
 die "ERROR while updating router.rrd: $ERR\n" if $ERR;


RRDs::graph "/usr/local/rrdtool-1.0.33/bin/router-day.gif",
        "--start", " -86400",
        "--title", "Ethernet0 stats per day",
        "--rigid",
        "--width=600",
        "--height=250",
        "--upper-limit","10000",
        "--lower-limit","0",
        "--vertical-label","bytes/sec",
        "DEF:inoctets=router.rrd:input:AVERAGE",
        "DEF:outoctets=router.rrd:output:AVERAGE",
        "DEF:inoctets2=router.rrd:input:MAX",
        "DEF:outoctets2=router.rrd:output:MAX",
        "AREA:inoctets#FFD700:    In Traffic",
        "GPRINT:inoctets:LAST:Current \\: %8.2lf %s",
        "GPRINT:inoctets:AVERAGE:Avg \\: %8.2lf %s",
        "GPRINT:inoctets:MIN:Min \\: %8.2lf %s",
        "GPRINT:inoctets:MAX:Max \\: %8.2lf %s\\n",
        "AREA:outoctets#FF0000:    Out Traffic",
        "GPRINT:outoctets:LAST:Current \\: %8.2lf %s",
        "GPRINT:outoctets:AVERAGE:Avg \\: %8.2lf %s",
        "GPRINT:outoctets:MIN:Min \\: %8.2lf %s",
        "GPRINT:outoctets:MAX:Max \\: %8.2lf %s\\n",
        "LINE1:inoctets2#00FF00:    Max Input",
        "LINE2:outoctets2#CC00CC:    Max Output";

system("rm /usr/local/rrdtool-1.0.33/html/router-day.gif");
system("cp /usr/local/rrdtool-1.0.33/bin/router-day.gif
/usr/local/rrdtool-1.0.33/html/");









-----Original Message-----
From: Alex van den Bogaerdt [mailto:alex at slot.hollandcasino.nl] 
Sent: Tuesday, February 05, 2002 5:54 PM
To: TimmerJ at vertis.nl
Cc: rrd-users at list.ee.ethz.ch
Subject: Re: [rrd-users] Re: Starting problems


Jeroen Timmer wrote:
> 
> Hey Alex,
> 
> Well ... I am a bit further.
> I think I had something wrong with the heartbeat and stuff ..
> 
> I wrote a script that will update every 280 seconds. Seems to work. 
> But when I make crontab to run the script every 4 minutes ... The prob 
> starts. No data in the .rrd file. When I run the script by hand, with 
> a sleep of 280 seconds .. It works. Beats me whats wrong when I run in 
> in the crontab .. All dir's are oke .. Script is running from 
> everywhere on the box :)

Make sure that you are running rrdtool in the same environment.  This means
that (at least) the current working directory is the same, that the PATH
settings are correct, et cetera.

cheers,
Alex




-- Attached file removed by Listar and put at URL below --
-- Type: image/gif
-- Size: 43k (44354 bytes)
-- URL : http://www.ee.ethz.ch/~slist/pantomime/router-day_crontab.gif


-- Attached file removed by Listar and put at URL below --
-- Type: image/gif
-- Size: 44k (45935 bytes)
-- URL : http://www.ee.ethz.ch/~slist/pantomime/router-day_manual.gif


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