2017年7月12日星期三

HP Linux Raid info (Tested under Centos 6.9)

HP System Management 
https://h20566.www2.hpe.com/hpsc/swd/public/detail?swItemId=MTX_6c49e131b4dc46fd937a652120 
 
HP Array Controller Unit Command Line Interface HPACUCLI
http://h20564.www2.hpe.com/hpsc/swd/public/detail?swItemId=MTX_d6ebba0f5cd642edace4648b9a 
 
CLI  status show
hpacucli controller slot=0 physicaldrive all show
 
CLI monitoring script example: 

slot=0 means build in controller if you use additional raid then you need to update the controller slot number
#!/bin/bash
###
#If disk and RAID went wrong with HP raid controller this script will send an email 
###
MAIL=info@ljhk.com
HPACUCLI=`which hpacucli`
HPACUCLI_TMP=/tmp/hpacucli.log


  if [ `hpacucli controller slot=0 physicaldrive all show | grep '(Failed|Rebuilding)'| wc -l` -gt 0 ]
  then
   msg="HP RAID Controller Errors"
   #echo $msg
   #$msg2=`hpacucli controller slot=0 physicaldrive all show`
   logger -p syslog.error -t RAID "$msg"
   $HPACUCLI controller slot=0 physicaldrive all show > $HPACUCLI_TMP
   mail -s "$HOSTNAME [ERROR] - $msg" "$MAIL" < $HPACUCLI_TMP
   #rm -f $HPACUCLI_TMP
  #else
  #echo "Everything Good"
   fi