#!/bin/sh
echo "Content-type: image/png"
echo
D=/var/log/arexxd
exec rrdtool graph - \
	--start 'now-2h' \
	--end 'now' \
	--title "Temperature" \
	-w 360 -h 200 \
	-x MINUTE:10:MINUTE:30:MINUTE:30:0:%H:%M \
	-y 5:1 \
	--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 'LINE2:a#0000cc:Ursarium\n' \
	DEF:d=$D/sensor-catarium.rrd:temp:AVERAGE 'LINE2:d#cc0000:Catarium\n' \
	DEF:c=$D/sensor-balcony.rrd:temp:AVERAGE 'LINE2:c#cc00cc:Balcony\n' \
	DEF:b=$D/sensor-outside.rrd:temp:AVERAGE 'LINE2:b#00cc00:Outside' \
	'HRULE:0#0000ff'