don't return 0 with UNKOWN

This commit is contained in:
Jan Wagner 2011-09-07 09:08:26 +00:00
parent 833e0160a4
commit d91bc94fc4

View file

@ -6,7 +6,7 @@
@DPATCH@ @DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-plugins-1.4.15~/plugins-scripts/check_sensors.sh nagios-plugins-1.4.15/plugins-scripts/check_sensors.sh diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-plugins-1.4.15~/plugins-scripts/check_sensors.sh nagios-plugins-1.4.15/plugins-scripts/check_sensors.sh
--- nagios-plugins-1.4.15~/plugins-scripts/check_sensors.sh 2010-07-27 22:47:16.000000000 +0200 --- nagios-plugins-1.4.15~/plugins-scripts/check_sensors.sh 2010-07-27 22:47:16.000000000 +0200
+++ nagios-plugins-1.4.15/plugins-scripts/check_sensors.sh 2011-05-17 22:17:38.000000000 +0200 +++ nagios-plugins-1.4.15/plugins-scripts/check_sensors.sh 2011-09-07 11:05:26.000000000 +0200
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
@ -16,15 +16,16 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch'
} }
print_help() { print_help() {
@@ -57,6 +57,13 @@ @@ -57,6 +57,14 @@
if echo ${sensordata} | egrep ALARM > /dev/null; then if echo ${sensordata} | egrep ALARM > /dev/null; then
echo SENSOR CRITICAL - Sensor alarm detected! echo SENSOR CRITICAL - Sensor alarm detected!
exit 2 exit 2
+ elif echo ${sensordata} | egrep FAULT > /dev/null; then + elif echo ${sensordata} | egrep FAULT > /dev/null; then
+ echo SENSOR UNKNOWN - Sensor reported fault
+ if test "$1" != "-i" -a "$1" != "--ignore-fault"; then + if test "$1" != "-i" -a "$1" != "--ignore-fault"; then
+ echo SENSOR UNKNOWN - Sensor reported fault
+ exit 3 + exit 3
+ else + else
+ echo sensor ok
+ exit 0 + exit 0
+ fi + fi
else else