[rrd-users] Historical TOTALS instead of AVERAGE

Ben Griffith griffithba at gmail.com
Tue Jan 23 23:07:46 MET 2007


I think what I've been playing with today is similar to what you want to
do.  I've got a sensor on my boiler that enables me to see when the burner
is running.  I want to see how long the burner runs in a given period.  I've
been using a 5 minute period so I don't have to wait long to see results.
The graph is a plot of how many minutes the burner was on per 5 minute
period.  I don't know if this is the best way to do it, but it seems to be
working:

rrdtool create $sensor.rrd -s 300 \
                DS:minutes:ABSOLUTE:300:0:5 \
                RRA:MAX:0.5:1:2400 \
                RRA:LAST:0.5:1:2400 \
                RRA:MIN:0.5:1:2400 \
                RRA:AVERAGE:0.5:1:2400

I wasn't sure which RRA I'd want, but it turns out I'm only using the MAX
one.
Every minute either a 0 or a 1 gets added, depending on whether the burner
is on or off.

timenow=`date | sed 's/:/\\\:/g'`
rrdtool graph $sensor.png \
              --start -1_hour --alt-y-grid \
              --height 190 --width 600 --imgformat PNG \
              --vertical-label "minutes" \
              DEF:ib1=$sensor.rrd:minutes:MAX \
              CDEF:mydata=ib1,300,* \
              AREA:mydata#ff0000 \
              COMMENT:"$timenow"

It took me a while to figure out that I was getting the rate per second, so
I multiplied by 300 to get the rate per 5min (like Mr. Hobson said in his
email).
One thing I'm curious about is whether it's possible to make graphs of
several rates from the same RRD file.  For example, using the same RRD file
to graph minutes per hour, per day, per week, etc.

-Ben


On 1/23/07, Mike Sturdee <sturdee at pathwaynet.com> wrote:
>
> I am looking to graph some call data, with either the total number
> of calls over 5 minutes put in rrd (or update the rrd each time a call
> arrives, if possible) and then for each 5 minute increment, plot
> the number of total calls in that time on the graph..
>
> While that part doesn't seem to difficult, in the historical
> "weekly - 30min avg", "monthly - 2hour avg", etc, instead of being an
> average over 30min, 2hour, etc, i would like to graph the sum total for
> calls per "30min, 2hour, etc" time period..
>
> Is this at all possible with rrd?
>
> Thanks,
>
> -Mike
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.oetiker.ch/pipermail/rrd-users/attachments/20070123/24d500db/attachment.htm 


More information about the rrd-users mailing list