From cdfe1fe7ac8a9250a2fb089e93c54a04e08df972 Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Sun, 24 Aug 2025 07:56:04 +0000 Subject: [PATCH] fix: VM disk usage not showing when QEMU Guest Agent is enabled The agent field in Proxmox can have values other than just 0 or 1 when features are enabled, causing the strict equality check (== 1) to fail. Changed to check for any value > 0 to properly detect when the agent is enabled. addresses discussion #344 --- internal/monitoring/monitor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.go index 178e69cff..cda7543a2 100644 --- a/internal/monitoring/monitor.go +++ b/internal/monitoring/monitor.go @@ -936,7 +936,7 @@ func (m *Monitor) pollVMsAndContainersEfficient(ctx context.Context, instanceNam if res.Status == "running" { // First check if agent is enabled by getting VM status vmStatus, err := client.GetVMStatus(ctx, res.Node, res.VMID) - if err == nil && vmStatus != nil && vmStatus.Agent == 1 { + if err == nil && vmStatus != nil && vmStatus.Agent > 0 { log.Debug(). Str("instance", instanceName). Str("vm", res.Name). @@ -1238,7 +1238,7 @@ func (m *Monitor) pollVMsWithNodes(ctx context.Context, instanceName string, cli diskUsage := safePercentage(float64(diskUsed), float64(diskTotal)) // If VM has guest agent enabled and is running, try to get filesystem info - if vm.Agent == 1 && vm.Status == "running" { + if vm.Agent > 0 && vm.Status == "running" { log.Debug(). Str("instance", instanceName). Str("vm", vm.Name).