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
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 /etc/usr/nagios/libexec/
# cp megarc.bin /etc/usr/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


