Differences
This shows you the differences between the selected revision and the current version of the page.
howto:smartd_email | howto:smartd_email 2017/09/06 18:38 current | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | [[howto:ffp|ffp 0.5]] has the option to enable the SMART monitoring tools. | ||
+ | |||
+ | If you want to set SMART up to email you it will require some further configuration. | ||
+ | |||
+ | I have found the best solution is to use a script file that is called by the smart daemon | ||
+ | |||
+ | <file> | ||
+ | #!/ffp/bin/bash | ||
+ | # /ffp/sbin/smartd_mail.sh | ||
+ | |||
+ | SMARTMESSAGE=/ffp/tmp/msg | ||
+ | FROMADDR=email@domain.org | ||
+ | |||
+ | if [ ! -n "${SMART_DEVICETYPE+x}" ]; then | ||
+ | SMART_DEVICETYPE=marvell | ||
+ | fi | ||
+ | |||
+ | # Save the email message (STDIN) to a file: | ||
+ | cat > $SMARTMESSAGE | ||
+ | |||
+ | # Append the output of smartctl -a to the message: | ||
+ | /ffp/sbin/smartctl -a -d $SMART_DEVICETYPE $SMARTD_DEVICE >> $SMARTMESSAGE | ||
+ | |||
+ | # Now email the message to the user at address ADD: | ||
+ | /ffp/bin/mailx -s "$SMARTD_SUBJECT" -r $FROMADDR $SMARTD_ADDRESS < $SMARTMESSAGE | ||
+ | </file> | ||
+ | |||
+ | If you have a samsung drive you may need to add '-F samsung2' to smartctl line. | ||
+ | |||
+ | Then you need to modify the /ffp/etc/smartd.conf file | ||
+ | |||
+ | <file> | ||
+ | # Comment out DEVICESCAN | ||
+ | #DEVICESCAN | ||
+ | |||
+ | /dev/sda -d marvell -m myEmail@domain.org -M exec /ffp/sbin/smartd_mail.sh -M test | ||
+ | /dev/sdb -d marvell -m myEmail@domain.org -M exec /ffp/sbin/smartd_mail.sh -M test | ||
+ | </file> | ||
+ | |||