Tuesday, November 1, 2011

hot-to monitor raid status with lsi 9211-4i

In my previous post i told how to monitor raid stutus with lsi 9260-4i with nagios. Now i tell how to monitor raid status with raid controller lsi 9211-4i. This controller doesn't support by MegaCli utility.
The solution is: to use sas2ircu
you can find it there:


http://www.supermicro.com/support/faqs/data_lib/FAQ_9633_SAS2IRCU_Phase_5.0-5.00.00.00.zip

The zip file includes the utility for DOS, Linux PPC, Linux x86 (which will also work on x64), Solaris Sparc and X86, and Windows 32-bit and 64-bit.

i use it with nagios-nrpe server, so i write very-very simple shell script (/usr/local/bin/check_sas2ircu_raid.sh):

#!/bin/sh
exitstatus=2
STATUS=`/usr/local/bin/sas2ircu 0 STATUS |grep "Volume state"`
state=`echo "$STATUS"| awk '{ print $4 }'`
if [ "$state" = "Optimal" ]
then
    exitstatus=0
fi
echo "Volume state: $state"
exit $exitstatus



and now, write in nrpe config (for example, /etc/nagios/nrpe_local.cfg )

command[check_raid]=/usr/bin/sudo /usr/local/bin/check_sas2ircu_raid.sh

and finally, add to sudoers file


nagios ALL= NOPASSWD: /usr/local/bin/check_sas2ircu_raid.sh

now you can check raid status with nagios, simply add new service to nagios host config

No comments: