Files
homelab-monitoring/scripts/check-services.sh
PVE Monitoring System 491706ffef 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.
2026-01-07 17:37:03 +08:00

19 lines
813 B
Bash
Executable File

#!/bin/bash
# Check critical service HTTP endpoints
set -euo pipefail
SEND_NTFY="/usr/local/bin/send-ntfy.sh"
# Only 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")
if [ "$CLOUDREVE_CHECK" = "200" ]; then
logger -t service-monitor "CloudReve: OK (HTTP 200)"
elif [ "$CLOUDREVE_CHECK" = "FAILED" ]; then
$SEND_NTFY critical "CloudReve Down" "🔴 CRITICAL: CloudReve (CT 209) is not responding on port 5212" "skull,error,globe_with_meridians"
else
$SEND_NTFY warning "CloudReve Issue" "🟡 WARNING: CloudReve returned HTTP $CLOUDREVE_CHECK (expected 200)" "warning,globe_with_meridians"
fi
logger -t service-monitor "Service health check completed"