From 32efeb085e1f416e4035cd0dae5f1f8cdd17434e Mon Sep 17 00:00:00 2001 From: PVE Monitoring System Date: Thu, 8 Jan 2026 16:43:46 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20Temperature=20script=20now=20correctly?= =?UTF-8?q?=20reads=20actual=20temps,=20not=20thresholds=20(was=20showing?= =?UTF-8?q?=20100=C2=B0C=20instead=20of=2070=C2=B0C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/check-temperature.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/check-temperature.sh b/scripts/check-temperature.sh index b0c851a..e6eab9c 100755 --- a/scripts/check-temperature.sh +++ b/scripts/check-temperature.sh @@ -11,12 +11,12 @@ if ! command -v sensors &>/dev/null; then exit 0 fi -# Get CPU temperature -TEMPS=$(sensors 2>/dev/null | grep -E "Core.*:.*°C" || echo "") +# Get CPU temperature - only extract the actual reading (first temperature value after colon) +TEMPS=$(sensors 2>/dev/null | grep -E 'Core.*:' | grep -oP ':\s+\+\K[0-9]+\.[0-9]+' || echo "") if [ -n "$TEMPS" ]; then - # Extract highest temperature - MAX_TEMP=$(echo "$TEMPS" | grep -oP '\+\K[0-9]+' | sort -n | tail -1) + # Extract highest temperature (rounded to integer) + MAX_TEMP=$(echo "$TEMPS" | sort -n | tail -1 | cut -d. -f1) if [ "$MAX_TEMP" -gt 90 ]; then $SEND_NTFY critical "Temperature Critical" "🔴 CRITICAL: PVE CPU temperature at ${MAX_TEMP}°C! System may shut down!" "fire,skull,thermometer"