Monitor S.M.A.R.T. Status on macOS Home Server

with smartmontools

Install smartmontools with Homebrew:

$ brew install smartmontools

Edit smartd.conf, comment out everything and add your configs, example:

/dev/disk0 -R 5! -m [email protected]
/dev/disk1 -R 5! -m [email protected]

Which means monitor disk0 and disk1, send an email to [email protected] when any error occurs or when "Reallocated Sector Count" changes. Note that DEVICESCAN doesn't work on my Hackintosh. Make sure you test smartd in debug mode before deploying. Look up the documentation for details.

Add a plist file org.smartmontools.smartd.plist to /Library/LaunchDaemons with content to launch smartd on startup:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

The default interval is 30 minutes, it can be changed with -i option.

You'll receive an email from [user]@[hostname].localdomain if there's an error.

P.S. macOS does not support diagnosing external drives with S.M.A.R.T. technology. A driver is needed for external drives.