From 3c8ab0cdc2ec240fd453b095e77a5e857add8997 Mon Sep 17 00:00:00 2001 From: Elyrith Date: Thu, 29 Nov 2012 17:18:40 -0500 Subject: [PATCH] Added PERFDATA to put Nagios Performance Data when viewing service details. --- check_temp.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/check_temp.sh b/check_temp.sh index 5634793..0a6dce6 100755 --- a/check_temp.sh +++ b/check_temp.sh @@ -215,21 +215,24 @@ ${SENSORPROG} | grep "Temp" printf "\n\n" fi +# Get performance data for Nagios "Performance Data" field +PERFDATA=`${SENSORPROG} | grep "$sensor"` + # And finally check the temperature against our thresholds if [[ "$TEMP" -gt "$thresh_crit" ]]; then # Temperature is above critical threshold - echo "$sensor CRITICAL - Temperature is $TEMP" + echo "$sensor CRITICAL - Temperature is $TEMP | $PERFDATA" exit $STATE_CRITICAL elif [[ "$TEMP" -gt "$thresh_warn" ]]; then # Temperature is above warning threshold - echo "$sensor WARNING - Temperature is $TEMP" + echo "$sensor WARNING - Temperature is $TEMP | $PERFDATA" exit $STATE_WARNING else # Temperature is ok - echo "$sensor OK - Temperature is $TEMP" + echo "$sensor OK - Temperature is $TEMP | $PERFDATA" exit $STATE_OK fi exit 3