Edit:I found the bug in the
script referenced below. I used a double equals sign as a comparison operator in one place; replacing it with a single equals sign fixed the problem. (I write a lot in PHP which uses "==" in if() statements routinely.) It should work correctly now.
Sorry!
Quote:
Originally Posted by
scottlindner 
SeijiSensei,
I tried your script. I had some errors. It must be a distro difference. I started to debug it, but I don't really have the time for that now. I like the concept, good work.
Scott
I'm sorry to hear that, Scott. I wrote it to monitor CentOS boxes, but I thought it was pretty generic. If you have a chance, send me the errors in a PM, and I'll take a look.
If you just want to start the monitoring, add the line:
/sbin/mdadm --monitor --mail=you@example.com /dev/mdX &
to /etc/rc.local, replacing X with the number (0, 1, ...) assigned to each array. You'll need one line for each array. Replace
you@example.com with the address to which notices should be sent. This approach will launch the monitor(s) upon reboot, but if anyone fails for some reason, it won't be restarted. The script I wrote handles that case by checking periodically when it's run from cron.