Enhance disk collector with individual drive health monitoring

- Add StoragePool and DriveInfo structures for grouping drives by mount point
- Implement SMART data collection for individual drives (health, temperature, wear)
- Support for ext4, zfs, xfs, mergerfs, btrfs filesystem types
- Generate individual drive metrics: disk_[pool]_[drive]_health/temperature/wear
- Add storage_type and underlying_devices to filesystem configuration
- Move hardcoded service directory mappings to NixOS configuration
- Move hardcoded host-to-user mapping to NixOS configuration
- Remove all unused code and fix compilation warnings
- Clean implementation with zero warnings and no dead code

Individual drives now show health status per storage pool:
Storage root (ext4): nvme0n1 PASSED 42°C 5% wear
Storage steampool (mergerfs): sda/sdb/sdc with individual health data
This commit is contained in:
2025-10-22 19:59:25 +02:00
parent a6c2983f65
commit 08d3454683
4 changed files with 332 additions and 433 deletions

View File

@@ -82,8 +82,10 @@ pub struct FilesystemConfig {
pub name: String,
pub uuid: String,
pub mount_point: String,
pub fs_type: String,
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"]
}
@@ -96,6 +98,8 @@ pub struct SystemdConfig {
pub excluded_services: Vec<String>,
pub memory_warning_mb: f32,
pub memory_critical_mb: f32,
pub service_directories: std::collections::HashMap<String, Vec<String>>,
pub host_user_mapping: String,
}
/// SMART collector configuration