homelab-codex-ws/services/ha-diag-agent/healthcheck.sh
Oskar Kapala ab8895d28b feat(ha-diag-agent): scaffold service with HA REST client and event emitter
- new per-host service, follows node-agent pattern
- 7 new HA event types defined (routing in supervisor — Phase 5)
- HeartbeatCheck as pipeline validator (pings /api/, emits ha_websocket_dead)
- service.yaml + host configs for piha (ken) and chelsty-infra (chelsty)
- test scaffolding with aiohttp/aiosqlite mocks (15/15 passing)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 12:26:34 +02:00

13 lines
287 B
Bash
Executable file

#!/bin/sh
# Healthcheck: probe the FastAPI /health endpoint
set -e
PORT="${PORT:-8087}"
python -c "
import urllib.request, sys
try:
r = urllib.request.urlopen('http://localhost:${PORT}/health', timeout=5)
sys.exit(0 if r.status == 200 else 1)
except Exception:
sys.exit(1)
"