Summary
Port feature from upstream AnalogJ/scrutiny PR AnalogJ#835 to allow users to ignore, force status, or set custom thresholds for specific SMART attributes.
Problem
Users experience false positives from:
- Vendor-specific attributes that don't follow standard thresholds
- Old but irrelevant errors that persist on drives
- Attributes that don't apply to their specific hardware
Currently there's no way to suppress or customize how individual attributes are evaluated.
Solution
Add an attribute_overrides configuration section that allows users to:
- Ignore specific attributes (prevents false positives)
- Force status to passed/warn/failed
- Set custom thresholds (warn_above/fail_above) for attribute values
Configuration Example
smart:
attribute_overrides:
- protocol: ATA # ATA | NVMe | SCSI
attribute_id: "187" # string ID as shown in UI
wwn: "0x5000c5002df89099" # optional: limit to specific device
action: ignore # ignore | force_status
- protocol: NVMe
attribute_id: "media_errors"
action: force_status
status: passed # passed | warn | failed
- protocol: ATA
attribute_id: "5"
warn_above: 5 # warn when value exceeds
fail_above: 10 # fail when value exceeds (takes precedence)
Changes Required
Backend
New files:
webapp/backend/pkg/models/attribute_override.go - AttributeOverride struct
Files to modify:
example.scrutiny.yaml - Add attribute_overrides documentation
webapp/backend/pkg/config/config.go - Add default for smart.attribute_overrides
webapp/backend/pkg/database/scrutiny_repository_device.go - Update device status handling
webapp/backend/pkg/database/scrutiny_repository_device_smart_attributes.go - Add override logic
webapp/backend/pkg/web/handler/upload_device_metrics.go - Always persist evaluated status
webapp/backend/pkg/web/server_test.go - Update test mocks
New test file:
webapp/backend/pkg/database/scrutiny_repository_device_smart_attributes_test.go
Key Implementation Details
- Override Matching: Matches by protocol (required), attribute_id (required), and optionally WWN
- Threshold Priority:
fail_above takes precedence over warn_above when both exceeded
- Value Comparison: Uses raw values for ATA, current Value for NVMe/SCSI
- Status Rebuilding: After applying overrides, device status is rebuilt from attribute statuses
- SMART Failure Preservation: Original SMART failure flags are preserved even when attributes are ignored
Upstream Reference
Acceptance Criteria
Summary
Port feature from upstream AnalogJ/scrutiny PR AnalogJ#835 to allow users to ignore, force status, or set custom thresholds for specific SMART attributes.
Problem
Users experience false positives from:
Currently there's no way to suppress or customize how individual attributes are evaluated.
Solution
Add an
attribute_overridesconfiguration section that allows users to:Configuration Example
Changes Required
Backend
New files:
webapp/backend/pkg/models/attribute_override.go- AttributeOverride structFiles to modify:
example.scrutiny.yaml- Add attribute_overrides documentationwebapp/backend/pkg/config/config.go- Add default forsmart.attribute_overrideswebapp/backend/pkg/database/scrutiny_repository_device.go- Update device status handlingwebapp/backend/pkg/database/scrutiny_repository_device_smart_attributes.go- Add override logicwebapp/backend/pkg/web/handler/upload_device_metrics.go- Always persist evaluated statuswebapp/backend/pkg/web/server_test.go- Update test mocksNew test file:
webapp/backend/pkg/database/scrutiny_repository_device_smart_attributes_test.goKey Implementation Details
fail_abovetakes precedence overwarn_abovewhen both exceededUpstream Reference
Acceptance Criteria