aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts/check_sensors.sh
diff options
context:
space:
mode:
authorGravatar Holger Weiss <holger@zedat.fu-berlin.de> 2011-09-07 13:55:53 +0200
committerGravatar Holger Weiss <holger@zedat.fu-berlin.de> 2011-09-07 13:55:53 +0200
commit276c5b98bf619eabd8b0bd5fc3ff60c0a59489a7 (patch)
treefb55ae9e259321d7256affcef2791b2cd3bb64a8 /plugins-scripts/check_sensors.sh
parentf917244ab55917094bfe3bead0e905baad385821 (diff)
downloadmonitoring-plugins-276c5b98bf619eabd8b0bd5fc3ff60c0a59489a7.tar.gz
check_sensors: Detect FAULT status
Return an UNKNOWN status if a faulty sensor is detected. This can be suppressed with the new "--ignore-fault" option. (Fixes Debian bug #615133, patch suggested by Jan Wagner.)
Diffstat (limited to 'plugins-scripts/check_sensors.sh')
-rwxr-xr-xplugins-scripts/check_sensors.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh
index ae80fc44..d108bcc8 100755
--- a/plugins-scripts/check_sensors.sh
+++ b/plugins-scripts/check_sensors.sh
@@ -10,7 +10,7 @@ REVISION="@NP_VERSION@"
print_usage() {
- echo "Usage: $PROGNAME"
+ echo "Usage: $PROGNAME" [--ignore-fault]
}
print_help() {
@@ -57,9 +57,12 @@ case "$1" in
if echo ${sensordata} | egrep ALARM > /dev/null; then
echo SENSOR CRITICAL - Sensor alarm detected!
exit 2
- else
- echo sensor ok
- exit 0
+ elif echo ${sensordata} | egrep FAULT > /dev/null \
+ && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
+ echo SENSOR UNKNOWN - Sensor reported fault
+ exit 3
fi
+ echo sensor ok
+ exit 0
;;
esac