0

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!

Cakemox
  • 25,209
  • 6
  • 44
  • 67
Industrial
  • 1,579
  • 6
  • 24
  • 37

2 Answers2

2

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.

TomH
  • 1,290
  • 7
  • 10
  • 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 05 '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 05 '11 at 21:37
  • Alternatively you can set MAILADDR in madadm.conf, which I have now added to my answer. – TomH Jul 05 '11 at 21:38
0

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
Cakemox
  • 25,209
  • 6
  • 44
  • 67
  • Hi! That's a good point. Still not receiving any emails though. Any idea where I should begin my troubleshooting? – Industrial Jul 05 '11 at 21:25