[rrd-users] strftime and TREND

Alex van den Bogaerdt alex at ergens.op.het.net
Sat Dec 1 00:26:20 CET 2007


On Fri, Nov 30, 2007 at 10:15:20PM +0200, Petteri Matilainen wrote:

> I need to graph the average temperature like I'm graphing the 
> temperature. Samples are taken every minute and fed to an rrd. I thought 
> that trend worked for me, but somehow it doesn't. For example I have 
> temperature graphed over 24 hrs (-s -1day). Is it possible to have TREND 
> curve over that time so that the resulting curve is same as I took 
> samples every 60 seconds of what this line gives and then graphed that 
> (because that's what I'm doing now and it works): 
> PRINT:Outside:AVERAGE:"%6.2lf"? If I've understood correctly, this line 
> should give me what I want:
> 
> CDEF:outavg=Outside,86400,TREND

The number printed by that PRINT statement, is the average of
all rates visible on the graph.

The same number can be found using:

VDEF:outavg=Outside,AVERAGE

This results in one rate, which can be used by LINE and PRINT:

LINE:outavg#FF0000:Average
PRINT:outavg:%6.2lf


> But it doesn't. No line. If I try a smaller number, like 1800 seconds, I get a nice TREND curve which is the 30 minute average. I need 24 h average (and 1 week, 1 month and 1 year). If this isn't possible with TREND, I'll continue to use my version, which is to fetch the average that the above print line gives and fed that to another averages.rrd, from which I graph average variations over the time spans.

I think trend doesn't work for you because it doesn't get enough data.
If you look more closely at the 1800 trend, you will see it starts just
after the rest of the graph.  My guess: as the number (1800) approaches
the amount of time on the graph (86400), the more data is skipped. As
soon as you have trend 86400, the trend is only showing up on the last
column.


HTH
-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the rrd-users mailing list