[OPS] Спринт-самопроверка: selfcheck_platform.py (19 проверок) + задание Hermes каждые 6 ч; check-services: VPN-шлюз теперь предупреждение, а не провал (было 3036 ложных), проверка 89→20 с; Hermes: guard от параллельного запуска задания; реестр пересобран
This commit is contained in:
1 parent
039471b92b
commit
458ac82901
3 files changed
+101
-6
No files matched your search
@@ -152,11 +152,17 @@ def check_approvals():
|
||||
|
||||
|
||||
def check_hermes():
|
||||
"""Задания живут в Postgres (hermes.jobs); SQLite — legacy-копия."""
|
||||
act = sh("systemctl is-active hermes").strip()
|
||||
jobs = sh("grep -cE '^[a-z0-9_-]+:' %s/../hermes/jobs.yaml" % REPO).strip() \
|
||||
if os.path.exists("/opt/hermes/jobs.yaml") else "?"
|
||||
n = sh("grep -cE '^[a-z0-9_-]+:' /opt/hermes/jobs.yaml").strip()
|
||||
add("Hermes", act == "active" and n.isdigit() and int(n) >= 50, "active=%s заданий=%s" % (act, n))
|
||||
sup = open("/root/.pg-superuser-pass").read().strip()
|
||||
pg = sh("PGPASSWORD=%s psql -w -h 192.168.1.151 -U postgres -d hermes -t -A "
|
||||
"-c 'SELECT count(*) FROM jobs'" % sup).strip()
|
||||
add("Hermes", act == "active" and n.isdigit() and int(n) >= 50,
|
||||
"active=%s заданий=%s записей=%s" % (act, n, pg))
|
||||
# все задания должны иметь запись о запуске
|
||||
if pg.isdigit() and n.isdigit():
|
||||
add("Hermes: все задания запускались", int(pg) >= int(n), "записей=%s заданий=%s" % (pg, n))
|
||||
|
||||
|
||||
def check_errors():
|
||||
|
||||
Reference in new issue
Block a user