From 24103bf6703b0675dfa64645bcf2a321c79bd72a Mon Sep 17 00:00:00 2001 From: Milad Safdari Date: Fri, 17 Oct 2025 09:19:26 +0200 Subject: [PATCH] Refactor backup data fetching for Proxmox nodes Refactor backup data fetching to handle individual nodes and log warnings for failures. --- .../proxmox_ve/special_agent/agent_proxmox_ve.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmk/plugins/proxmox_ve/special_agent/agent_proxmox_ve.py b/cmk/plugins/proxmox_ve/special_agent/agent_proxmox_ve.py index ff71f3b8ee2..bea1a0a2c03 100755 --- a/cmk/plugins/proxmox_ve/special_agent/agent_proxmox_ve.py +++ b/cmk/plugins/proxmox_ve/special_agent/agent_proxmox_ve.py @@ -117,7 +117,17 @@ def agent_proxmox_ve_main(args: Args) -> int: ) LOGGER.info("Fetch and process backup logs..") - logged_backup_data = fetch_backup_data(args, session, data["nodes"]) + logged_backup_data = {} + + for node in data["nodes"]: + try: + node_backups = fetch_backup_data(args, session, [node]) + if not node_backups: + LOGGER.info(f"No backups found for any VMs on node {node}") + else: + logged_backup_data.update(node_backups) + except Exception as e: + LOGGER.warning(f"Could not fetch backup logs for node {node} due to: {e}") all_vms = { str(entry["vmid"]): entry