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
This commit is contained in:
Pulse Monitor
2025-08-24 07:56:04 +00:00
parent ffc6c2f931
commit cdfe1fe7ac
+2 -2
View File
@@ -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).