pub struct SmartDevice {Show 17 fields
pub device: String,
pub protocol: String,
pub model: String,
pub passed: Option<bool>,
pub temperature_c: Option<f32>,
pub power_on_hours: Option<u64>,
pub percentage_used: Option<u32>,
pub available_spare_percent: Option<u32>,
pub available_spare_threshold_percent: Option<u32>,
pub critical_warning: Option<u32>,
pub media_errors: Option<u64>,
pub reallocated_sectors: Option<u64>,
pub pending_sectors: Option<u64>,
pub offline_uncorrectable: Option<u64>,
pub data_written_bytes: Option<u64>,
pub collected_at_ms: Option<u64>,
pub error: Option<String>,
}Expand description
SMART health of one drive, parsed from smartctl -j -a output.
Fields a drive or protocol does not report are None (NVMe drives have
no sector reallocation counters, ATA drives no “percentage used”).
Fields§
§device: StringKernel device name ("nvme0", "sda"). See device_matches_disk.
protocol: StringProtocol reported by smartctl ("NVMe", "ATA", "SCSI").
model: StringDrive model.
passed: Option<bool>Overall health self-assessment; None if smartctl could not tell.
temperature_c: Option<f32>Current drive temperature.
power_on_hours: Option<u64>Accumulated power-on time.
percentage_used: Option<u32>NVMe wear estimate (may exceed 100).
available_spare_percent: Option<u32>NVMe spare capacity left.
available_spare_threshold_percent: Option<u32>NVMe spare threshold below which the drive reports a warning.
critical_warning: Option<u32>NVMe critical warning bit field (0 when healthy).
media_errors: Option<u64>NVMe unrecovered data integrity errors.
reallocated_sectors: Option<u64>ATA attribute 5 (Reallocated_Sector_Ct), raw value.
pending_sectors: Option<u64>ATA attribute 197 (Current_Pending_Sector), raw value.
offline_uncorrectable: Option<u64>ATA attribute 198 (Offline_Uncorrectable), raw value.
data_written_bytes: Option<u64>Total host writes, where the drive reports them.
collected_at_ms: Option<u64>When smartctl ran, in milliseconds since the Unix epoch. Lets front-ends flag stale results (e.g. the timer stopped running).
error: Option<String>Error reported by smartctl (e.g. the device could not be opened).
Implementations§
Source§impl SmartDevice
impl SmartDevice
Sourcepub fn needs_attention(&self) -> bool
pub fn needs_attention(&self) -> bool
Returns true if anything in the SMART data calls for attention.