# rrds/weathernetwork - get weather info from theweathernetwork.com
#	until they change their format.  See scripts/weathernetwork.

# Status is (1=OK, 2=WARN, 3=ERROR, 4=CRITICAL)
# Response is number of milliseconds it took to query the service.
source	port
step	300
data	status=weathernetwork GAUGE:1200:0:U
data	response=weathernetwork-response GAUGE:1200:0:U
data	temp=weathernetwork:value1 GAUGE:1200:-60:40
data	humidity=weathernetwork:value2 GAUGE:1200:0:100
data	humidex=weathernetwork:value4 GAUGE:1200:-80:60
data	pressure=weathernetwork:value5 GAUGE:1200:90:120
data	windspeed=weathernetwork:value6 GAUGE:1200:0:100
data	dewpoint=weathernetwork:value7 GAUGE:1200:-60:40
archives day-avg week-avg month-avg 3month-avg year-avg
times	day yesterday week 3month year

graph	response desc="how long the remote server took to respond"
	--title '##RRD## Response (##GRAPHTIME##)'
	--lower-limit 0 
	--vertical-label 'ms'
	DEF:response=##DB##:response:AVERAGE
	'LINE2:response###COLOR1##:response'
	'GPRINT:response:MIN:(min,avg,max) = (%.0lf%s,'
	'GPRINT:response:AVERAGE:%.0lf%s,'
	'GPRINT:response:MAX:%.0lf%s)'

graph	temperatures
	--title 'Temperatures for Ottawa (##GRAPHTIME##)'
	--vertical-label 'degrees C'
	DEF:temp=##DB##:temp:AVERAGE
	DEF:humidex=##DB##:humidex:AVERAGE
	DEF:dewpoint=##DB##:dewpoint:AVERAGE
	'AREA:temp###COLOR1##:temperature'
	'LINE2:humidex###COLOR2##:humidex'
	'LINE2:dewpoint###COLOR3##:dewpoint'
	'GPRINT:temp:MIN:temperature\: min=%.1lf'
	'GPRINT:temp:AVERAGE:avg=%.1lf'
	'GPRINT:temp:MAX:max=%.1lf\l'

graph	humidity
	--title 'Humidity for Ottawa (##GRAPHTIME##)'
	--vertical-label '%'
	DEF:humidity=##DB##:humidity:AVERAGE
	'LINE1:humidity###COLOR1##:humidity'
	'GPRINT:humidity:MIN:min=%.1lf'
	'GPRINT:humidity:AVERAGE:avg=%.1lf'
	'GPRINT:humidity:MAX:max=%.1lf\l'

graph	pressure
	--title 'Pressure for Ottawa (##GRAPHTIME##)'
	--upper-limit 103 --lower-limit 99
	--vertical-label 'kPa'
	DEF:pressure=##DB##:pressure:AVERAGE
	'LINE1:pressure###COLOR1##:pressure'
	'GPRINT:pressure:MIN:min=%.1lf'
	'GPRINT:pressure:AVERAGE:avg=%.1lf'
	'GPRINT:pressure:MAX:max=%.1lf\l'

graph	windspeed
	--title 'Wind-Speed for Ottawa (##GRAPHTIME##)'
	--vertical-label 'km/h'
	DEF:windspeed=##DB##:windspeed:AVERAGE
	'LINE1:windspeed###COLOR1##:windspeed'
	'GPRINT:windspeed:MIN:min=%.1lf'
	'GPRINT:windspeed:AVERAGE:avg=%.1lf'
	'GPRINT:windspeed:MAX:max=%.1lf\l'
