Fix disk collector to use dynamic device detection

- Remove underlying_devices field from FilesystemConfig
- Add device detection at startup using findmnt command
- Store detected devices in HashMap for reuse during collection
- Keep all existing functionality (StoragePool, DriveInfo, SMART data)
- Detect devices only once at initialization, not every collection cycle
- Fixes agent startup failure due to missing underlying_devices config
This commit is contained in:
2025-10-23 18:50:40 +02:00
parent 7f5949b818
commit 5134c5320a
2 changed files with 36 additions and 3 deletions

View File

@@ -86,7 +86,6 @@ pub struct FilesystemConfig {
pub fs_type: String, // "ext4", "zfs", "xfs", "mergerfs", "btrfs"
pub monitor: bool,
pub storage_type: String, // "single", "raid", "mirror", "mergerfs", "zfs"
pub underlying_devices: Vec<String>, // ["sda", "sdb", "sdc"] or ["nvme0n1"]
}