[Bug]: SMART attribute 198 flags WARNING on raw value alone, ignoring normalised value and drivedb absence
Welcome!
- I have read the Documentation
- I have checked the Common Issues Guide and my problem was not mentioned there.
- I have searched open and closed issues and my problem was not mentioned before.
- I have verified I am using the latest version available.
Component
Agent
Problem Description
Up front, so nobody wastes time reproducing it my way: on my hardware this does not
currently surface, because smartctl --scan classifies the drive as scsi and it never
reaches parseSmartForSata. I am reporting the logic with a real drive as a
counter-example, not a broken dashboard. If that is too speculative to act on, please
close it — no argument from me.
The check added in #2275 (shipped in v0.19.0, agent/smart.go):
if smartData.SmartStatus == "PASSED" && rawValue > 0 && (attr.ID == 5 || attr.ID == 197 || attr.ID == 198) {
smartData.SmartStatus = "WARNING"
}The goal from #2268 is right — "PASSED" really does hide developing damage, and reallocated and pending sectors are good signals. The concern is narrower: attribute 198 keyed on raw value alone, with no corroboration, on drives where smartmontools has no vendor table and is therefore only guessing what 198 means.
A concrete drive, an HPE-branded SATA SSD, firmware HPG2:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
196 Reallocated_Event_Count 0x0033 100 100 036 Pre-fail Always - 0
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 224
199 UDMA_CRC_Error_Count 0x003e 100 100 000 Old_age Always - 0
SMART overall-health self-assessment test result: PASSED
Device is: Not in smartctl database 7.5/5706Four independent reasons 224 is not a bad-sector count here:
- Normalised value 100, worst 100, threshold 0. The drive itself reports this attribute as never having degraded. A real uncorrectable count drives the normalised value down.
Device is: Not in smartctl database. With no vendor table, smartctl falls back to the generic ATA name list, where 198 is conventionallyOffline_Uncorrectable. The vendor never defined it that way — the name is an artefact of the fallback.- It is an SSD. Offline-uncorrectable describes an HDD offline surface scan.
- No corroboration. 5, 187, 196, 197 and 199 all read 0. Real uncorrectable sectors do not appear alone; they leave a trail across those counters.
Flags are 0x0010 — Old_age, offline-collected, not pre-fail — which is also not how a
drive advertises an attribute it wants you to act on.
Expected Behavior
Something that preserves #2268's intent without firing on vendor-specific counters. Options, roughly in order of how cheap they are:
- Require the normalised value to be at or below threshold (or meaningfully below 100) rather than treating any nonzero raw as a fault. That alone would exclude this drive.
- Require corroboration for 198 specifically — e.g. only warn if 5, 187 or 197 are also nonzero. 198 alone, with everything else clean, is far more often a vendor counter.
- Skip 198 when smartctl reports the drive is not in its database, since the attribute
name is then a guess.
smartctl -jexposes this. - Treat 5 and 197 (well-standardised) differently from 198 (widely reused by vendors).
Happy to open a PR for whichever of these you would accept — I have the drive to test
against, though as noted I would need to force the sat parser to exercise the path.
Steps to Reproduce
- Attach a SATA SSD that smartmontools has no drivedb entry for and that reports a nonzero raw value on attribute 198 while remaining PASSED with 100/100 normalised.
- Ensure it is parsed by
parseSmartForSata(on my host--scansays-d scsi, so it is not — see #2295 — which is why I cannot demonstrate the badge directly). - The status flips PASSED → WARNING on the strength of the raw value alone.
Environment
- Agent 0.19.0, hub 0.19.0
- Proxmox VE 9.2.10, smartctl 7.5
- Drive: MK000480GWXFF (HPE-branded SATA SSD), firmware HPG2
Source: henrygd/beszel