Fix: Temperature script now correctly reads actual temps, not thresholds (was showing 100°C instead of 70°C)
This commit is contained in:
@@ -11,12 +11,12 @@ if ! command -v sensors &>/dev/null; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get CPU temperature
|
# Get CPU temperature - only extract the actual reading (first temperature value after colon)
|
||||||
TEMPS=$(sensors 2>/dev/null | grep -E "Core.*:.*°C" || echo "")
|
TEMPS=$(sensors 2>/dev/null | grep -E 'Core.*:' | grep -oP ':\s+\+\K[0-9]+\.[0-9]+' || echo "")
|
||||||
|
|
||||||
if [ -n "$TEMPS" ]; then
|
if [ -n "$TEMPS" ]; then
|
||||||
# Extract highest temperature
|
# Extract highest temperature (rounded to integer)
|
||||||
MAX_TEMP=$(echo "$TEMPS" | grep -oP '\+\K[0-9]+' | sort -n | tail -1)
|
MAX_TEMP=$(echo "$TEMPS" | sort -n | tail -1 | cut -d. -f1)
|
||||||
|
|
||||||
if [ "$MAX_TEMP" -gt 90 ]; then
|
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"
|
$SEND_NTFY critical "Temperature Critical" "🔴 CRITICAL: PVE CPU temperature at ${MAX_TEMP}°C! System may shut down!" "fire,skull,thermometer"
|
||||||
|
|||||||
Reference in New Issue
Block a user