Monitor HP RAID Array (R1)

Previously I wrote and article detailing how to Monitor HP RAID Array on Debian, unfortunately since that writing I have found a fatal flaw in it’s methodology. While our automated monitoring system using cciss-vol-status will in fact report a failed drive/array, it’s flaw lies in not reporting a predictive drive failure. The hpacucli tool is a good source of information and when combined with a bash script, it can be a robust solution for reporting. Assuming you have followed my previous article on how to Install HP ACU CLI on Debian, no other software will be required for this tutorial. Below is our check-array script which in this case will be placed in the /root directory. This script can certainly be extended, but at this time currently supports reporting of a failed drive, predictive failed drive and array rebuild task.

Note: the script must be executable with permissions of at least 0700

# Check status of RAID volumes on HP Smart Array controllers.

status=`/opt/compaq/hpacucli/bld/hpacucli ctrl slot=0 pd all show status`

if echo $status | grep -q Failed;
	echo -e "${status}" | mail -s "RAID Alert: ($(hostname)) Drive Failure!" -a "From: SRV Automation <>"
elif echo $status | grep -q Predictive;
	echo -e "${status}" | mail -s "RAID Alert: ($(hostname)) Predictive Drive Failure!" -a "From: SRV Automation <>"
elif echo $status | grep -q Rebuilding;
	echo -e "${status}" | mail -s "RAID Alert: ($(hostname)) Array Rebuild In Progress!" -a "From: SRV Automation <>"

Once our script is created, we will need to open up our crontab and call the script every hour. This can be accomplished by running crontab -e as the user that will run the script. Once the crontab edit screen is open, you will want to place the code below in the file and then save the crontab.

0 * * * * /root/check-array &> /dev/null

Once the crontab is saved, it will run the check-array script every hour. A simple way to test the script is to simply change the word “Failed” in the script to “OK”. There you have it, a small footprint RAID monitoring solution for HP Array Controllers

Did you find this article useful? Why not share it with your friends?

2 thoughts on “Monitor HP RAID Array (R1)

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.