[rrd-users] weird update values from cron

Jandre Olivier jandre at megaserve.net
Mon Nov 21 14:36:08 MET 2005


Hi There,

I've been struggling with this now for a while, trying all sorts of methods.

I simply create a traffic RRD with in and out Data sources.

here is my create script:
rrdtool create $DATABASE_DIRECTORY/network_usage_$1.rrd -s 300 \
         DS:in:GAUGE:600:U:U \
         DS:out:GAUGE:600:U:U \
         RRA:LAST:0.5:1:2000 \
         RRA:AVERAGE:0.5:1:2000 \
         RRA:AVERAGE:0.5:6:2000 \
         RRA:AVERAGE:0.5:24:2000 \
         RRA:AVERAGE:0.5:288:2000


Updating script for my network interfaces I use "system activity 
reporter" linux:

TIMESTAMP=`date +%s`;

TRAFFIC=`/usr/bin/sar -n DEV | grep $1 | tail -2 | head -1 | awk '{print 
$6":"$7}'`

rrdtool update $DATABASE_DIRECTORY/network_usage_$1.rrd $TIMESTAMP:$TRAFFIC


If I do the following from command line, everything seems to work ok

while true ;do  ./updaten.sh eth0 ; sleep 5m ; done

my values in my RRD looks correct and drawing the graph seems perfect:

1132578600: 5.5507237333e+03 9.1437223333e+02


but When I run this same script via cron, (did a test that the path is 
correct) my values seems to be in bytes when drawing the graph:

1132578000: 6.7956503333e+02 0.0000000000e+00


Strangely enough, my disk rrds and cpu rrds work fine, they get updated 
via cron no problem.

My distro I use is Fedora 3 with rrdtool 1.2.11.

Any advice would be much aprreciated

Thanks

Jandre





-- 
/*---------------------------------------------------------------------*/
                         __   _
             ---------- / /  (_)__  __ ____  __  ---------
               ------- / /__/ / _ \/ // /\ \/ / --------
                 ---- /____/_/_//_/\_,_/ /_/\_\ ------
                    localhost at localdomain.za.net

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



More information about the rrd-users mailing list