[rrd-users] rate per day graph from rate per hour DS

Ben Griffith griffithba at gmail.com
Mon Jan 29 23:34:33 CET 2007


Hi,

I have a RRD that was defined as follows:

rrdtool create $sensor.rrd -s 3600 \
        DS:minutes:ABSOLUTE:3600:0:60 \
        RRA:MAX:0.5:1:4800

Once per minute the RRD is updated with a 1 if my boiler is running, or a 0
if it is not.  From that I can easily make a pseudo bar graph showing how
many minutes the boiler was running in each hour, using this command:

rrdtool graph /home/griffith/public_html/boiler_time.png \
              --start -5_day --y-grid 1:5 --x-grid
HOUR:1:HOUR:24:HOUR:6:0:%I%p \
              --height 200 --width 650 --imgformat PNG \
              --title "Boiler run-time per Hour" --vertical-label "minutes"
\

DEF:ib1=/usr/local/misterhouse/trunk/data/rrd/Burner_Counter.rrd:minutes:MAX
\
              CDEF:minperhr=ib1,3600,* \
              AREA:minperhr#ff0000 \
              COMMENT:"$timenow"

I'm not sure if MAX is appropriate for the RRA in my case or not, but all
four aggregate functions gave me the same (correct) results for the hourly
graph.

What I'd like to do now is have a similar pseudo bar graph showing how many
minutes the boiler was running each day.  I thought the following command
should do it:

rrdtool graph /home/griffith/public_html/boiler_day.png \
              --start -5_day --x-grid DAY:1:DAY:1:DAY:1:86400:%A \
              --height 200 --width 500 --imgformat PNG \
              --title "Boiler run-time per day" --vertical-label "minutes" \

DEF:ib1=/usr/local/misterhouse/trunk/data/rrd/Burner_Counter.rrd:minutes:MAX:step=86400
\
              CDEF:minperday=ib1,86400,* \
              AREA:minperday#ff0000 \
              COMMENT:"$timenow"

For some reason this is not making the step boundaries at midnight, but at
19:00.  The consolidation doesn't seem to be giving me the "minutes per
second" rate that I got without consolidation.  When I multiply by the
number of seconds in a day I'm getting a daily rate that I think is about
three times what it should be.

OK, I just figured out why the rate was wrong.  I needed to add
":reduce=AVERAGE" to the end of the DEF line (or I guess maybe I should have
used AVERAGE instead of MAX when I defined the RRA).  Now the rates look
correct, but the step boundaries are still at 19:00 instead of at midnight.
I tried supplying start and end times in the DEF, but the boundaries are
still always placed at 19:00.  How can I change that?

Thanks,
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20070129/0e620d08/attachment-0001.htm 


More information about the rrd-users mailing list