# Alert when a SMART counter moves, not when it says PASSED

the hard drive in my NAS says `PASSED` with 2,184 reported uncorrectable errors on it. an alert on the overall status would never fire, and an alert on "187 > 0" would fire forever. so my status page alerts when a counter moves off the value it had when I decided to keep the disk.

the baselines, keyed by model so a disk that comes back as `sdc` instead of `sdb` keeps its history:

| Disk | Baseline |
|---|---|
| Seagate ST9320423AS | 5=26, 187=2184, 197=0, 198=0 |
| KLEVV SSD | 197=0, 198=0 (no attribute 5) |

any change is critical and goes in the alert card. so is a failed long self-test. a long test older than 90 days is a warning on the server line.

it reads every disk with:

```bash
smartctl -n standby -i -A -l selftest /dev/sdb
```

`-n standby` skips a disk that's asleep instead of spinning it up for a status page. the last reading is kept in a cache file and shown with its date, so a sleeping disk shows its last numbers and how old they are, not a blank.

the rule from the disk test still stands: the Seagate holds second copies only. this just tells me when that disk's history starts moving again.

---

see also: [SMART said PASSED with 2,184 errors](/articles/smart-passed-2184), [a monitoring key that can only run one script](/articles/monitoring-key-one-script)
