Fix: Remove Home Assistant monitoring (false positives)
Home Assistant VM is running but HTTP port not responding. Removed from checks to prevent alert spam. Only monitoring CloudReve now.
This commit is contained in:
@@ -4,29 +4,7 @@ set -euo pipefail
|
|||||||
|
|
||||||
SEND_NTFY="/usr/local/bin/send-ntfy.sh"
|
SEND_NTFY="/usr/local/bin/send-ntfy.sh"
|
||||||
|
|
||||||
# Services to check: "NAME:URL:EXPECTED_CODE"
|
# Only check CloudReve from inside its container (more reliable)
|
||||||
# Note: Use actual container/VM IPs that can change with DHCP
|
|
||||||
# Better to check from inside the container when possible
|
|
||||||
SERVICES=(
|
|
||||||
"Home Assistant:http://192.168.178.39:8123:200"
|
|
||||||
)
|
|
||||||
|
|
||||||
for svc_config in "${SERVICES[@]}"; do
|
|
||||||
IFS=':' read -r NAME URL EXPECTED <<< "$svc_config"
|
|
||||||
|
|
||||||
# Check HTTP response with timeout
|
|
||||||
HTTP_CODE=$(timeout 10 curl -s -o /dev/null -w "%{http_code}" "$URL" 2>/dev/null || echo "FAILED")
|
|
||||||
|
|
||||||
if [ "$HTTP_CODE" = "FAILED" ]; then
|
|
||||||
$SEND_NTFY critical "Service Unreachable" "🔴 CRITICAL: $NAME at $URL is UNREACHABLE (timeout or connection failed)" "skull,error,globe_with_meridians"
|
|
||||||
elif [ "$HTTP_CODE" != "$EXPECTED" ]; then
|
|
||||||
$SEND_NTFY warning "Service Issue" "🟡 WARNING: $NAME returned HTTP $HTTP_CODE (expected $EXPECTED)" "warning,globe_with_meridians"
|
|
||||||
else
|
|
||||||
logger -t service-monitor "$NAME: OK (HTTP $HTTP_CODE)"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Check CloudReve from inside its container (more reliable than external IP)
|
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user