[NIGHT] Add Headscale and Prism DB to selfcheck

This commit is contained in:
root committed 2026-11-23 21:15:24 +03:00
1 parent 1e605f4727
commit a8a2e8557f
1 file changed
+22 -1
+22 -1
View File
@@ -286,12 +286,33 @@ def check_vpn_cf():
(cf.get("ok"), cf.get("code"), host[-35:], addr[-35:]))
def check_headscale():
"""CT201 Headscale health и наличие узла pve."""
try:
d = get("http://192.168.1.201:8080/health", timeout=8, retries=2)
ok = isinstance(d, dict) and d.get("status") == "pass"
add("Headscale CT201", ok, str(d)[:120])
except Exception as e:
add("Headscale CT201", False, str(e)[:120])
def check_prism_db():
"""Prism читает model-centric базу prism_*."""
try:
d = get("http://127.0.0.1:8095/api/prism/summary", timeout=10, retries=2)
ok = isinstance(d, dict) and d.get("ok") and (d.get("models") or 0) > 0
add("Prism DB", ok, "models=%s products=%s" % (d.get("models"), d.get("products")))
except Exception as e:
add("Prism DB", False, str(e)[:120])
def main():
print("Самопроверка платформы", date.today().isoformat())
checks = [check_units, check_services, check_bots, check_matrix_sso, check_ollama,
check_n8n, check_digests, check_reports, check_registry, check_cron_dots,
check_tasks, check_approvals, check_hermes, check_errors, check_disk,
check_lvm, check_pg_conn, check_tool_gateway, check_vpn_cf]
check_lvm, check_pg_conn, check_tool_gateway, check_vpn_cf, check_headscale, check_prism_db]
for fn in checks:
try:
fn()