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
31 TYPE=`basename $0 | sed 's/^.*_//g'`
33 if [ "$1" = "autoconf" ]; then
34 if [ ! -r "$logfile" ]; then
35 echo "no (Logfile \"$logfile\" does not exist)"
36 elif [ "$TYPE" != "temperature" -a "$TYPE" != "humidity" ]; then
37 echo "no (Type \"$TYPE\" not supported, try \"./usb-wde1_ suggest\")"
43 elif [ "$1" = "suggest" ]; then
54 if [ "$sensors" = "" ]; then
55 sensors="0 1 2 3 4 5 6 7"
59 code="sensor$i=\${sensor$i:=Sensor $i}"
62 # FIXME: Warning/critical values
65 if [ "$1" = "config" ]; then
66 if [ "$host_name" != "" ]; then
67 echo "host_name $host_name"
69 if [ "$TYPE" = "temperature" ]; then
70 echo 'graph_title Temperature'
71 echo 'graph_args --base 1000 --lower-limit -30 --upper-limit 60'
72 echo 'graph_vlabel Temperature'
73 echo 'graph_info Shows the temperature of different thermometers'
75 echo 'graph_title Humidity'
76 echo 'graph_args --base 1000 --lower-limit 0 --upper-limit 100'
77 echo 'graph_vlabel Humidity'
78 echo 'graph_info Shows the air humidity of different thermometers (in %)'
81 echo 'graph_category sensors'
83 #FIXME: warning/critical values
85 eval "name=\$sensor$i"
86 echo "sensor$i.label $name"
95 read -r startzeichen zustand zeitstempel\
96 t0 t1 t2 t3 t4 t5 t6 t7\
97 h0 h1 h2 h3 h4 h5 h6 h7\
98 tc hc ws ns rain checksum\
102 #FIXME: check startzeichen
103 #FIXME: check timestamp
105 if [ "$TYPE" = "temperature" ]; then
112 for i in $sensors; do
113 eval "value=\$$varprefix$i"
114 value=`echo $value|sed s/,/./`
115 echo "sensor$i.value $value"