8 usb-wde1 - Munin plugin to report usb-wde1 temperature and humidity data
11 The plugin offers two modes: temperature and humidity graphing.
13 Symlink usb-wde1_ as "usb-wde1_temperature" and/or "usb-wde1_humidity".
15 =head2 EXAMPLE CONFIGURATION
18 env.logfile /var/log/usb-wde1.log
20 env.sensors 0 1 2 3 4 7
21 env.sensor0 Living room
27 #%# capabilities=autoconf suggest
29 =head1 AUTHOR and LICENSE
31 License: http://www.gnu.org/licenses/agpl.html AGPL
32 Author: Christian Weiske <cweiske@cweiske.de>
36 TYPE=`basename $0 | sed 's/^.*_//g'`
38 if [ "$1" = "autoconf" ]; then
39 if [ ! -r "$logfile" ]; then
40 echo "no (Logfile \"$logfile\" does not exist)"
41 elif [ "$TYPE" != "temperature" -a "$TYPE" != "humidity" ]; then
42 echo "no (Type \"$TYPE\" not supported, try \"./usb-wde1_ suggest\")"
48 elif [ "$1" = "suggest" ]; then
59 if [ "$sensors" = "" ]; then
60 sensors="0 1 2 3 4 5 6 7"
64 code="sensor$i=\${sensor$i:=Sensor $i}"
67 # FIXME: Warning/critical values
70 if [ "$1" = "config" ]; then
71 if [ "$host_name" != "" ]; then
72 echo "host_name $host_name"
74 if [ "$TYPE" = "temperature" ]; then
75 echo 'graph_title Temperature'
76 #echo 'graph_args --base 1000 --lower-limit -30 --upper-limit 60'
77 echo 'graph_args --base 1000'
78 echo 'graph_vlabel Temperature'
79 echo 'graph_info Shows the temperature of different thermometers'
81 echo 'graph_title Humidity'
82 #echo 'graph_args --base 1000 --lower-limit 0 --upper-limit 100'
83 echo 'graph_args --base 1000'
84 echo 'graph_vlabel Humidity'
85 echo 'graph_info Shows the air humidity of different thermometers (in %)'
88 echo 'graph_category sensors'
90 #FIXME: warning/critical values
92 eval "name=\$sensor$i"
93 echo "sensor$i.label $name"
99 #Beispielausgabe USB-WDE1:
100 # $1;1;;13,8;22,7;22,6;17,8;22,2;21,2;22,9;;59;35;38;49;38;40;35;;;;;;;0
101 # Doku des Formats in 92030_USB_WDE1_V1.0_UM.pdf bei elv.de verfügbar
102 # Format ist "Logview openformat"
103 # http://www.logview.info/cms/d_formatbeschreibung.phtml
109 read -r startzeichen zustand zeitstempel\
110 t0 t1 t2 t3 t4 t5 t6 t7\
111 h0 h1 h2 h3 h4 h5 h6 h7\
112 tc hc ws ns rain checksum\
116 #FIXME: check startzeichen
117 #FIXME: check timestamp
119 if [ "$TYPE" = "temperature" ]; then
126 for i in $sensors; do
127 eval "value=\$$varprefix$i"
128 value=`echo $value|sed s/,/./`
129 echo "sensor$i.value $value"