File performance.patch of Package monitoring-plugins-temp

diff -u check_temp-0.94/check_temp.sh check_temp-0.94_perf/check_temp.sh
--- check_temp-0.94/check_temp.sh	2014-09-20 10:47:26.000000000 +0200
+++ check_temp-0.94_perf/check_temp.sh	2019-04-16 13:21:29.222167332 +0200
@@ -228,8 +228,10 @@
 fi
 
 # Get performance data for Nagios "Performance Data" field
-PERFDATA=`${SENSORPROG} | grep "$sensor" | head -n1`
+#PERFDATA=`${SENSORPROG} | grep "$sensor" | head -n1`
+PERFDATA=`${SENSORPROG} -Au |sed "/^[^:]\+$/d;/_\(max\|crit\|crit_alarm\):/d;s/^ *\(.\+\): \(.\+\)$/\1=\2/" | tr '\n' ' '`
 
+PERFDATA2="$sensor=${TEMP};$thresh_warn;$thresh_crit"
 
 # And finally check the temperature against our thresholds
 if [[ "$TEMP" != +([0-9]) ]]; then
@@ -239,17 +241,17 @@
 	
   elif [[ "$TEMP" -gt "$thresh_crit" ]]; then
 	# Temperature is above critical threshold
-	echo "$sensor CRITICAL - Temperature is $TEMP | $PERFDATA"
+	echo "$sensor CRITICAL - Temperature is $TEMP | $PERFDATA2 $PERFDATA"
 	exit $STATE_CRITICAL
 
   elif [[ "$TEMP" -gt "$thresh_warn" ]]; then
 	# Temperature is above warning threshold
-	echo "$sensor WARNING - Temperature is $TEMP | $PERFDATA"
+	echo "$sensor WARNING - Temperature is $TEMP | $PERFDATA2 $PERFDATA"
 	exit $STATE_WARNING
 
   else
 	# Temperature is ok
-	echo "$sensor OK - Temperature is $TEMP | $PERFDATA"
+	echo "$sensor OK - Temperature is $TEMP | $PERFDATA2 $PERFDATA"
 	exit $STATE_OK
 fi
openSUSE Build Service is sponsored by