Discussion:
[rrd-users] Drawing daily Min/Max graph from a source with UN values
(too old to reply)
Alexander Topolanek
2015-02-01 11:08:13 UTC
Permalink
Hello all,

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"

I've tried to play around with CDEF

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:temps9last=temps9,LAST \
CDEF:temps9c=temps9,UN,temps9last,temps9,IF \
VDEF:temps9min=temps9c,MINIMUM \
VDEF:temps9max=temps9c,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" \

but that gives an ERROR: Attempting to reuse 'temps9last'

any help?

thanks and kind regards,
Alexander
Simon Hobson
2015-02-01 14:44:13 UTC
Permalink
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...
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 !
Loading...