diff --git a/internal/monitoring/monitor_optimized.go b/internal/monitoring/monitor_optimized.go index 0d8fb3e9c..eb3ae5e3b 100644 --- a/internal/monitoring/monitor_optimized.go +++ b/internal/monitoring/monitor_optimized.go @@ -292,7 +292,10 @@ func (m *Monitor) pollVMsWithNodesOptimized(ctx context.Context, instanceName st Msg("Processing filesystem from guest agent") // Skip special filesystems and Windows System Reserved - if fs.Type == "tmpfs" || fs.Type == "devtmpfs" || + // For Windows, mountpoints are like "C:\\" or "D:\\" - don't skip those + isWindowsDrive := len(fs.Mountpoint) >= 2 && fs.Mountpoint[1] == ':' && strings.Contains(fs.Mountpoint, "\\") + + if !isWindowsDrive && (fs.Type == "tmpfs" || fs.Type == "devtmpfs" || strings.HasPrefix(fs.Mountpoint, "/dev") || strings.HasPrefix(fs.Mountpoint, "/proc") || strings.HasPrefix(fs.Mountpoint, "/sys") || @@ -300,7 +303,7 @@ func (m *Monitor) pollVMsWithNodesOptimized(ctx context.Context, instanceName st fs.Mountpoint == "/boot/efi" || fs.Mountpoint == "System Reserved" || strings.Contains(fs.Mountpoint, "System Reserved") || - strings.HasPrefix(fs.Mountpoint, "/snap") { // Skip snap mounts + strings.HasPrefix(fs.Mountpoint, "/snap")) { // Skip snap mounts log.Debug(). Str("vm", vm.Name). Str("mountpoint", fs.Mountpoint). diff --git a/pkg/proxmox/client.go b/pkg/proxmox/client.go index 8df0c2a38..3ace011c9 100644 --- a/pkg/proxmox/client.go +++ b/pkg/proxmox/client.go @@ -913,6 +913,13 @@ func (c *Client) GetVMFSInfo(ctx context.Context, node string, vmid int) ([]VMFi return nil, err } + // Log the raw response for debugging + log.Debug(). + Str("node", node). + Int("vmid", vmid). + Str("response", string(bodyBytes)). + Msg("Raw response from guest agent get-fsinfo") + // Try to unmarshal as an array first (expected format) var arrayResult struct { Data struct { @@ -961,10 +968,20 @@ func (c *Client) GetVMFSInfo(ctx context.Context, node string, vmid int) ([]VMFi } if err := json.Unmarshal(bodyBytes, &objectResult); err == nil { // If result is an object, it might be an error or empty response + // Check if it's null or an error + if objectResult.Data.Result == nil { + log.Debug(). + Str("node", node). + Int("vmid", vmid). + Msg("GetVMFSInfo received null result - guest agent may not be providing disk info") + } else { + log.Debug(). + Str("node", node). + Int("vmid", vmid). + Interface("result", objectResult.Data.Result). + Msg("GetVMFSInfo received object instead of array") + } // Return empty array to indicate no filesystem info available - log.Debug(). - Interface("result", objectResult.Data.Result). - Msg("GetVMFSInfo received object instead of array, returning empty") return []VMFileSystem{}, nil }