Nagios NRPE LSI Mega RAID

Scenario / Question:

How do I monitor LSI MegaRAID controller and raid array status on a remote linux server

Solution / Answer:

Use the check_lsi_megaraid plugin and NRPE

Download check_lsi_megaraid Plugin on Remote Host Server

Downlaod check_lsi_megaraid plugin to /usr/local/nagios/libexec/ from www.monitorexchange.org

check_lsi_megaraid

1. Download the plugin to folder /usr/local/nagios/libexec/

2. Download the megarc.bin utility which can be downloaded from LSI website at http://www.lsi.com/files/support/rsa/utilities/megaconf/ut_linux_megarc_1.11.zip

# mkdir -p /opt/Nagios/Nagios_Plugins/LSI/
# cd /opt/Nagios/Nagios_Plugins/LSI/
# wget http://www.lsi.com/files/support/rsa/utilities/megaconf/ut_linux_megarc_1.11.zip
# unzip ut_linux_megarc_1.11.zip

3. Copy megarc.bin to /usr/local/nagios/libexec/

# cp megarc.bin /usr/local/nagios/libexec/

4. Change permissions on plugin to nagios

# cd /usr/local/nagios/libexec/
# chown nagios.nagios check_lsi_megaraid megarc.bin
# chmod 775 check_lsi_megaraid megarc.bin

5. Test the plugin works

# /usr/local/nagios/libexec/check_lsi_megaraid

Add sudo alias for Nagios user

check_lsi_megaraid is a command that needs to be executed by root user. We need to create a sudo alias so that nagios user can execute check_lsi_megaraid with root privileges.

# visudo

Add the following:

# Allow nagios to run certain plugins as root
  nagios  ALL=(ALL) NOPASSWD: /usr/local/nagios/libexec/check_lsi_megaraid

Uncomment the following:

#Defaults requiretty

Edit nrpe.cfg File on Remote Host Server

Add a new command definition to the nrpe.cfg file on the remote host

# vi /usr/local/nagios/etc/nrpe.cfg

Add a new check_lsi_megaraid command definition.

command[check_lsi_megaraid]=/usr/bin/sudo /usr/local/nagios/libexec/check_lsi_megaraid

Because we are running xinetd we do not need to restart the NRPE daemon. Otherwise you would have to restart the NRPE daemon for the changes to take effect.

Add Service Definition to Nagios Monitoring Server

On the monitoring host, you need to define a new service for check_something on the remote host. Add
the following entry to one of your object configuration files (linux-server-remote.cfg)
define service{
use generic-service
host_name remotehost
service_description LSI RAID STATUS
check_command check_nrpe!check_lsi_megaraid
}

Next, verify your Nagios configuration files and restart Nagios.

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

# service nagios restart
Fabio Milano has written 80 articles for us. Fabio Milano is a certified RHCE, MCP, and CFOI. He runs an IT consulting and services company called RDS Support inc. Website:http://www.rdssupport.com
The information provided is for educational purposes only. All content including links and comments is provided "as is" with no warranty, expressed or implied. Use is at your own risk and you are solely responsible for what you do with it.

4 Comments so far

  1. Nasier on March 3rd, 2011
  2. Achu on October 27th, 2011
  3. Fabio Milano on January 18th, 2012
  4. aprogrammer on February 8th, 2014

    Fod debian system you can use repos for installation, like here – http://sysadmin.te.ua/linux/monitoring-systems/smart-under-lsi-2108-kontroller.html

Leave a reply