[rrd-users] Counting the number of times a threshold has been reached and print that number, trouble with TOTAL

Alexander Topolanek atopo at ocv.org
Tue Jul 26 09:07:56 CEST 2016


Hello,


I'm collecting data from my weather station and keep the data in a rrd. 
I've consolidated values over the year for minimum, maximum and average 
temperature for each day of the year. I would like to present the number 
of days that meet some criteria, i.e. "Number of hot day (Max Temp > 
30°C)" .

I've tried with

rrdtool graph temps-2016-2103test.png -s 20160701 -e start+1m  \
   -w 1200 -h 300 \
   --upper-limit 40 --lower-limit -15 \
   --title "Temperatur  2016  Test" \
   DEF:tempmins9=/var/rrd/weather.rrd:temps9:MIN:step=1 \
   DEF:tempmaxs9=/var/rrd/weather.rrd:temps9:MAX:step=1 \
   DEF:temps9=/var/rrd/weather.rrd:temps9:AVERAGE \
   CDEF:hotday=tempmaxs9,30,GE \
   VDEF:sumhotdays=hotday,TOTAL \
   CDEF:tempranges9=tempmaxs9,tempmins9,- \
   LINE1:tempmins9#00C000 \
   AREA:tempranges9#00F000::STACK \
   LINE1:tempmaxs9#00C000 \
   LINE2:temps9#00C000:Aussen \
   LINE2:hotday#C00000:Hotday \
   GPRINT:sumhotdays:"total %3.10lf %s"


But the result is weird... the line for hotdays is working, showing 1's 
for all days above 30, but the total is 1.296000 M, not 14...

kind regards
Alexander

-- 

liebe Grüße
Alexander Topolanek
http://www.bienenhonig.cc


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4224 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.oetiker.ch/pipermail/rrd-users/attachments/20160726/7d3768b7/attachment.bin>


More information about the rrd-users mailing list