mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-05 14:19:56 -05:00
Warning when SMART reports unreadable sectors. Parse Seagate drive hours correctly.
This commit is contained in:
parent
16070e98b3
commit
c3110f3940
7 changed files with 208 additions and 27 deletions
|
|
@ -195,22 +195,31 @@ export function NavBar() {
|
|||
if (driveTemperature && driveTemperature >= driveHighTemperature) {
|
||||
const color = driveTemperature >= driveCriticalTemperature ? highWarningColor : lowWarningColor;
|
||||
const icon = <Icon data-testid='driveTemperatureIcon' name='hdd' size='large' color={color}/>
|
||||
const link = <Link to='/admin/status'>{icon}</Link>;
|
||||
const link = <Link to='/admin/controller'>{icon}</Link>;
|
||||
driveTemperatureIcon = <Popup content={`${hotDrive}: ${driveTemperature.toFixed()}°C`} trigger={link}/>;
|
||||
}
|
||||
|
||||
// A drive's SMART self-assessment is failing — imminent drive failure.
|
||||
// Always displayed (like power); too important to hide behind a transient
|
||||
// warning in the priority chain.
|
||||
const {failingDevices, failing: driveFailing} = useDriveHealth();
|
||||
// A drive's SMART health is degraded. FAIL is an imminent failure (back
|
||||
// up now); WARN means unreadable/pending sectors are accumulating. Always
|
||||
// displayed (like power); too important to hide behind a transient warning
|
||||
// in the priority chain. Links to the Controller page, which shows the
|
||||
// SMART detail (the Status page does not).
|
||||
const {failingDevices, failing: driveFailing, warningDevices, warning: driveWarning} = useDriveHealth();
|
||||
let driveHealthIcon;
|
||||
if (driveFailing) {
|
||||
const icon = <Icon data-testid='driveHealthIcon' name='warning sign' size='large' color={highWarningColor}/>;
|
||||
const link = <Link to='/admin/status'>{icon}</Link>;
|
||||
const link = <Link to='/admin/controller'>{icon}</Link>;
|
||||
const message = failingDevices.length === 1
|
||||
? `Drive ${failingDevices[0]} is failing its SMART health check! Back up your data.`
|
||||
: `Drives failing SMART health check: ${failingDevices.join(', ')}. Back up your data.`;
|
||||
driveHealthIcon = <Popup content={message} trigger={link}/>;
|
||||
} else if (driveWarning) {
|
||||
const icon = <Icon data-testid='driveHealthIcon' name='warning sign' size='large' color={lowWarningColor}/>;
|
||||
const link = <Link to='/admin/controller'>{icon}</Link>;
|
||||
const message = warningDevices.length === 1
|
||||
? `Drive ${warningDevices[0]} has unreadable or pending sectors — check its SMART health.`
|
||||
: `Drives with unreadable or pending sectors: ${warningDevices.join(', ')}. Check their SMART health.`;
|
||||
driveHealthIcon = <Popup content={message} trigger={link}/>;
|
||||
}
|
||||
|
||||
// Power issues, this is always displayed if detected.
|
||||
|
|
|
|||
|
|
@ -559,7 +559,7 @@ const formatPowerOnHours = (hours) => {
|
|||
function SmartDetailsModal({drive, open, onClose}) {
|
||||
if (!drive) return null;
|
||||
|
||||
const healthColor = getHealthColor(drive.assessment);
|
||||
const healthColor = getHealthColor(drive.health || drive.assessment);
|
||||
|
||||
return (
|
||||
<Modal open={open} onClose={onClose} size='small'>
|
||||
|
|
@ -617,6 +617,14 @@ function SmartDetailsModal({drive, open, onClose}) {
|
|||
: '-'}
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
<Table.Row>
|
||||
<Table.Cell>Uncorrectable Sectors</Table.Cell>
|
||||
<Table.Cell style={{color: drive.offline_uncorrectable > 0 ? 'orange' : 'inherit'}}>
|
||||
{drive.offline_uncorrectable !== null && drive.offline_uncorrectable !== undefined
|
||||
? drive.offline_uncorrectable
|
||||
: '-'}
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
<Table.Row>
|
||||
<Table.Cell>SMART Enabled</Table.Cell>
|
||||
<Table.Cell>{drive.smart_enabled ? 'Yes' : 'No'}</Table.Cell>
|
||||
|
|
@ -1065,9 +1073,9 @@ function DiskSection() {
|
|||
<Table.Cell>
|
||||
<Icon
|
||||
name='circle'
|
||||
color={getHealthColor(drive.assessment)}
|
||||
color={getHealthColor(drive.health || drive.assessment)}
|
||||
/>
|
||||
{drive.assessment || 'Unknown'}
|
||||
{drive.health || drive.assessment || 'Unknown'}
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
{drive.temperature !== null && drive.temperature !== undefined
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue