Skip to content

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>&1

Health Inspection Rules

  1. 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 an exited, restarting, or unhealthy state, it attempts an automatic restart and sends an alert.
  2. 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.
  3. 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

Terminal window
cd /opt/vps-stack
docker compose ps
# Inspect container memory and CPU utilization in real time
docker stats --no-stream

2. Disk Space & Inode Inspection

Terminal window
# Check filesystem utilization
df -h /
# Check Docker volume disk usage
docker system df -v

3. Check Webhook & Service Ingress

Terminal window
# Verify Nginx status
docker logs --tail 50 vps-proxy
# Verify Kong API Gateway health
curl -I http://127.0.0.1:8000/rest/v1/
# Test Deployer responsiveness
curl -I http://127.0.0.1:9000/