Health Monitoring & Alerts
Continuous infrastructure health monitoring detects container stalls, network degradation, and disk storage exhaustion before they cause customer-facing downtime.
🔍 Automated Cron Health Check (check-health.sh)
A dedicated bash monitoring script runs every 5 minutes via root crontab:
*/5 * * * * /opt/vps-stack/scripts/check-health.sh > /dev/null 2>&1Health Inspection Rules
- Container Liveness Check:
Iterates through critical containers (
vps-proxy,supabase-db,supabase-kong,supabase-auth,supabase-edge-runtime,vps-deployer,php-app). If any container has anexited,restarting, orunhealthystate, it attempts an automatic restart and sends an alert. - Disk Capacity Threshold (> 85%):
Checks host root mount
/dev/sda1. If disk utilization exceeds 85%, it sends an urgent warning card to Google Chat detailing free space and inode exhaustion. - Memory & Swap Saturation (> 90%): Monitors RAM consumption. If swap usage is actively climbing, warns of potential Out-Of-Memory (OOM) risk.
🖥️ Live Diagnostic Commands
1. View Container Health & Uptime
cd /opt/vps-stackdocker compose ps
# Inspect container memory and CPU utilization in real timedocker stats --no-stream2. Disk Space & Inode Inspection
# Check filesystem utilizationdf -h /
# Check Docker volume disk usagedocker system df -v3. Check Webhook & Service Ingress
# Verify Nginx statusdocker logs --tail 50 vps-proxy
# Verify Kong API Gateway healthcurl -I http://127.0.0.1:8000/rest/v1/
# Test Deployer responsivenesscurl -I http://127.0.0.1:9000/