aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-02-06 12:39:19 +0100
committerChristian Weiske <cweiske@cweiske.de>2011-02-06 12:39:19 +0100
commit35c70aad5a0b5a43d82ff58892df20ccbbfd735a (patch)
tree9819aa414c1a78233ae6290c46b822c08dc98f79
parent2aaf2344d41acb7fc93b123c72f9b33ff30a13dc (diff)
downloadusb-wde1-tools-35c70aad5a0b5a43d82ff58892df20ccbbfd735a.tar.gz
usb-wde1-tools-35c70aad5a0b5a43d82ff58892df20ccbbfd735a.zip
munin plugin config
-rwxr-xr-xmunin/usb-wde1.sh31
1 files changed, 27 insertions, 4 deletions
diff --git a/munin/usb-wde1.sh b/munin/usb-wde1.sh
index 7052112..388a9b4 100755
--- a/munin/usb-wde1.sh
+++ b/munin/usb-wde1.sh
@@ -13,6 +13,7 @@ usb-wde1 - Munin plugin to report usb-wde1 temperature and humidity data
[usb-wde1]
env.logfile /var/log/usb-wde1.log
+ env.host_name House
env.sensor0 Living room
env.sensor1 Kitchen
@@ -23,11 +24,11 @@ usb-wde1 - Munin plugin to report usb-wde1 temperature and humidity data
=cut
-# suggest, config
# params:
# - logfile
# - sensor names
-# - type (temperature / humidity
+# - type (temperature / humidity)
+# - hostname
if [ "$1" = "autoconf" ]; then
if [ -r "$logfile" ]; then
@@ -36,10 +37,32 @@ if [ "$1" = "autoconf" ]; then
echo "no (Logfile \"$logfile\" does not exist)"
fi
exit 0
-fi
-if [ "$1" = "suggest" ]; then
+elif [ "$1" = "suggest" ]; then
echo temperature
echo humidity
exit 0
fi
+
+
+#load variables
+TYPE=`basename $0 | sed 's/^.*_//g'`
+
+
+if [ "$1" = "config" ]; then
+ if [ "$host_name" != "" ]; then
+ echo "host_name $host_name"
+ fi
+ if [ "$TYPE" = "temperature" ]; then
+ echo 'graph_title Temperature'
+ echo 'graph_args --base 1000 --lower-limit -30 --upper-limit 60'
+ echo 'graph_vlabel Temperature'
+ else
+ echo 'graph_title Humidity'
+ echo 'graph_args --base 1000 --lower-limit 0 --upper-limit 100'
+ echo 'graph_vlabel Humidity'
+ fi
+ echo 'graph_scale no'
+ echo 'graph_category sensors'
+ #FIXME: warning/critical values
+fi \ No newline at end of file