Loading...
Loading...
Executes comprehensive health checks and generates status reports for network infrastructure services. Verifies Docker containers, validates Caddy reverse proxy, checks Pi-hole DNS, confirms Cloudflare Tunnel connectivity, and validates SSL certificates. Use when verifying infrastructure status, diagnosing connectivity issues, checking service health, or troubleshooting network problems. Triggers on "check health", "infrastructure status", "is everything running", "diagnose network", "service health", or "verify SSL".
npx skill4agent add dawiddutoit/custom-claude infrastructure-health-checkcd /home/dawiddutoit/projects/network && ./scripts/health-check.shcd /home/dawiddutoit/projects/network && docker compose ps --format "table {{.Name}}\t{{.Status}}\t{{.Health}}"| Container | Status | Purpose |
|---|---|---|
| pihole | Up (healthy) | DNS + Ad blocking |
| caddy | Up | Reverse proxy |
| cloudflared | Up | Cloudflare Tunnel |
| webhook | Up | GitHub auto-deploy |
docker compose ps --filter "status=exited"
docker compose ps --filter "health=unhealthy"# Test Pi-hole
curl -sI https://pihole.temet.ai --max-time 5 | head -1
# Test Jaeger
curl -sI https://jaeger.temet.ai --max-time 5 | head -1
# Test Langfuse
curl -sI https://langfuse.temet.ai --max-time 5 | head -1HTTP/2 200HTTP/2 302docker logs caddy --tail 20 2>&1 | grep -iE "error|warn|fail"# Check Pi-hole can resolve local domains
docker exec pihole dig +short @127.0.0.1 pihole.temet.ai
# Check from host
dig @localhost pihole.temet.ai +short
# Check external DNS
dig @1.1.1.1 pihole.temet.ai +shortdocker exec pihole pihole status# Check tunnel logs for connection status
docker logs cloudflared --tail 30 2>&1 | grep -iE "connected|registered|error|failed"
# Check tunnel process is running
docker exec cloudflared pgrep -f cloudflaredRegistered tunnel connectionConnection ... registeredconnection failederror# Test webhook health endpoint locally
curl -s http://localhost:9000/hooks/health
# Test via domain (if local)
curl -sI https://webhook.temet.ai/hooks/health --max-time 5 | head -1OKHTTP/2 200for domain in pihole jaeger langfuse ha code; do
echo "=== $domain.temet.ai ==="
echo | openssl s_client -servername $domain.temet.ai \
-connect $domain.temet.ai:443 2>/dev/null | \
openssl x509 -noout -dates -issuer 2>/dev/null || echo "FAILED"
echo
donenotBefore=<date>
notAfter=<date>
issuer=C = US, O = Let's Encrypt, CN = R11# Get days until expiration
for domain in pihole jaeger langfuse; do
echo -n "$domain.temet.ai: "
echo | openssl s_client -servername $domain.temet.ai \
-connect $domain.temet.ai:443 2>/dev/null | \
openssl x509 -noout -checkend 2592000 && echo "OK (>30 days)" || echo "RENEW SOON"
done# Test that Access is intercepting (should redirect to login)
curl -sI https://pihole.temet.ai --max-time 5 | grep -E "^(HTTP|location|cf-)"HTTP/2 302HTTP/2 200source /home/dawiddutoit/projects/network/.env
curl -s "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/access/apps" \
-H "Authorization: Bearer ${CLOUDFLARE_ACCESS_API_TOKEN}" | \
python3 -c "import sys,json; apps=json.load(sys.stdin).get('result',[]); print('\n'.join([f\"{a['name']}: {a['domain']}\" for a in apps]))"========================================
Infrastructure Health Report
Generated: $(date)
========================================
DOCKER CONTAINERS
-----------------
[PASS] pihole: running (healthy)
[PASS] caddy: running
[PASS] cloudflared: running
[PASS] webhook: running
HTTPS ENDPOINTS
---------------
[PASS] pihole.temet.ai: HTTP/2 200
[PASS] jaeger.temet.ai: HTTP/2 200
[PASS] langfuse.temet.ai: HTTP/2 200
DNS RESOLUTION
--------------
[PASS] Local DNS: 192.168.68.135
[PASS] External DNS: resolving via Cloudflare
CLOUDFLARE TUNNEL
-----------------
[PASS] Tunnel: connected
WEBHOOK
-------
[PASS] Endpoint: responding
SSL CERTIFICATES
----------------
[PASS] pihole.temet.ai: valid, expires in 67 days
[PASS] jaeger.temet.ai: valid, expires in 67 days
[PASS] langfuse.temet.ai: valid, expires in 67 days
CLOUDFLARE ACCESS
-----------------
[PASS] pihole.temet.ai: protected
[PASS] jaeger.temet.ai: protected
[PASS] langfuse.temet.ai: protected
[PASS] webhook.temet.ai: bypass (public)
========================================
Overall Status: ALL CHECKS PASSED
========================================| File | Purpose |
|---|---|
| Automated health check script |
| Common issues and solutions |
| Example health check outputs |
docker compose up -d./scripts/cf-access-setup.sh setup/home/dawiddutoit/projects/network.env./scripts/health-check.sh