Added PERFDATA to put Nagios Performance Data when viewing service details.

This commit is contained in:
Elyrith 2012-11-29 20:43:49 -05:00
parent 4bfcba966a
commit 4937e2a5e0

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