Fix: Home Assistant monitoring now uses HomeAssistant hostname

This commit is contained in:
PVE Monitoring System
2026-01-07 17:47:00 +08:00
parent 491706ffef
commit d0e92d3bb8

View File

@@ -4,7 +4,18 @@ set -euo pipefail
SEND_NTFY="/usr/local/bin/send-ntfy.sh" SEND_NTFY="/usr/local/bin/send-ntfy.sh"
# Only check CloudReve from inside its container (more reliable) # Check Home Assistant (using correct hostname)
HA_CHECK=$(curl -s -o /dev/null -w "%{http_code}" --connect-timeout 10 http://HomeAssistant:8123 2>/dev/null || echo "FAILED")
if [ "$HA_CHECK" = "200" ]; then
logger -t service-monitor "Home Assistant: OK (HTTP 200)"
elif [ "$HA_CHECK" = "FAILED" ]; then
$SEND_NTFY critical "Home Assistant Down" "🔴 CRITICAL: Home Assistant is not responding at http://HomeAssistant:8123" "skull,error,globe_with_meridians"
else
$SEND_NTFY warning "Home Assistant Issue" "🟡 WARNING: Home Assistant returned HTTP $HA_CHECK (expected 200)" "warning,globe_with_meridians"
fi
# Check CloudReve from inside its container (more reliable)
CLOUDREVE_CHECK=$(pct exec 209 -- curl -s -o /dev/null -w "%{http_code}" http://localhost:5212 --max-time 5 2>/dev/null || echo "FAILED") CLOUDREVE_CHECK=$(pct exec 209 -- curl -s -o /dev/null -w "%{http_code}" http://localhost:5212 --max-time 5 2>/dev/null || echo "FAILED")
if [ "$CLOUDREVE_CHECK" = "200" ]; then if [ "$CLOUDREVE_CHECK" = "200" ]; then