Configure Automated Tests
Under a Unix install of smartmontools there is the ability to set a daemon to run and monitor the health of the drives in your system. The default configuration is not that great, so I did some research and found a good, basic config.
In Devuan (Debian) systems, the configuration is stored in /etc/smart.conf. A very well documented configuration file, it actually only has one directive which tells the SMART daemon to scan for all drives (DEVSCAN). I tend to move that out of the way, then create my own.
Here is the basic template for the file. Note that you need one line like this for each device, as far as I can tell, so if you have two drives (sda and sdb), you'd have two lines where the only difference would be sda would become sdb.
/dev/sda -H -l error -l selftest -S on -s (L/../.././06|S/../.././18) -m root -M test
According to https://edafe.de/2024/01/monitoring-storage-devices-with-smartmontools-on-debian-or-ubuntu/ (where I stole this)
- -H: show the health status reported by the device
- -l error: show the increase in the number of smart errors since last check
- -l selftest: show the increase in the number of failed trests
- -S on: enable Attribute Autosave on startup
- -s (L/../.././06|S/../.././18): schedule tests
- L/../.././06: run a long test between 0600 and 0659 daily
- S/../.././18): run a short test between 1800 and 1859 daily
- -m root: send any warnings to root via e-mail
- -M test: send a test e-mail on every startup.
The URL above is much better, goes into more detail, and shows you how to scan for all drives, determine which have SMART capabilities, etc…