diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2011-09-07 13:55:53 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2011-09-07 13:55:53 +0200 |
commit | 276c5b98bf619eabd8b0bd5fc3ff60c0a59489a7 (patch) | |
tree | fb55ae9e259321d7256affcef2791b2cd3bb64a8 /plugins-scripts/check_sensors.sh | |
parent | f917244ab55917094bfe3bead0e905baad385821 (diff) | |
download | monitoring-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-x | plugins-scripts/check_sensors.sh | 11 |
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@" | |||
10 | 10 | ||
11 | 11 | ||
12 | print_usage() { | 12 | print_usage() { |
13 | echo "Usage: $PROGNAME" | 13 | echo "Usage: $PROGNAME" [--ignore-fault] |
14 | } | 14 | } |
15 | 15 | ||
16 | print_help() { | 16 | print_help() { |
@@ -57,9 +57,12 @@ case "$1" in | |||
57 | if echo ${sensordata} | egrep ALARM > /dev/null; then | 57 | if echo ${sensordata} | egrep ALARM > /dev/null; then |
58 | echo SENSOR CRITICAL - Sensor alarm detected! | 58 | echo SENSOR CRITICAL - Sensor alarm detected! |
59 | exit 2 | 59 | exit 2 |
60 | else | 60 | elif echo ${sensordata} | egrep FAULT > /dev/null \ |
61 | echo sensor ok | 61 | && test "$1" != "-i" -a "$1" != "--ignore-fault"; then |
62 | exit 0 | 62 | echo SENSOR UNKNOWN - Sensor reported fault |
63 | exit 3 | ||
63 | fi | 64 | fi |
65 | echo sensor ok | ||
66 | exit 0 | ||
64 | ;; | 67 | ;; |
65 | esac | 68 | esac |