aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-02-09 08:03:34 +0100
committerChristian Weiske <cweiske@cweiske.de>2011-02-09 08:03:34 +0100
commit86ce4bf61aba21124eab2e405f39283e0d7fc591 (patch)
tree61bb4df83d69dfbf87a53b4b7c771c0eb581c8bf
parent786072662e6081f84dbec70375fc76ba54df9de8 (diff)
downloadusb-wde1-tools-86ce4bf61aba21124eab2e405f39283e0d7fc591.tar.gz
usb-wde1-tools-86ce4bf61aba21124eab2e405f39283e0d7fc591.zip
add support for warning/critical values
-rw-r--r--munin/README8
-rwxr-xr-xmunin/usb-wde1_20
2 files changed, 19 insertions, 9 deletions
diff --git a/munin/README b/munin/README
index f8eaf23..c0ba522 100644
--- a/munin/README
+++ b/munin/README
@@ -68,7 +68,7 @@ $ ln -s usb-wde1_ usb-wde1_humidity
$ cd ..
-Running the munin plugin is also relatively easy, and you can easily pass
-the environment configuration variables from the munin configuration
-on the cli:
-$ logfile=test.log sensors="0 1 7" ./munin/usb-wde1_temperature
+Running the munin plugin for development purposes is also relatively easy
+since you can pass the environment configuration variables
+from the munin configuration on the command line:
+$ MUNIN_LIBDIR=/usr/share/munin/ logfile=test.log sensors="0 1 7" ./munin/usb-wde1_temperature
diff --git a/munin/usb-wde1_ b/munin/usb-wde1_
index ada0e28..485432b 100755
--- a/munin/usb-wde1_
+++ b/munin/usb-wde1_
@@ -22,10 +22,13 @@ usb-wde1 - Munin plugin to report usb-wde1 temperature and humidity data
env.sensor1 Kitchen
env.sensor7 Outside
-=head1 MAGIC MARKERS
+ Warning/critical values for all sensors:
+ env.warning 10
+ env.critical 5
- #%# family=manual
- #%# capabilities=autoconf suggest
+ Warning/critical values for single sensors:
+ env.sensor7_warning 40
+ env.sensor7_critical 50
=head1 AUTHOR
@@ -36,8 +39,15 @@ Christian Weiske <cweiske@cweiske.de>
AGPL
http://www.gnu.org/licenses/agpl.html
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+ #%# capabilities=autoconf suggest
+
=cut
+. "$MUNIN_LIBDIR/plugins/plugin.sh"
+
TYPE=`basename $0 | sed 's/^.*_//g'`
if [ "$1" = "autoconf" ]; then
@@ -69,7 +79,6 @@ for i in $sensors; do
code="sensor$i=\${sensor$i:=Sensor $i}"
eval $code
done
-# FIXME: Warning/critical values
if [ "$1" = "config" ]; then
@@ -92,10 +101,11 @@ if [ "$1" = "config" ]; then
echo 'graph_scale no'
echo 'graph_category sensors'
- #FIXME: warning/critical values
for i in $sensors; do
eval "name=\$sensor$i"
echo "sensor$i.label $name"
+ print_warning "sensor$i"
+ print_critical "sensor$i"
done
exit 0