Merged in elyrith/check_gputemp (pull request #1)

This commit is contained in:
Jack-Benny Persson 2012-11-30 03:20:39 +01:00
commit d73db26ece
2 changed files with 6 additions and 4 deletions

2
README
View File

@ -15,5 +15,5 @@ This plugin is based on check_temp which I wrote earlier this year. The code is
almost identical to it. Many thanks to Chad Columbus who sent me almost identical to it. Many thanks to Chad Columbus who sent me
bugfixes and corrections for check_temp. Without check_temp their would never bugfixes and corrections for check_temp. Without check_temp their would never
have been check_gputemp. have been check_gputemp.
The plugin were submitted to Nagios Exchange in january 2012. This plugin was submitted to Nagios Exchange in January 2012.

View File

@ -216,21 +216,23 @@ ${SENSORPROG} --adapter=${adapter} --od-gettemperature | grep "Temperature"
printf "\n\n" printf "\n\n"
fi fi
# Get performance data for Nagios "Performance Data" field
PERFDATA=`${SENSORPROG} --adapter=${adapter} --od-gettemperature | grep "Temperature"`
# And finally check the temperature against our thresholds # And finally check the temperature against our thresholds
if [[ "$TEMP" -gt "$thresh_crit" ]]; then if [[ "$TEMP" -gt "$thresh_crit" ]]; then
# Temperature is above critical threshold # Temperature is above critical threshold
echo "GPU $adapter CRITICAL - Temperature is $TEMP" echo "GPU $adapter CRITICAL - Temperature is $TEMP | $PERFDATA"
exit $STATE_CRITICAL exit $STATE_CRITICAL
elif [[ "$TEMP" -gt "$thresh_warn" ]]; then elif [[ "$TEMP" -gt "$thresh_warn" ]]; then
# Temperature is above warning threshold # Temperature is above warning threshold
echo "GPU $adapter WARNING - Temperature is $TEMP" echo "GPU $adapter WARNING - Temperature is $TEMP | $PERFDATA"
exit $STATE_WARNING exit $STATE_WARNING
else else
# Temperature is ok # Temperature is ok
echo "GPU $adapter OK - Temperature is $TEMP" echo "GPU $adapter OK - Temperature is $TEMP | $PERFDATA"
exit $STATE_OK exit $STATE_OK
fi fi
exit 3 exit 3