[rrd-users] Drawing daily Min/Max graph from a source with UN values

Simon Hobson linux at thehobsons.co.uk
Sun Feb 1 15:44:13 CET 2015

Alexander Topolanek <atopo at ocv.org> wrote:

> I'm fetching data from my radio weather station and put them into graphs. A graph that shows the temperature over the day, and follow up graphs that show min, max and average temps from the previous days.
> Unfortunately some times the transmission from the weather station fails, and I have unknown values for a few minutes. A short gap in the daily temps gauge is not a problem, but for any day with a UN Value I do not get min/max/average calculations...
> That is the command for calculation the weekly values:
> rrdtool graph temps-week-2103.png   -s 'now - 1 week' -e 'now'  \
> --title "Temperatur in LE " \
> DEF:temps9=/var/rrd/weather.rrd:temps9:AVERAGE  \
> VDEF:temps9min=temps9,MINIMUM \
> VDEF:temps9max=temps9,MAXIMUM \
> VDEF:temps9last=temps9,LAST \
> COMMENT:"\t\t\tMin  " \
> COMMENT:"Max  " \
> COMMENT:"Aktuell" \
> COMMENT:"\n" \
> LINE4:temps9#00C000:"KS-300     " \
> GPRINT:temps9min:"%6.1lf " \
> GPRINT:temps9max:"%6.1lf %S" \
> GPRINT:temps9last:"%6.1lf %S \n"

You would probably be better having an RRA for min and max in your database rather than just one for average. Two reasons - firstly you can specify the XFF value (eg allow 50% to be unknown before the RRA becomes unknown), and also because min and max will become more and more inaccurate the further the data is consolidated.
On the latter, you could have a day that swings between say -10˚ at night and +10˚ during the day - but after consolidation it could end up with min=max=average=0 !

More information about the rrd-users mailing list