From e1fd6787ab1957dd99abaaee8c81ae2d95120c5c Mon Sep 17 00:00:00 2001 From: Ahmet Oeztuerk Date: Tue, 30 Jun 2026 11:39:59 +0200 Subject: [PATCH] check_drivesize: fix drives without assigned letters having an empty name, which resulted in perfdata only having the attribute seemingly without drive name prefix found with ai, did not test on the misbehaving system --- pkg/snclient/check_drivesize_windows.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/snclient/check_drivesize_windows.go b/pkg/snclient/check_drivesize_windows.go index c8e82e6a..860cd239 100644 --- a/pkg/snclient/check_drivesize_windows.go +++ b/pkg/snclient/check_drivesize_windows.go @@ -348,6 +348,16 @@ func (l *CheckDrivesize) setDeviceInfo(drive map[string]string) { if drive["drive_or_name"] == "" { drive["drive_or_name"] = driveOrName } + + // volumes without an assigned drive letter have empty drive["drive"] + // use the volume name or id as fallback + if drive["drive"] == "" { + if drive["name"] != "" { + drive["drive"] = drive["name"] + } else { + drive["drive"] = drive["drive_or_id"] + } + } } // gopsutil disk.Partition had an issue with Bitlocker, but a fix was upstreamed