[rrd-users] Problem making 1 minute graphs.

Victor victord at paid.com
Thu Dec 19 09:40:38 MET 2002


Hi. I am trying to make a graph that makes a 1 minute average for 24 
hours. Here is my script. Could someone point out what I am doing wrong? 
I get a blank graph. It must be something simple, cause it's so late...

I set --step to 60, meaning updates come ever minute.
I average 1 value of 1, so it's just 1 minute interval value and
I do it 1440 times, which is 1 * 1440 / 60 = 1 day

But I jsut get blank, even though cron has been running this script for 
a while now... At least an hour. And I am doing ssh transfers for load.

MRTG reports fine... I just seem to be missing something...

Thanks,
Victor

-- update.sh --

#!/bin/sh
######################################################################
# Update counter Script
######################################################################

IMGFILE="xxxxxx.png"
RRDFILE="xxxxxx.rrd"
IMGDIR="/home/rrd/"
RRDDIR="/home/www/"
ROUTER="xx.xx.xx.xx"
COMMUN="mycommunity"

######################################################################
# Create RRD database file if it does not exist
# step 60 (updates 1/min) so 1 * 1440 / 60 = 1 day OR 24 hours
######################################################################
if [ ! -f $RRDDIR/$RRDFILE ]; then
         rrdtool create $RRDDIR/$RRDFILE --step 60 \
                 DS:inbound:COUNTER:600:U:U \
                 DS:outbound:COUNTER:600:U:U \
                 RRA:AVERAGE:0.5:1:1440

#        rrdtool create $RRDDIR/$RRDFILE --step 300 \
#                DS:inbound:COUNTER:600:0:100 \
#                DS:outbound:COUNTER:600:0:100 \
#                RRA:AVERAGE:0.5:1:576 \
#                RRA:AVERAGE:0.5:6:336 \
#                RRA:AVERAGE:0.5:24:366 \
#                RRA:AVERAGE:0.5:144:730

fi

######################################################################
# Get updated valued from SNMP Device
######################################################################
  in=`snmpget $ROUTER $COMMUN 2.2.1.10.2 | sed -e 's/[^:]\+: //'`
out=`snmpget $ROUTER $COMMUN 2.2.1.16.2 | sed -e 's/[^:]\+: //'`

######################################################################
# Update RRD DB
######################################################################
rrdtool update $RRDDIR/$RRDFILE N:$in:$out

######################################################################
# Daily Graph (1min average) for a T1 - 1.5 Mbits/s
######################################################################
rrdtool graph -a PNG $IMGDIR/$IMGFILE -w500 --start -86400 \
                                             --upper-limit 1500000 \
             DEF:in_octets="$RRDDIR/$RRDFILE":inbound:AVERAGE \
             DEF:outoctets="$RRDDIR/$RRDFILE":outbound:AVERAGE \
            CDEF:inb=in_octets,8,* \
            CDEF:out=outoctets,8,* \
            AREA:inb#6495ED:" Inbound - " \
          GPRINT:inb:MIN:"Min\\: %6.2lf %sbps" \
          GPRINT:inb:MAX:"Max\\: %6.2lf %sbps" \
          GPRINT:inb:AVERAGE:"Avg\\: %6.2lf %sbps" \
          GPRINT:inb:LAST:"Last\\: %6.2lf %sbps\\n" \
           LINE1:out#FFD700:"Outbound - " \
          GPRINT:out:MIN:"Min\\: %6.2lf %sbps" \
          GPRINT:out:MAX:"Max\\: %6.2lf %sbps" \
          GPRINT:out:AVERAGE:"Avg\\: %6.2lf %sbps" \
          GPRINT:out:LAST:"Last\\: %6.2lf %sbps\\n"

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