Comments on How To Configure Software RAID To Send An Email When Something's Wrong With RAID
How To Configure Software RAID To Send An Email When Something's Wrong With RAID This short guide explains how you can configure software RAID to send you an email when something's wrong with RAID, for example if a hard drive fails. I've tested this on Debian Etch, but it should apply to all other distributions with minor adjustments to paths, etc.
4 Comment(s)
Comments
A Linux server sends email to "root" by default. Rather than hardcoding an email address into every config file, it's cleaner to simply place a file named "forward" (that's dot-forward) in the root directory of the root account. The contents of that file should be a single line which is the admin's real, outside email address.
Now, whenever any process sends a message to "root", it will be automatically forwarded to the address specified in the ".forward" file.
The file should be a plain text file, with permissions 0644.
Lastly... put "root" back into the "mdadm.conf" file if it's been changed.
What I do is send all root messages to an email address. So then you not only get mdadm failure messages but a lot of other things just by that one setup.
nano /etc/aliases
root: [email protected] //
newaliases
Then test it:
echo testing | mail -s "test mail" root@localhost
echo test | mail -s "test message" root
Hi,
I want to know if there is a way to edit the From field of the email. Like your demo shows, I want to edit the [email protected] to a custom address.