From 93aabf3fc544c89447ff244eb1432512c12ee963 Mon Sep 17 00:00:00 2001 From: Homelab Cursor Date: Thu, 26 Mar 2026 18:31:23 +0100 Subject: [PATCH] =?UTF-8?q?monitor:=20CT=20115/Shop-VMIDs=20als=20erwartet?= =?UTF-8?q?=20gestoppt=20unabh=C3=A4ngig=20vom=20Proxmox-Host-Key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Die API setzt _host je nach homelab.conf (z.B. pve-hetzner); (115,pve-ka-1) griff dann nicht. Erwartete stopped-VMIDs jetzt host-unabhängig bei status stopped. --- homelab-ai-bot/monitor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)