Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to get my Fedora15-based server to send any errors from mdadm by mail. I found this snippet online and put it in my crontab (crontab -e):

0,20,40 * * * * mdadm --monitor -1 -m yourname@yourisp.com -scan 

Nothing happens. When running this manually in the terminal, no email is received either. I am guessing that I need to change some settings to setup email sending with my vanilla Fedora install.

Where should I begin? Thanks!

share|improve this question

2 Answers 2

up vote 0 down vote accepted

This will only email you if an event is detected. If your arrays are healthy, you will receive no email. This is probably what you want rather than getting an email every 20 minutes when nothing is wrong.

You can add -t to test this command:

mdadm --monitor -1 -t -m yourname@yourisp.com --scan
share|improve this answer
    
Hi! That's a good point. Still not receiving any emails though. Any idea where I should begin my troubleshooting? –  Industrial Jul 5 '11 at 21:25

You shouldn't need to do this on Fedora 15 as it runs an mdadm daemon in monitor mode that will alert you - just make sure the mdmonitor service is enabled.

The email will go to the root user, so just make sure you add an appropriate entry to the aliases fie so that mail to root will reach you. If you can't get ail to root to work then set MAILADDR in /etc/mdadm.conf to the address you want it to use and restart the mdmonitor service.

share|improve this answer
    
Hi TomH! Thanks for your answer. I ran service mdmonitor status which confirms that it's running. Do you mean that I should add my email to the '/etc/aliases' file and it will work? No need to install postfix or any other stuff? –  Industrial Jul 5 '11 at 21:24
    
Well basically do whatever you need to do to make sending mail to root work - that's generally a good idea anyway as various things will try and send mail to root when things go wrong. –  TomH Jul 5 '11 at 21:37
    
Alternatively you can set MAILADDR in madadm.conf, which I have now added to my answer. –  TomH Jul 5 '11 at 21:38

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.