How to configure smartd and be notified of hard disk problems via email - LinuxConfig.org

We will talk about the smartd daemon: we will see how to schedule tests and how to configure it to so to be notified via email when an error is found on a storage device. In the course of the article I will assume the smartmontools package to be already installed. Please refer to the aforementioned article for installation instructions. This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-configure-smartd-and-be-notified-of-hard-disk-problems-via-email

I followed the guide and msmtp is working; however, email alerts from smartd aren’t working. Any advice?

Hi Discipulus,

Welcome to our forums.

Do you see any relevant error messages in the logfiles?

Have the same problem… I can use msmtp from the command line fine. So I know it is setup right with the email account I configured for its use. The /var/log/msmtp.log, only shows the successful test from the command line. It does not appear that smartd even tried to invoke msmtp. The smartd log from systemctl/journalctl shows no errors, only report successful send of mail. So where else should I look for what really happened?

Hi Nodi.Rubrum,

Welcome to our forums.

So your smartd journal shows successful mail send, does that relate to the command line test, or the mail that actually never arrived?

The smartd service reported success, but it was a false report. The mail as never generated or sent. I back-tracked the issue to the fact that mail or mailx was not sending mail to an external source as directed. I installed msmtp, and then rewrote the smartd-runner script to call msmtp correctly and with the correct parameter order that msmtp needs versus the default the smartmontools (smartd) attempts on Debian 10. Not only is smartmontools staged a bit different than other distros (different paths and different dependencies) for Debian via the package creator decision, but deviates from the common use of notification via the runner script.

Ah yes, the beauty of different distros using different paths, package names, config files, service names… The list is long and quite chaotic sometimes.