monitor: CT 101 pve-pp-2 als expected_stopped — kein Alarm für Standby-Container

This commit is contained in:
root 2026-03-11 14:38:48 +07:00
parent 4882e5608d
commit 301fc507cb

View file

@ -36,6 +36,13 @@ def _get_passwords(cfg):
CRITICAL_CONTAINERS = [101, 109, 111, 112, 113, 115] CRITICAL_CONTAINERS = [101, 109, 111, 112, 113, 115]
EXPECTED_STOPPED = {
(101, "pve-pp-2"), # yt-desktop-standby — Reserve, absichtlich gestoppt
(504, "pve-ka-2"), # Shop-Template — stopped
(8000, "pve-ka-2"), # Kunde0-Shop — stopped
(8010, "pve-ka-2"), # Kunde1-Shop — stopped
}
IGNORED_HOSTS = {"${HOSTNAME}", ""} IGNORED_HOSTS = {"${HOSTNAME}", ""}
@ -53,7 +60,9 @@ def check_all() -> list[str]:
vmid = ct.get("vmid", 0) vmid = ct.get("vmid", 0)
name = ct.get("name", "?") name = ct.get("name", "?")
status = ct.get("status", "unknown") status = ct.get("status", "unknown")
host = ct.get("_host", "")
if vmid in CRITICAL_CONTAINERS and status != "running": if vmid in CRITICAL_CONTAINERS and status != "running":
if (vmid, host) not in EXPECTED_STOPPED:
alerts.append(f"🔴 CT {vmid} ({name}) ist {status}!") alerts.append(f"🔴 CT {vmid} ({name}) ist {status}!")
mem = ct.get("mem", 0) mem = ct.get("mem", 0)