Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So, I have a couple of MDADM RAID arrays and I want to set up monitoring with email notifications for drive failures through sSMTP but I can't seem to get it working.

The system in question is a Virtual Machine running on an ESXi 5 hypervisor. The VM is running CentOS with 8 drives attached to it; six through virtual drives stored on the physical disks as well as two WD Red 3TB drives attached via RDM because of VMFS5's 2TB limit. The WD Reds are /dev/sdh and /dev/sdi.

This is what my /etc/mdadm/mdadm.conf looks like:

DEVICE partitions
ARRAY /dev/md1 level=1 metadata=1.2 num-devices=2 devices=/dev/sdb,/dev/sdc
ARRAY /dev/md2 level=5 metadata=1.2 num-devices=4 devices=/dev/sdd,/dev/sde,/dev/sdf,/dev/sdg
ARRAY /dev/md3 level=1 metadata=1.2 num-devices=2 devices=/dev/sdh,/dev/sdi

MAILADDR <where to send the reports>
MAILFROM <a gmail address>

Where "a gmail address" is an email account I have set up specifically for my server to use.

sSMTP is installed and /etc/ssmtp/ssmtp.conf basically looks like this:

root=<myRealEmailAddress>
mailhub=smtp.gmail.com:587
AuthUser=<a Gmail address>
AuthPass=<password>
UseSTARTTLS=YES
RewriteDomain=

I have also added two posts in /etc/ssmtp/revaliases:

root:<a gmail address>:smtp.gmail.com:587
<user>:<a gmail address>:smtp.gmail.com:587

I have successfully gotten an email for each array when invoking:

sudo mdadm --monitor --scan --test --oneshot

but that's as far as I've come.

To test the system I have pulled /dev/sdi from its drive bay and attempted to schedule/manually invoke scans to check that I receive an ArrayDegraded email, but it never comes. An example of a command I've tried to run which as far as I can tell should yield the wanted result is:

sudo mdadm --monitor --scan --oneshot

but it simply freezes the prompt for a couple of seconds and then nothing. Checking /proc/mdstat the drive is still detected as present and running an mdadm --test event gives me emails with an included copy of mdstat which again tells me that everything is fine, despite the missing drive.

I have read through

I have tinkered with this for about a week now so I've read through many tutorials/guides for mdadm as well as discussion threads and even gasp some man pages. Can anyone see where I've done something stupidly wrong? What am I missing? What can I do to get to the bottom of this?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.