Re: monitoring Mylex AcceleRAID 170

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2004-02-05 at 20:43, Ian Mortimer wrote:
> Hi Ross
> 
> > thanks for this useful information Ian. I've had a look and the
> > information is there.
> > But can you tell me, have you done anything more? Like set it up so that
> > it mails you when there are errors, or set it to run consistency checks?
> > Thanks again,
> 
> I have a script like this in /etc/cron.hourly
> 
>    #!/bin/bash
>    status="$(< /proc/rd/status)"
>    [[ $status = OK ]] && exit 0
>    diff /proc/rd/c0/current_status /proc/rd/c0/initial_status |
>    mail -s "Raid status on $(hostname -s) is $status" root
> 
> No mail so far so I can't vouch for it's usefulness.
> 
> You could run some more detailed checks on /proc/rd/c0/current_status
> or just check for changes in that file.

I use this script; seems to work with most Mylex cards; 170, 250, 1100.

Cokey



--

------------------------------------------------------------------
F. 'Cokey' de Percin, DBA       Email:
CSC                              Work - cdeperci@xxxxxxx
Columbia, South Carolina         Home - fdepercin@xxxxxxxxx

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Mailscanner thanks transtec Computers for their support.

#!/bin/sh
#
# This script checks the Mylex RAID hardware
#
# Note that the software RAID can be checked in a similar manner.
# The /proc/mdstat file(s?) can be checked as necessary
#

# Shouldn't need to touch these...
HOSTNAME=`hostname`
DATE=`date +%m/%d/%y:%H.%M`     

# Person to send log activity to.
SYSADMIN=root                     

# Linux, FreeBSD, BSDI, Sun, etc.
MAIL=mail                         

# This is the /proc directory for the Hardware RAID info
RBASE="/proc/rd"

# This is where the Hardware RAID status file is
RSTAT=`cat $RBASE/status`

if [ "$RSTAT" = "OK" ]; then
   echo "+++++++++++++++++++++++++++++++++++++++++++++" >  /var/log/raidreport.log
   echo "RAID hardware is OK"                           >> /var/log/raidreport.log
   echo "+++++++++++++++++++++++++++++++++++++++++++++" >> /var/log/raidreport.log

#
#  Note that this is turned OFF.  I only want to see problems....
#
#  cat /var/log/raidreport.log | $MAIL -s "$HOSTNAME $DATE Mylex RAID hardware in mode $RSTAT!!" $SYSADMIN  
  
   exit

fi

echo "+++++++++++++++++++++++++++++++++++++++++++++" >  /var/log/raidreport.log
echo "WARNING, we have a RAID hardware failure"      >> /var/log/raidreport.log
echo "WARNING, /proc/rd/status = $RSTAT"             >> /var/log/raidreport.log
echo "+++++++++++++++++++++++++++++++++++++++++++++" >> /var/log/raidreport.log

CX=`ls -d $RBASE/c* | cut -f4 -d "/"`
for cx in `echo $CX`; do
    RDSTAT=`grep Critical $RBASE/$cx/current_status`
    if [ "$RDSTAT" != "" ]; then
       echo "Controller $cx has status $RDSTAT"      >> /var/log/raidreport.log 
    fi
done

cat /var/log/raidreport.log | $MAIL -s "$HOSTNAME $DATE Mylex RAID hardware in failure mode $RSTAT!!" $SYSADMIN  

exit 1

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux