[HOME] Закрыты замечания: 1) watchdog — softdog загружен, systemd держит /dev/watchdog0 (fd 13 у PID1). 2) hub-db-dumps — падал IsADirectoryError на каталоге pre-update-20261028, исправлено isfile(), прогон ok=35 ошибок 0, свежие дампы есть. 3) метрики сертификатов — psql висел без пароля, сбросил пароль buryan_monitor в /root/.pg-monitor-pass, скрипт берёт PGPASSWORD и -w; 14 доменов, 0 тревог. 4) автостарт CT — pve-guests замаскирован намеренно, работает hub-boot-recover (30/33). 5) дыра в журнале 27.10-13.11 — журнал сейчас PASS и пишет. 6) мониторы снова активны

This commit is contained in:
root committed 2026-11-13 12:58:22 +03:00
1 parent 40649cdbca
commit 95a81d2b2a
3 files changed
+228 -2

No files matched your search

+17 -2
View File
@@ -146,8 +146,23 @@ def save_metrics(rows):
sql = ("INSERT INTO cert_metrics (domain, days_left, subject) "
f"VALUES {values}")
try:
subprocess.run(["psql", "-h", PG_HOST, "-U", PG_USER, "-d", PG_DB, "-c", sql],
capture_output=True, text=True, timeout=30)
# Пароль берём из файла и передаём через PGPASSWORD: иначе psql
# уходит в приглашение пароля и висит до таймаута (молча теряя метрики).
import os as _os
env = dict(_os.environ)
for cand in ("/root/.pg-monitor-pass", "/root/.pg-superuser-pass"):
if _os.path.exists(cand):
try:
env["PGPASSWORD"] = open(cand, encoding="utf-8").read().strip()
except Exception:
pass
break
r = subprocess.run(["psql", "-w", "-h", PG_HOST, "-U", PG_USER, "-d", PG_DB, "-c", sql],
capture_output=True, text=True, timeout=30, env=env)
if r.returncode != 0:
print(f"не удалось записать замеры: {r.stderr.strip()[:160]}", file=sys.stderr)
except Exception as exc:
print(f"не удалось записать замеры: {exc}", file=sys.stderr)
except Exception as exc:
print(f"не удалось записать замеры: {exc}", file=sys.stderr)