From 4937e2a5e0be4518ea4b6001861cf6b4897f6b2b Mon Sep 17 00:00:00 2001 From: Elyrith Date: Thu, 29 Nov 2012 20:43:49 -0500 Subject: [PATCH] Added PERFDATA to put Nagios Performance Data when viewing service details. --- check_gputemp.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/check_gputemp.sh b/check_gputemp.sh index 1f4f369..d92bb42 100755 --- a/check_gputemp.sh +++ b/check_gputemp.sh @@ -216,21 +216,23 @@ ${SENSORPROG} --adapter=${adapter} --od-gettemperature | grep "Temperature" printf "\n\n" 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 if [[ "$TEMP" -gt "$thresh_crit" ]]; then # Temperature is above critical threshold - echo "GPU $adapter CRITICAL - Temperature is $TEMP" + echo "GPU $adapter CRITICAL - Temperature is $TEMP | $PERFDATA" exit $STATE_CRITICAL elif [[ "$TEMP" -gt "$thresh_warn" ]]; then # Temperature is above warning threshold - echo "GPU $adapter WARNING - Temperature is $TEMP" + echo "GPU $adapter WARNING - Temperature is $TEMP | $PERFDATA" exit $STATE_WARNING else # Temperature is ok - echo "GPU $adapter OK - Temperature is $TEMP" + echo "GPU $adapter OK - Temperature is $TEMP | $PERFDATA" exit $STATE_OK fi exit 3