[mdlug] RAID Monitor Script

Joe Doehler lugnuts at doehler.us
Wed Jan 31 18:40:33 EST 2007


At 10:57 PM 1/27/2007, Mike wrote:
>Hi Everyone:
>
>Here is a little perl script to monitor RAID status and
>email users if any array appears degraded.  Hope you find
>it useful.  If someone knows of a more sophisticated
>approach, I'm all ears.  I just couldn't find anything
>easily on the web.
>
>Cheers!
>--
>Mike
...

My cron runs this, once a day:

#!/bin/sh
# Set clock
ntpdate tick.jrc.us
/sbin/hwclock --systoh
# E-mail when a raid drive fails
cat /proc/mdstat | grep '1/2' | mail name at domain

If I receive a non-empty e-mail, I know one of my two raid drives is 
in distress. If both fail, well, I find that out soon enough... The 
file also resets my hardware clock.

Your mileage may vary :-)

Joe.




More information about the mdlug mailing list