1. Install smartmontools and smart-notifier and accept all dependencies:
sudo apt-get install smartmontools smart-notifier |
2. Enable smart features on each drive. First list all the drives with:
df |
If the drives are part of a linux software raid array issue this command first:
mdadm –detail /dev/md0 |
Assuming your array is /dev/md0 or it could be any number you set. Adjust as necessary. After you get a listing of all the drives you want to monitor enter the following command for each drive:
smartctl --smart=on --offlineauto=on --saveauto=on /dev/sdb1 |
This assumes there’s drive /dev/sdb1 that you want to enable smart status on it. You can check the smart status for each drive you enabled smart status on by using this command:
smartctl --all /dev/sdb1 |
4. Edit your /etc/smartd.conf file:
sudo vi /etc/smartd.conf |
Replace the “root” entry right after the “-m” with the email address that you want the notifications to go on the “DEVICESCAN” line:
DEVICESCAN -m email_notify@yourdomain.com -M exec /usr/share/smartmontools/smartd-runner |
5. Configure smartd to start automatically. Edit the “/etc/default/smartmontools” file:
sudo vi /etc/default/smartmontools |
Uncomment the “start_smartd=yes” line and save the file.
Restart smartmontools:
sudo /etc/init.d/smartmontools restart * Restarting S.M.A.R.T. daemon smartd [ OK ] |
Ensure service is running:
ps -A |grep "smart" |
You should get a result similar to below:
1700 ? 00:00:00 smartd |
If the service fails to start, check out /var/log/messages for any errors and correct them. It’s also a good idea to reboot your machine and verifying that the “smartd” service started automatically.
Thanks to this guy for the help!
Thanks for the post. I was using this instruction – http://sysadmin.te.ua/linux/smartd.html . It has more explanation about separate smartd log files, almost all smartd.conf options and debug all smartd process (email sending, logs output,daemon startup options). Hope it helps to improve.