Skip to content


smartd is a daemon that monitors the Self-Monitoring, Analysis and Reporting Technology (SMART) system built into many ATA-3 and later ATA, IDE and SCSI-3 hard drives. The purpose of SMART is to monitor the reliability of the hard drive and predict drive failures, and to carry out different types of drive self-tests.


sudo apt install smartmontools


Add the following to /etc/smartmontools/smartd.conf:

DEVICESCAN -a -S on -s (S/../.././03|L/../01/./02) -W 10,50,60 -m <nomailer> -M exec /home/user/ -M test
  • -a - Equivalent to turning on all of the following Directives: '-H' to check the SMART health status, '-f' to report failures of Usage (rather than Prefail) Attributes, '-t' to track changes in both Prefailure and Usage Attributes, '-l error' to report increases in the number of ATA errors, '-l selftest' to report increases in the number of Self-Test Log errors, '-l selfteststs' to report changes of Self-Test execution status, '-C 197' to report nonzero values of the current pending sector count, and '-U 198' to report nonzero values of the offline pending sector count.
  • -S on - Enables or disables Attribute Autosave when smartd starts up and has no further effect.
  • -s - Run Self-Tests or Offline Immediate Tests, at scheduled times.
  • S/../.././03 - Runs a short test daily at 3AM.
  • L/../01/./02 - Runs a long test on the first of every month at 2AM.
  • -m <nomailer> -M exec /home/user/ - Run a shell script instead of the default mail command for alerts.
  • -M test - Test the notification script, remove after testing.

Add the following to /home/user/, replace the domain and topic:



Restart to test the alert:

chmod +x /home/user/
sudo systemctl restart smartd

Remove -M test from smartd.conf if everything works, and restart smartd again.

Last update: 2024-05-21
Created: 2024-05-21