diff --git a/homelab-ai-bot/monitor.py b/homelab-ai-bot/monitor.py index ccadc766..4e19131d 100644 --- a/homelab-ai-bot/monitor.py +++ b/homelab-ai-bot/monitor.py @@ -59,6 +59,10 @@ EXPECTED_STOPPED = { (8010, "pve-ka-2"), # Kunde1-Shop — stopped } +# VMIDs, die auf jedem Proxmox-Host in CONFIG ok sind, solange status == stopped +# (115 erscheint je nach API-Zuordnung auch als pve-hetzner o.ä., nicht nur ka-1/ka-3) +EXPECTED_STOPPED_VMIDS = {115, 504, 8000, 8010} + IGNORED_HOSTS = {"${HOSTNAME}", ""} SILENCE_IGNORED_HOSTS = { @@ -84,7 +88,8 @@ def check_all() -> list[str]: status = ct.get("status", "unknown") host = ct.get("_host", "") if vmid in CRITICAL_CONTAINERS and status != "running": - if (vmid, host) not in EXPECTED_STOPPED: + ok_stopped = vmid in EXPECTED_STOPPED_VMIDS and status == "stopped" + if (vmid, host) not in EXPECTED_STOPPED and not ok_stopped: alerts.append(f"🔴 CT {vmid} ({name}) ist {status}!") mem = ct.get("mem", 0)