summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts/t')
0 files changed, 0 insertions, 0 deletions
diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh
index 660b721..ffaa974 100755
--- a/plugins-scripts/check_sensors.sh
+++ b/plugins-scripts/check_sensors.sh
@@ -21,25 +21,25 @@ print_help() {
21 echo "This plugin checks hardware status using the lm_sensors package." 21 echo "This plugin checks hardware status using the lm_sensors package."
22 echo "" 22 echo ""
23 support 23 support
24 exit 0 24 exit $STATE_OK
25} 25}
26 26
27case "$1" in 27case "$1" in
28 --help) 28 --help)
29 print_help 29 print_help
30 exit 0 30 exit $STATE_OK
31 ;; 31 ;;
32 -h) 32 -h)
33 print_help 33 print_help
34 exit 0 34 exit $STATE_OK
35 ;; 35 ;;
36 --version) 36 --version)
37 print_revision $PROGNAME $REVISION 37 print_revision $PROGNAME $REVISION
38 exit 0 38 exit $STATE_OK
39 ;; 39 ;;
40 -V) 40 -V)
41 print_revision $PROGNAME $REVISION 41 print_revision $PROGNAME $REVISION
42 exit 0 42 exit $STATE_OK
43 ;; 43 ;;
44 *) 44 *)
45 sensordata=`sensors 2>&1` 45 sensordata=`sensors 2>&1`
@@ -49,20 +49,20 @@ case "$1" in
49 fi 49 fi
50 if test ${status} -eq 127; then 50 if test ${status} -eq 127; then
51 echo "SENSORS UNKNOWN - command not found (did you install lmsensors?)" 51 echo "SENSORS UNKNOWN - command not found (did you install lmsensors?)"
52 exit -1 52 exit $STATE_UNKNOWN
53 elif test ${status} -ne 0; then 53 elif test ${status} -ne 0; then
54 echo "WARNING - sensors returned state $status" 54 echo "WARNING - sensors returned state $status"
55 exit 1 55 exit $STATE_WARNING
56 fi 56 fi
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 $STATE_CRITICAL
60 elif echo ${sensordata} | egrep FAULT > /dev/null \ 60 elif echo ${sensordata} | egrep FAULT > /dev/null \
61 && test "$1" != "-i" -a "$1" != "--ignore-fault"; then 61 && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
62 echo SENSOR UNKNOWN - Sensor reported fault 62 echo SENSOR UNKNOWN - Sensor reported fault
63 exit 3 63 exit $STATE_UNKNOWN
64 fi 64 fi
65 echo sensor ok 65 echo sensor ok
66 exit 0 66 exit $STATE_OK
67 ;; 67 ;;
68esac 68esac