[rrd-users] Re: Hov the get max and average values for an interval

Dave Plonka plonka at doit.wisc.edu
Fri Jun 9 15:26:28 MEST 2000


On Fri, Jun 09, 2000 at 02:45:04PM +0200, Bjorn Nordbo wrote:
> I am working on a utility similiar to 14all.cgi) that aims to imitate
> the way MRTG presents information. The idea is to have different modes
> to return the various dynamic information like last updated, last, max
> average-text and the graph itself.
> 
> Anyway, I can't figure out how to to get the max and average values
> from the RRD. Conceptually, I would like 'rrdtool fetch' to do this:
> 
> $ rrdtool fetch dings.rrd AVERAGE --start -1d
> 105613 5331357
> $
> 
> Where the numbers returned are the average values for the two data-
> sources of dings.rrd (is the order of these fixed?) for the last
> 24 hours.
<snip>
> Is this possible to do with rrdtool?

You would use, believe it or not, "rrdgraph" to do this...

I'm not quite clear, though, whether you mean that you want one average
and max (of both DSes) or an average and max of each DS.  Let's assume
you meant the latter and furthermore, lets assume you have both AVERAGE
and MAX RRAs within the RRD.  You could do this:

   rrdtool graph /dev/null \
   'DEF:A=dings.rrd:ds0:AVERAGE' \
   'DEF:B=dings.rrd:ds1:AVERAGE' \
   'DEF:C=dings.rrd:ds0:MAX' \
   'DEF:D=dings.rrd:ds1:MAX' \
   'PRINT:A:AVERAGE:ds0 ave ave=%.2lf' \
   'PRINT:B:AVERAGE:ds1 ave ave=%.2lf' \
   'PRINT:C:MAX:ds0 max max=%.2lf' \
   'PRINT:D:MAX:ds1 max max=%.2lf'

BTW, my RRGrapher front-end/utility (which you can find linked from
Tobi's site and is here http://net.doit.wisc.edu/~plonka/RRGrapher/)
produces an example command like this for you if you turn on its
"[ ] Show statistics using this format:  [ %.2lf ]" feature under
"Graph Options".

Dave

-- 
plonka at doit.wisc.edu  http://net.doit.wisc.edu/~plonka  ARS:N9HZF  Madison, WI

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



More information about the rrd-users mailing list