X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=web%2Ftemp-12h.cgi;h=432014d222e72fc84216219fd3b9658502b97f3d;hb=eeae054932ce08bbacfcf9a38261bf5a9d41f86d;hp=3e82db68ffdd0235556943009533d5d23715140d;hpb=9f54f7295c6f3f08ec5a691a9292551a5cd6ff13;p=arexx.git diff --git a/web/temp-12h.cgi b/web/temp-12h.cgi index 3e82db6..432014d 100755 --- a/web/temp-12h.cgi +++ b/web/temp-12h.cgi @@ -2,6 +2,17 @@ echo "Content-type: image/png" echo D=/var/log/arexxd + +current () +{ + Z=$(rrdtool fetch $1 AVERAGE -s-5min -r900 | grep : | grep -v nan | tail -1 | cut -d ' ' -f 2) + if [ -z "$Z" ] ; then + echo -n "---- " + else + printf "%4.1f°" "$Z" + fi +} + exec rrdtool graph - \ --start 'now-12h' \ --end 'now' \ @@ -12,16 +23,31 @@ exec rrdtool graph - \ --right-axis 1:0 --right-axis-format "%3.0lf" \ --units-exponent 0 --lower-limit -20 --upper-limit 40 --rigid \ --legend-position east \ - DEF:c=$D/sensor-catarium.rrd:temp:AVERAGE \ + --pango-markup \ + DEF:g=$D/sensor-garage.rrd:temp:AVERAGE \ DEF:u=$D/sensor-ursarium.rrd:temp:AVERAGE \ - DEF:b=$D/sensor-balcony.rrd:temp:AVERAGE \ - DEF:o=$D/sensor-outside.rrd:temp:AVERAGE \ - 'AREA:c#cc7777' \ + DEF:c=$D/sensor-catarium.rrd:temp:AVERAGE \ + DEF:m=$D/sensor-machinarium.rrd:temp:AVERAGE \ + DEF:a=$D/sensor-aquarium.rrd:temp:AVERAGE \ 'AREA:u#7777cc' \ - 'AREA:b#cc77cc' \ - 'AREA:o#77cc77' \ - 'LINE2:c#cc0000:Catarium\n' \ + 'AREA:m#77cc77' \ + 'AREA:c#cc77cc' \ + 'AREA:g#cc7777' \ + 'LINE2:g#cc0000:Garage\n' \ 'LINE2:u#0000cc:Ursarium\n' \ - 'LINE2:b#cc00cc:Balcony\n' \ - 'LINE2:o#00cc00:Outside' \ - 'HRULE:0#0000ff' + 'LINE2:a#00cccc:Aquarium\n' \ + 'LINE2:c#cc00cc:Catarium\n' \ + 'LINE2:m#00cc00:Machinarium\n' \ + 'HRULE:0#0000ff' \ + 'COMMENT:\s' \ + 'COMMENT:\s' \ + 'COMMENT:\s' \ + 'COMMENT:'"$(current $D/sensor-garage.rrd)"'\l' \ + 'COMMENT:\s' \ + 'COMMENT:'"$(current $D/sensor-ursarium.rrd)"'\l' \ + 'COMMENT:\s' \ + 'COMMENT:'"$(current $D/sensor-aquarium.rrd)"'\l' \ + 'COMMENT:\s' \ + 'COMMENT:'"$(current $D/sensor-catarium.rrd)"'\l' \ + 'COMMENT:\s' \ + 'COMMENT:'"$(current $D/sensor-machinarium.rrd)"'\l' \