• https://code.google.com/p/fabfi/wiki/RRDtutorial
rrdtool fetch meshdata.rrd AVERAGE
# To fetch data stored between certain periods ( in unix time stamp )
rrdtool fetch meshdata.rrd AVERAGE --start 1310229568 --end 1310229868
rrdtool create meshdata.rrd --step 60  \
        DS:meshin:DERIVE:600:30:12500000 \
        DS:meshout:DERIVE:600:30:12500000 \
        RRA:AVERAGE:0.5:1:60 \
        RRA:AVERAGE:0.5:5:288 \
        RRA:AVERAGE:0.5:60:168
#!/bin/bash
MESHRRD=/home/user/meshdata.rrd
MESHIF=eth0
MESHIN=`ifconfig "${MESHIF}" |grep bytes|awk -F ":" '{print $2}'|awk '{print $1}'`
MESHOUT=`ifconfig "${MESHIF}" |grep bytes|awk -F ":" '{print $3}'|awk '{print $1}'`
rrdupdate "${MESHRRD}" -t meshin:meshout N:"${MESHIN}":"${MESHOUT}
rrdtool graph meshgraph.png -a PNG -s -120 -w 550 -h 240 -v "bits/s" \
  'DEF:ds1=meshdata.rrd:meshin:AVERAGE' \
  'DEF:ds2=meshdata.rrd:meshout:AVERAGE' \
  'LINE1:ds1#00FF00:Incoming Traffic' \
  GPRINT:ds1:MAX:"Max %6.2lf %s" \
  GPRINT:ds1:MIN:"Min %6.2lf %s" \
  GPRINT:ds1:AVERAGE:"Avg %6.2lf %s" \
  GPRINT:ds1:LAST:"Curr %6.2lf %s\n" \
  'LINE1:ds2#0000FF:Outgoing Traffic' \
  GPRINT:ds2:MAX:"Max %6.2lf %s" \
  GPRINT:ds2:MIN:"Min %6.2lf %s" \
  GPRINT:ds2:AVERAGE:"Avg %6.2lf %s" \
  GPRINT:ds2:LAST:"Curr %6.2lf %s" \
  -t MeshDataGraph