21 lines
1.3 KiB
Bash
Executable File
21 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
python3 <<'PY'
|
|
import subprocess, json, os
|
|
def sh(c, t=10):
|
|
try: return subprocess.check_output(c, shell=True, timeout=t).decode().strip()
|
|
except Exception as e: return f"ERR:{str(e)[:60]}"
|
|
out = {}
|
|
out["nr"] = sh("curl -sS --max-time 5 http://localhost/api/nonreg-api.php?cat=all | python3 -c \"import sys,json; d=json.load(sys.stdin); print(f'{d.get(\\\"pass\\\")}/{d.get(\\\"total\\\")}')\"")
|
|
out["git_dirty"] = sh("cd /var/www/html && git status --short | wc -l")
|
|
out["git_last"] = sh("cd /var/www/html && git log --oneline -1")
|
|
out["vault_count"] = sh("ls /opt/wevads/vault/ | wc -l")
|
|
out["wiki_count"] = sh("ls /opt/weval-l99/wiki/*.json 2>/dev/null | wc -l")
|
|
out["intents_total"] = sh("grep -c 'INTENT:' /var/www/html/api/wevia-opus-intents.php")
|
|
out["intents_top_ia"] = sh("grep -c 'INTENT: top_ia_' /var/www/html/api/wevia-opus-intents.php")
|
|
out["scripts_topia"] = sh("ls /opt/weval-ops/top-ia/*.sh 2>/dev/null | wc -l")
|
|
out["doctrines"] = sh("grep -c '^## DOCTRINE' /opt/wevads/vault/doctrines.md")
|
|
out["audit_entries"] = sh("wc -l < /var/log/weval/audit/audit.jsonl 2>/dev/null")
|
|
out["qdrant_memory"] = sh("curl -sS --max-time 3 http://localhost:6333/collections/wevia_memory_768 | python3 -c \"import sys,json; print(json.load(sys.stdin).get('result',{}).get('points_count'))\"")
|
|
print(json.dumps(out, ensure_ascii=False, indent=2))
|
|
PY
|