monitor: CT 115/Shop-VMIDs als erwartet gestoppt unabhängig vom Proxmox-Host-Key

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.
This commit is contained in:
Homelab Cursor 2026-03-26 18:31:23 +01:00
parent e61bd7891e
commit 93aabf3fc5

View file

@ -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)