diff --git a/plugins/weather/openweather_ b/plugins/weather/openweather_ index cce41ab5..1aa3b7e4 100755 --- a/plugins/weather/openweather_ +++ b/plugins/weather/openweather_ @@ -16,16 +16,13 @@ ## From Oct 9 2015 OpenWeather needs you to register and get an APIKEY # include this key by setting 'env.apikey' in munin plugin config, i.e.: # [openweather_*] -# env.owapikey XYZ +# env.apikey XYZ -query_string=$(printf '%s' "${0#*_}" | tr '_' '=') -query_string="$query_string&appid=$owapikey" +location=$(printf '%s' "${0#*_}" | tr '_' '=') +query_string="${location}&appid=${apikey}&units=metric" plugin_name=$( basename $0 ) OWAPI=$( curl -s "http://api.openweathermap.org/data/2.5/weather?mode=xml&${query_string}") -# API returns temp in K, we have to convert it in C -# &units=metric would change that ;-) -KELVIN_BIAS=273 CITY=$( expr "$OWAPI" : '.*\