diff --git a/scripts/daily-infra-report.py b/scripts/daily-infra-report.py index 54d1d92..d4ea680 100755 --- a/scripts/daily-infra-report.py +++ b/scripts/daily-infra-report.py @@ -243,7 +243,7 @@ def collect(): ("Pulse", "https://pulse.sysloggh.net"), ("Proxmox", "https://192.168.68.12:8006"), ("SearXNG", "http://192.168.68.7:8888"), - ("Firecrawl", "http://192.168.68.7:3002/health"), + ("Firecrawl", "http://192.168.68.7:3002/"), # Firecrawl serves no /health - the root is its liveness endpoint ] report["endpoints"] = [] for name, url in endpoints: @@ -389,6 +389,28 @@ def collect(): # ── HTML Dashboard ── +def classify_endpoint(code): + """Classify an endpoint probe per the fleet's probe policy. + + Codified 2026-09-14 in the monitoring contracts: ANY HTTP status proves the + service answered, so the service is ALIVE - 200/301/302/401/403/404 alike. + Only a failed CONNECTION (000 / timeout / refused) is a failed probe. A 404 + from a wrong path is not a service fault and must not render as one. + + This replaces a string comparison that was wrong in both directions + (`ep["code"] >= "400"`): it rendered 301 as red, 404 as yellow, and a real + 500 as yellow. 5xx is kept as its own "server error" signal rather than + being merged with 4xx. + """ + if not code or code == "000": + return "red", "no connection" + if code.startswith("5"): + return "yellow", "server error" + if code.startswith(("2", "3", "4")): + return "green", "alive" + return "yellow", f"unexpected {code}" + + def build_html(r): issues = [] @@ -624,7 +646,7 @@ Proxmox: {r.get('pve_probe_status', 'ok')} ({r['nodes_online']}/{r['node_count'] # ── Network Endpoints ── html += '
| Service | Status |
|---|---|
| {ep["name"]} | HTTP {ep["code"]} |