[rrd-users] rrd daily, monthly, weekly, yearly...

Wernher Eksteen weksteen at gmail.com
Thu Nov 22 18:39:09 CET 2007


On 22/11/2007, Simon Hobson <linux at thehobsons.co.uk> wrote:
> Wernher Eksteen wrote:
>
> >Currently I have graphs tracking byte/s over daily, monthly, weekly
> >and yearly interval's, but not getting the results I need, my daily
> >average seems to work fine at 5 minute interval's with a -step of 600,
> >but my weekly, monthly and yearly graphs seems to be completely out of
> >sync with values I'm getting compared to daily graphs.
> >
> >For instance, on daily graphs my MAX average of bytes/s outbound
> >transfer rate was 8MB/s which is roughly 64Mb/s. Where as on my
> >weekly, monthly and yearly graphs the MAX ave was only 3MB/s... Am I
> >doing something wrong, or is that right?
>
> You seem to be making a common mistake.
>
> If you want MAX you must store MAX !
>
> If you store AVERAGE and then graph the max value of it, then you
> will see lower figures.
>
> Suppose I download at 24mbps for one hour in a day. On a 10 minute
> step size you will see a block at 24mbps. If you let that feed
> through into an RRA that creates an average over 24 hours then the
> average for that day will be 1Mbps. Graphing MAX will only ever show
> you that 1Mbps.
>
> If you want to be able to see the 24Mbps, then you need to create an
> RAA with MAX function - graphing MAX will then use the MAX RRA and
> you will see 24Mbps for that day.
>
>
> So if you will need max in the future store max, if you will need
> average then store average, if you will need min then store min - if
> you need all three then you store all three (they are different, 24,
> 1, 0 in the example I've just given).

Hi, thanks for responding so soon!

Ok so if I'm understandin you right, what you're saying is this...

For AVERAGE this rrd is fine:

 rrdtool create "${1}" \
       DS:in:DERIVE:600:0:12500000 \
       DS:out:DERIVE:600:0:12500000 \
       RRA:AVERAGE:0.5:1:576 \
       RRA:AVERAGE:0.5:6:672 \
       RRA:AVERAGE:0.5:24:732 \
       RRA:AVERAGE:0.5:144:1460

For MAX I need to change it to:

rrdtool create "${1}" \
       DS:in:DERIVE:600:0:12500000 \
       DS:out:DERIVE:600:0:12500000 \
       RRA:MAX:0.5:1:576 \
       RRA:MAX:0.5:6:672 \
       RRA:MAX:0.5:24:732 \
       RRA:MAX:0.5:144:1460

For MIN I need to change it to:

rrdtool create "${1}" \
       DS:in:DERIVE:600:0:12500000 \
       DS:out:DERIVE:600:0:12500000 \
       RRA:MIN:0.5:1:576 \
       RRA:MIN:0.5:6:672 \
       RRA:MIN:0.5:24:732 \
       RRA:MIN:0.5:144:1460

And to have them all (MIN,  MAX and AVERAGE) can I do this?

rrdtool create "${1}" \
       DS:in:DERIVE:600:0:12500000 \
       DS:out:DERIVE:600:0:12500000 \
       RRA:MIN:0.5:1:576 \
       RRA:MAX:0.5:1:576 \
       RRA:AVERAGE:0.5:1:576 \
       RRA:MIN:0.5:6:672 \
       RRA:MAX:0.5:6:672 \
       RRA:AVERAGE:0.5:6:672 \
       RRA:MIN:0.5:24:732 \
       RRA:MAX:0.5:24:732 \
       RRA:AVERAGE:0.5:24:732 \
       RRA:MIN:0.5:144:1460
       RRA:MAX:0.5:144:1460
       RRA:AVERAGE:0.5:144:1460

And then at graph creation time can I do this?

  rrdtool graph "${1}.new" -a PNG -s -"${2}" -w 550 -h 240 -v "bytes/s" \
 'DEF:ds1='${3}':in:MIN' \
 'DEF:ds2='${3}':out:MIN' \
 'DEF:ds3='${3}':in:MAX \
 'DEF:ds4='${3}':out:MAX' \
 'DEF:ds3='${3}':in:AVERAGE' \
 'DEF:ds4='${3}':out: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 "${4}"
 mv -f "${1}.new" "${1}"

Will this do the trick ?

Thanks!
Wernher



More information about the rrd-users mailing list