Monitoring LSI Logic RAID controllers

I managed a fair number of Dell and Sun servers that use LSI Logic RAID controllers. To ensure that a disk failure in one of our servers is quickly located and fixed, I started poking around the web this week to locate a tool that was capable of monitoring our RAID controllers and disk drives. My searches led me to the mpt-status utility, which is an opensource tool for monitoring LSI Logic RAID controllers.

Mpt-status is a relatively simple utility, and can be run without any options to report the status of all LSI Logic RAID controllers and the disk drives that live behind those controllers:

$ mpt-status

ioc0 vol_id 0 type IM, 2 phy, 136 GB, state OPTIMAL, flags ENABLED
ioc0 phy 0 scsi_id 0 SEAGATE  ST3146707LC      D704, 136 GB, state ONLINE, flags NONE
ioc0 phy 1 scsi_id 1 SEAGATE  ST3146707LC      D704, 136 GB, state ONLINE, flags NONE

This will print the status of the controller and each disk drive, along with the drive manufacturer, the size of each disk drive, and the SCSI target number. To get similar information in a parseable format, the mpt-status “-s” option can be used:

$ mpt-status -s

log_id 0 OPTIMAL
phys_id 0 ONLINE
phys_id 1 ONLINE

The servers I plan to use mpt-status on run Redhat Linux, so I created an RPM specification file to assist with building and deploying the package. I also incorporated a RAID controller monitoring script into the RPM, which will install itself into /etc/cron.daily/checklsi.sh, and run daily to check the status of the controllers and disk drives. Viva la monitoring!

9 Comments

Ben  on June 4th, 2007

Any chance you can pass that complete RPM my way, please? Sounds like just what I need. Shame there’s nothing similar under Solaris!

matty  on June 6th, 2007

Hi Ben,

I don’t distribute RPMs, but you can build the code using the spec file I referenced. Solaris has a built-in tool to query the LSI Logic RAID controllers. You can check out the following blog post for additional details:

http://prefetch.net/blog/index.php/2007/04/01/monitoring-hardware-raid-controllers-with-solaris/

pgienger  on June 14th, 2007

Did you have to do anything special in the way of installing packages to get the mpt-status source to build? I’ve been trying recently on RHEL/Fedora/CentOS from both the base tarball and spec, but I keep running into missing headers (for example lsi/mpi_type.h). The best indications I’ve found is that these might have been removed from the kernel tree.

Philon  on August 17th, 2007

Hey there,

matty, thanks for the SPEC, I found your daily script and installed it. Nice thing!

And as another note to pgienger, as I also had some problems while compiling mpt-status… Get the kernel sources, see here “http://wiki.centos.org/HowTos/I_need_the_Kernel_Source”. mpi_type.h is then located in “drivers/message/fusion/”. For the compiler.h error I edited the mpt-status.h and hard-coded the compiler.h.

and finally:
[root@bart ~]# mpt-status
ioc0 vol_id 0 type IM, 2 phy, 68 GB, state OPTIMAL, flags ENABLED
ioc0 phy 0 scsi_id 0 IBM-ESXS CBR073C32410ESFN DFQD, 68 GB, state ONLINE, flags NONE
ioc0 phy 1 scsi_id 1 IBM-ESXS CBR073C32410ESFN DFQD, 68 GB, state ONLINE, flags NONE

regards

dmnd  on September 1st, 2007

Tnx man! i’ve been looking for this quite some time! :)

Eric Wood  on June 2nd, 2008

Got mpt-status from:
http://www.drugphish.ch/~ratz/mpt-status/

Compile it Philon’s message above but I can’t get it to run with a Dell SAS/5iR card which has the SAS1068 chip. This 1068 chip is supported by mpt-status.

Any ideas?

# ./mpt-status
open /dev/mptctl: No such device
Are you sure your controller is supported by mptlinux?
Make sure mptctl is loaded into the kernel

# lsmod |grep mpt
mptsas 31049 2
mptscsih 24897 1 mptsas
mptbase 56929 2 mptsas,mptscsih
scsi_transport_sas 30529 1 mptsas
scsi_mod 132685 6 sg,libata,mptsas,mptscsih,scsi_transport_sas,sd_mod

# ls -l /dev/mptctl
crw-r–r– 1 root root 10, 220 May 29 13:23 /dev/mptctl

Eric Wood  on June 2nd, 2008

Solved.

I added “modprobe mptctl” at bootup according to these instructions:
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/s1-kernel-modules-persistant.html

rebooted the server and mpt-status as well as Dell’s SSM gui software works.

daveg  on April 19th, 2009

That output from mpt-status -s looks like its perfect low hanging fruit to get made into a nagios check plugin :-)

Frands  on May 23rd, 2009

This can be used as nagios check works like a charm.

#!/bin/sh

STATUS=`/usr/bin/sudo /usr/sbin/mpt-status -s`

if [ `/usr/bin/sudo /usr/sbin/mpt-status |grep ONLINE | wc -l` == "2" ]; then

echo “Array OK: $STATUS”
exit 0

else

echo “Array ERROR: $STATUS”
exit 2

fi

Leave a Comment