Fix lsblk parsing for filesystem discovery
All checks were successful
Build and Release / build-and-release (push) Successful in 1m9s

Remove unused debug code and fix device name parsing to properly
handle lsblk tree characters. This resolves the issue where only
/boot filesystem was discovered instead of both /boot and /.
This commit is contained in:
2025-11-23 16:09:48 +01:00
parent 07422cd0a7
commit 006f27f7d9
5 changed files with 7 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "cm-dashboard-agent"
version = "0.1.115"
version = "0.1.116"
edition = "2021"
[dependencies]

View File

@@ -119,10 +119,7 @@ impl DiskCollector {
let parts: Vec<&str> = line.split_whitespace().collect();
if parts.len() >= 2 {
let device_name = parts[0]
.trim_start_matches('├')
.trim_start_matches('└')
.trim_start_matches('─')
.trim();
.trim_start_matches(&['├', '└', '─', ' '][..]);
let mount_point = parts[1];
// Skip unwanted mount points
@@ -665,11 +662,6 @@ impl DiskCollector {
});
// Individual filesystem metrics
debug!("Drive {} has {} filesystems", drive_name, drive.filesystems.len());
for filesystem in &drive.filesystems {
debug!("Filesystem {}: {} bytes used / {} bytes total",
filesystem.mount_point, filesystem.used_bytes, filesystem.total_bytes);
}
for filesystem in &drive.filesystems {
let fs_name = if filesystem.mount_point == "/" {
"root".to_string()