[rrd-users] Re: Fetching average of last n samples, rrdtool fetch perl

Alex van den Bogaerdt alex at ergens.op.het.net
Wed Sep 21 14:09:24 MEST 2005


On Wed, Sep 21, 2005 at 01:57:11PM +0200, Leif Neland wrote:
> I'm samping some temperatures every 60 seconds.
> 
> I want to fetch the average of the last 5 minutes, and use the number in a 
> perl script.
> 
> I've tried commands like
> 
> rrdtool fetch /usr/local/www/data/temperatur/temp2.rrd  AVERAGE --resolution 
> 300s -snow-8min -enow-2min
> 
> but I still get several lines of data, with timestamps 60 seconds apart.

Try this:

rrdtool graph /dev/null \
    --start end-5min \
    --end now-2min \
    DEF:t=/usr/local/www/data/temperatur/temp2.rrd:x:type \
    PRINT:t:%lf

(adjust "x" and "GAUGE")

--
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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list