X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=web%2Ftemp-12h.cgi;h=432014d222e72fc84216219fd3b9658502b97f3d;hb=eeae054932ce08bbacfcf9a38261bf5a9d41f86d;hp=9bfbfcbca8cef5937dbe1da002b16cf43e292cf9;hpb=9ae8fda6fa08112db332c5c4b1006a8d6621157d;p=arexx.git
diff --git a/web/temp-12h.cgi b/web/temp-12h.cgi
index 9bfbfcb..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,6 +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:a=$D/sensor-ursarium.rrd:temp:AVERAGE 'LINE1:a#0000cc:Ursarium\n' \
- DEF:b=$D/sensor-balcony.rrd:temp:AVERAGE 'LINE1:b#00cc00:Balcony\n' \
- DEF:c=$D/sensor-catarium.rrd:temp:AVERAGE 'LINE1:c#cc0000:Catarium'
+ --pango-markup \
+ DEF:g=$D/sensor-garage.rrd:temp:AVERAGE \
+ DEF:u=$D/sensor-ursarium.rrd:temp:AVERAGE \
+ 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:m#77cc77' \
+ 'AREA:c#cc77cc' \
+ 'AREA:g#cc7777' \
+ 'LINE2:g#cc0000:Garage\n' \
+ 'LINE2:u#0000cc:Ursarium\n' \
+ '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' \