5 PROGNAME
=$
(basename "$0")
6 PROGPATH
=$
(echo "$0" |
sed -e 's,[\\/][^\\/][^\\/]*$,,')
7 REVISION
="@NP_VERSION@"
12 echo "Usage: $PROGNAME" [--ignore-fault]
16 print_revision
"$PROGNAME" "$REVISION"
20 echo "This plugin checks hardware status using the lm_sensors package."
36 print_revision
"$PROGNAME" "$REVISION"
40 print_revision
"$PROGNAME" "$REVISION"
44 sensordata
=$
(sensors
2>&1)
46 if test ${status} -eq 127; then
47 text
="SENSORS UNKNOWN - command not found (did you install lmsensors?)"
49 elif test "${status}" -ne 0; then
50 text
="WARNING - sensors returned state $status"
52 elif echo "${sensordata}" |
grep -E ALARM
> /dev
/null
; then
53 text
="SENSOR CRITICAL - Sensor alarm detected!"
55 elif echo "${sensordata}" |
grep -E FAULT
> /dev
/null \
56 && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
57 text
="SENSOR UNKNOWN - Sensor reported fault"
65 if test "$1" = "-v" -o "$1" = "--verbose"; then