[rrd-users] is this right?

Arthur Cinader Jr. acinader at panix.com
Thu Feb 27 19:55:28 MET 2003


This isn't a question so much as a request for 
experienced eyes to check some of this complete rrd 
neophyte's assumptions.... 

Been studying the tutorial samples and playing around 
with rrdtool to get the hang of it.

To test my understanding, I figured 
that I'd rather see output from Alex van den Bogaerdt's 
excellent "A Real World Example" in text.  The 
following bash script endeavors to print (without any 
explanatory anything) the 5min, daily, weekly, and 
yearly average and max "inoctets" gleaned from my snmp 
counter.  (I've put the rrdtool create statememnt way 
below in case you aren't familiar with the tutorial 
example but want to help me anyway).

The assumptions that I am not sure of:

is the yearly AVERAGE and MAX NaN becuase there are 
insufficient observations (I haven't even collected two 
days of data yet)?

have I got the right start times to output a five_min, 
day, week and year?

is my CDEF correctly changing octets into kbps?

is there a way to accomplish this in a single rrdtool 
invocation? (please don't show me!! need something else 
to try)

the output looks like

0.008729
0.008729
0.000984
0.008729

0.560641
134.733367
0.017480
134.733367

0.216471
134.733367
0.148991
134.733367

0.038885
3.208936
0.206232
3.208936


#!/bin/bash

rrdb=/home/sc/rrdtest/test.rrd

five_min=300
day=86400
week=604800
year=31536000

time=($five_min $day $week $year)

for t in ${time[*]}
do
  /usr/local/rrdtool-1.0.41/bin/rrdtool graph $rrdb \
   --start -$t  \
   DEF:avg_inoctets=$rrdb:input:AVERAGE \
    
"CDEF:avg_in_kbps=avg_inoctets,8,*,1000,/" \
   PRINT:avg_in_kbps:AVERAGE:%lf \
   DEF:max_inoctets=$rrdb:input:MAX \
    
"CDEF:max_in_kbps=max_inoctets,8,*,1000,/" \
   PRINT:max_in_kbps:MAX:%lf | grep -v 0x | 
  while read line
  do
   echo $line
  done
  echo
done


---------

rrdtool create test.rrd         \
            DS:input:COUNTER:600:U:U   \
            DS:output:COUNTER:600:U:U  \
            RRA:AVERAGE:0.5:1:600      \
            RRA:AVERAGE:0.5:6:700      \
            RRA:AVERAGE:0.5:24:775     \
            RRA:AVERAGE:0.5:288:797    \
            RRA:MAX:0.5:1:600          \
            RRA:MAX:0.5:6:700          \
            RRA:MAX:0.5:24:775         \
            RRA:MAX:0.5:288:797

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