check to see if a drive has failed

Marcus Bointon marcus at synchromedia.co.uk
Thu May 3 10:46:23 CDT 2007


On 3 May 2007, at 16:27, Adam Williams wrote:

> I was thinking of running a daily cron and having it email me the  
> output
> from "omreport storage vdisk" and look at the Status Line.

That's pretty much what I'm doing (though using megarc instead of  
omreport), though I know there are more sophisticated solutions that  
are event driven (i.e. they will tell you as soon as something  
happens, rather than waiting until you poll it), little beats a  
simple shell script for transparency! Here's my script:

#!/bin/sh

#Simple RAID status monitor
#By Marcus Bointon

/usr/local/bin/megarc -dispCfg -a0 > /tmp/megarc.raidstatus

if ! grep -q "Status: OPTIMAL" /tmp/megarc.raidstatus
then
         echo "Warning: RAID status not optimal:"
         cat /tmp/megarc.raidstatus
fi

rm -f /tmp/megarc.raidstatus

exit 0

If you save this as /etc/cron.daily/raidmon (or in /etc/cron.hourly  
as you wish), chmod +x it, it will just work. You need to set a  
MAILTO env var in your /etc/crontab an then it will just email you  
any output (which there won't be if it's OK). It should be very  
simple to adapt this for omreport.

HTH,

Marcus
-- 
Marcus Bointon
Synchromedia Limited: Creators of http://www.smartmessages.net/
UK resellers of info at hand CRM solutions
marcus at synchromedia.co.uk | http://www.synchromedia.co.uk/



More information about the Linux-PowerEdge mailing list