[rrd-users] How to get Average for defined time only

Tobias Oetiker tobi at oetiker.ch
Thu Jan 21 08:56:32 CET 2010


Hi Vinod,

Today Vinod Sharma wrote:

> I am creating daily graphs using RRDTool from the logs of my application. I
> am using below settings to do the same.
>
> rrdtool graph - \
>  --start=end -7d \
>  --end=midnight \
>  --imgformat=PNG \
>  --width=1048 \
>  --base=1000 \
>  --height=266 \
>  --logarithmic \
>  --interlaced \
>  DEF:A=test.rrd:data:AVERAGE \
>  CDEF:A=f,POP,LTIME,86400,%,3600,/,FLOOR,DUP,23,LT,*,6,GT,INF,UNKN,IF \
>  AREA:A#7FFFD4: Day Time \
>  LINE2:f#DDA0DD:data AVERAGE

>
> Currently I am displaying the day time as shown in above example but I want
> to get the output average of day time data only i.e. 7AM to 10 PM. Can
> anyone please suggest how can I get the average of day time data only and
> skip other data.

you can use a second DEF where you pull in only partial data giving
the exact start and end time and then calculate the average for
from that second import ...

and no, I have no example and I have not tried it ... but I think
it should work :-)

cheers
tobi


-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900



More information about the rrd-users mailing list