6
3
I'm running Ubuntu 10.04 on top of a RAID-1 array. Out of curiosity, I decided to bring up the "Disk Utility" program to inspect the status of my array. To my surprise, the array was listed as "Degraded", with one of the drives being faulty. Had my other drive failed, I would have lost all my data. Is there a way to setup Ubuntu to automatically notify me via email or some other means when RAID is degraded?
It seems strange to have such great software RAID support in Ubuntu, and then throw it all away by not communicating RAID failures to the user. I was thinking of writing a cron job to monitor "cat /proc/mdstat" and send me an email if the "failed drive" pattern was seen, but I don't want to reinvent the wheel.
I've asked how to read root's mail on a modern Ubuntu at the dedicated SE site. – Gilles 'SO- stop being evil' – 2010-08-14T11:44:19.767
Yeah, I never read my local mailbox. I ended up creating a simple script to send email to my normal mailbox, and setup a cron job to run mdadm regularly, using the --program param to execute my email script to notify me. – Cerin – 2010-08-14T13:20:43.083
I have a degraded array but "no mail for root" – Bryce – 2012-10-30T23:16:43.567
@Bryce That's probably because you aren't getting mail for root at all. See the question I linked to on the Ubuntu site (which sadly doesn't have up-to-date answers). – Gilles 'SO- stop being evil' – 2012-10-30T23:19:53.993
You have to install and configure an MTA to send mail to root off the system. The package
postfix
is a good choice for this. – milli – 2014-02-15T08:57:37.610