fix: ct-600-webcam aus Silence-Check ausgenommen (kein rsyslog)

This commit is contained in:
root 2026-03-11 21:45:58 +07:00
parent f75832d21a
commit fc07039709

View file

@ -55,6 +55,9 @@ EXPECTED_STOPPED = {
IGNORED_HOSTS = {"${HOSTNAME}", ""}
# Hosts die strukturell keine regelmäßigen Logs produzieren → kein Silence-Alert
SILENCE_IGNORED_HOSTS = {"ct-600-webcam"}
def check_all() -> list[str]:
"""Regelbasierter Check (Stufe 1). Gibt Liste von Alarmen zurück."""
@ -104,7 +107,9 @@ def check_all() -> list[str]:
silent = loki_client.check_silence(minutes=35)
if silent and "error" not in silent[0]:
names = [s["host"] for s in silent if s.get("host") not in IGNORED_HOSTS]
names = [s["host"] for s in silent
if s.get("host") not in IGNORED_HOSTS
and s.get("host") not in SILENCE_IGNORED_HOSTS]
if names:
alerts.append(f"⚠️ Keine Logs seit 35+ Min: {', '.join(names)}")