#!/bin/sh # Simple OWFS Humidity Munin Plugin # Copyright: (C) 2012 Christoph Winkler # Web: http://www.chrisge.org / http://weather.chrisge.org # License: GPL-3 if [ "$1" = "config" ]; then echo 'graph_title Humidity (Luftfeuchtigkeit)' echo 'graph_args --rigid' echo 'graph_vlabel Relative Humidity in %' echo 'graph_scale no' echo 'graph_category Weather' echo 'screen0.label Local Relative Humidity' echo 'real0.label Adapted from YAHOO! Weather' echo 'real0.draw LINE1' exit 0 fi TWC_TMP="/tmp/weather_twc_tmp" wget "http://de.weather.com/weather/local/77746?x=0&y=0" -O $TWC_TMP > /dev/null 2>&1 REAL=$(cat $TWC_TMP | grep -A2 Luftfeuchtigkeit | tail -n 1 | cut -d '>' -f 2 | cut -d'%' -f1) STATE_R="/tmp/humidity_r" echo $REAL > $STATE_R BASE="/media/owfs" SENSOR_0="26.E67023010000" STATE_0="/tmp/humidity_0" if test -d ${BASE}/$SENSOR_0 then SCREEN_0=$(cat ${BASE}/$SENSOR_0/humidity ; echo) echo $SCREEN_0 > $STATE_0 echo screen0.value $SCREEN_0 fi echo real0.value $REAL