[rrd-users] Update Problem (weird)

*Joe* joe at tormented.org
Sun Apr 21 19:38:36 MEST 2002


Ok. I made a perl script that updates and graphs my rrd. It works fine,
EXCEPT when I run it with crond. I view my cron logs and it executes the
perl script fine without errors. After being executed by crond I have no
updates to my rrd, but only an updated graph with no lines. First,
here's my perl script.
#!/usr/bin/perl
use strict;
 
#DC1
my $dc1in = `snmpwalk localhost joe16 2.2.1.10.2`;
$dc1in = qx{ snmpwalk localhost joe16 2.2.1.10.2 };
my ($dc1inresult) = ( split ' ', $dc1in )[3];
my $dc1out = `snmpwalk localhost joe16 2.2.1.16.2`;
$dc1out = qx{ snmpwalk localhost joe16 2.2.1.16.2 };
my ($dc1outresult) = ( split ' ', $dc1out )[3];
system "/usr/local/rrdtool/bin/rrdupdate
/usr/local/apache/htdocs/rrd/inoutexternal.rrd
N:$dc1inresult:$dc1outresult";
system '/usr/local/rrdtool/bin/rrdtool graph
/usr/local/apache/htdocs/rrd/dc1inout.gif --title="DC1 (External)
Throughput" --start -86400
DEF:download=/usr/local/apache/htdocs/rrd/inoutexternal.rrd:in:AVERAGE
--vertical-label kb/sec
DEF:upload=/usr/local/apache/htdocs/rrd/inoutexternal.rrd:out:AVERAGE
LINE1:download#009933:"Download" AREA:upload#0000FF:"Upload"';
 
Here's my cronlog just to show it does run, (as root)
Apr 21 12:20:00 tormented /USR/SBIN/CRON[69207]: (root) CMD
(/usr/local/apache/htdocs/rrd/script.pl)
 
And here's my crond line in /etc/crontab:
*/5     *       *       *       *       root
/usr/local/apache/htdocs/rrd/script.pl > /dev/null &
 
While I'm downloading or uploading, I run the script using the shell
prompt:
[root at eclipse :/usr/local/apache/htdocs/rrd] ./script.pl
495x172
 
And I get a perfectly working graph with lines and all that good stuff.
Does anyone know what could be the problem? I know it's probably
something stupid, but I'd greatly appreciate it for a feedback that
would help.
 
Thanks
 
 
 


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