To monitor the status of a LSI RAID card, say for example a Dell PERC card, you will need to install NRPE, sudo, mpt-status and check_mpt.sh .
First, load the module mptctl if it’s not done already:
To have the module loaded at boot, you can use your distribution specific behavior. In my case, I put it in /etc/rc.local .
To poll the RAID card, mpt-status needs some privileges. The easiest way to give them is to use sudo. sudo will be call via NRPE so you need to allow NRPE to invoke sudo without a tty.
Add the following lines to your sudoers file:
nagios ALL=(ALL) NOPASSWD: /usr/sbin/mpt-status
Put check_mpt.sh in the plugins directory of NRPE (for example: /usr/lib64/nagios/plugins) and make it executable.
Then add a command to your NRPE config file:
and restart NRPE.
On your NAGIOS server, run the following command to check it’s actually working:
/usr/lib/nagios/plugins/check_nrpe -H 220.127.116.11 -c check_raid
If you get something like this, then it works:
ioc0 vol_id 0 type IM, 2 phy, 232 GB, state OPTIMAL, flags ENABLED
ioc0 phy 1 scsi_id 9 ATA WDC WD2502ABYS-1 3B05, 232 GB, state ONLINE, flags NONE
ioc0 phy 0 scsi_id 1 ATA WDC WD2502ABYS-1 3B05, 232 GB, state ONLINE, flags NONE
Now you just have to add an extra service check to your host and reload NAGIOS config and voilà !
Note: if you don’t want to use sudo, you can run NRPE as root but that’s not recommended ;-)