20

I just configured a Debian server as follows
apt-get install smartmontools
vi /etc/default/smartmontools - and here uncommented these 2 lines
# uncomment to start smartd on system startup
start_smartd=yes
# uncomment to pass additional options to smartd on startup
smartd_opts="--interval=1800"

Then I edited /etc/smartd.conf and uncommented only this line
DEVICESCAN -S on -o on -a -m myemail@mydomain.com -s (S/../.././02|L/../../6/03)

I was wondering if this is enough for the system to send me an alert message when something goes wrong and/or if there is a way to simulate a problem and see if smartd sends me warnings by email.

Alex Flo
  • 1,711
  • 3
  • 17
  • 23
  • Really you should configure the alias for `root` in /etc/aliases (if using postfix) so that any server generated emails are forwarded to your email account, not just smartd. – Geoffrey Aug 01 '18 at 01:31

1 Answers1

29

You can test the configuration by adding -M test to the line that begins with DEVICESCAN, immediately after that keyword. The next time you restart smartd, it will send out an email notification.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • 1
    I found that the -M option has to be immediately after DEVICESCAN, not at the end. This works: `DEVICESCAN -M test -H -s S/../../7/02 -m me@email.com` but this doesn't (illegal -M Directiive: test): `DEVICESCAN -H -s S/../../7/02 -m me@email.com -M test` – Richard Whitehead Aug 03 '17 at 15:01
  • `-M test` at the end of the `DEVICESCAN` works ok on Debian Jessie / `smartctl 6.6` – Stuart Cardall Jul 22 '19 at 13:54