S.M.A.R.T - monitor the status of hard drives in Centos sending notifications to Email

Friday, 03 April 2015 17:57

Hard drive - the most vulnerable spot any server. If you take the possible failure of "iron" that often fails is the hard drive. At the same time there is also a huge risk of data loss (unless of course fails to make backups). Under this state hard drive is required to monitor and replace them immediately after a problem occurs.

This will help S.M.A.R.T., which will constantly monitor the disks and if the problem will notify you by email. S.M.A.R.T. - A technology for self-diagnosis and prediction of possible hard drive failure.

Installing and configuring S.M.A.R.T. in Centos.

Install the package:

yum install smartmontools

Add to startup and run the daemon:

chkconfig smartmontools on
service smartd start

Look, how many and what drives us in the system:

fdisk -l

View information about the disc /dev/sda:

smartctl -i /dev/sda

Enable S.M.A.R.T (if turned off):

smartctl -s on /dev/sda

Viewing values S.M.A.R.T. disc /dev/sda:

smartctl -A /dev/sda

In order to receive a notification e-mail if a problem occurs, you must file /etc/smartd.conf comment out:

DEVICESCAN -H -m root

and add to each available disk in the system line of the form:

/dev/sda -a -s (S/../../(1|3|6)/01|L) -m root @ domain.net -M diminishing

replacing root @ domain.net to your mailbox (no spaces).

restart the service:

service smartd restart

Now if you have a problem with the disc, you will receive a notification to your email.

In order to test the sending and receiving mail, you must file /etc/smartd.conf replace diminishing with test and restart the service. You should immediately receive an email. If not - check the settings of your mail server.


default]# /dev/sda -a -s S/../../(1|3|6)/01|L -m anoop.varghese@xxxx.com -M diminishing
-bash: syntax error near unexpected token `('
I have followed your steps and but i am not getting any emails. Can you please help me where i am facing the issue.

I am using centos 7.3

Anoop Vargehse Anoop Vargehse | Wednesday, 21 June 2017 11:06


Leave a comment

  • Payment
    Methods:
  • visa
  • mastercard
  • qiwi
  • webmoney
  • yandex money
  • sberbank
  • mts bank
  • zpayment
  • liqpay
  • alfabank white
Copyright © 2012 - 2024 WebPatron Ltd. All rights reserved.