====== Install Nagios Plugin and NRPE on Redhat ======
Prerequisite install
* xinetd
* openssl-devel
Redhat 3rd party libraries if added to yum can let you install nrpe via yum. However, below is an explanation of now to compile this locally.
===== Download and Extract files =====
Download and copy files to /tmp
* nrpe-2.15.tar.gz
* nagios-plugins-1.5.tar.gz
Extract files
cd /tmp
tar zxvf nrpe-2.15.tar.gz
tar zxvf nagios-plugins-1.5.tar.gz
===== Create nagios Account =====
groupadd nagios
useradd -d /var/log/nagios -g nagios -m -p somepassword nagios
date|md5sum|cut -b "1-10" | passwd --stdin nagios
id nagios
===== Install the Nagios Plugins =====
cd nagios-plugins-1.5
./configure
make
make install
chown -R nagios:nagios /usr/local/nagios
===== Install the NRPE daemon =====
cd nrpe-2.15
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
chown -R nagios:nagios /usr/local/nagios
Update nagios server IP address here. Included additional IP separated by spaces.
grep only /etc/xinetd.d/nrpe
Use the following example to replace easily!
sed -i 's@only_from = 127.0.0.1@only_from = 127.0.0.1 10.50.60.0/24 204.67.86.0/24@' /etc/xinetd.d/nrpe
Add the NRPE daemon to services
echo "nrpe 5666/tcp # NRPE" >> /etc/services
service xinetd restart
===== Test NRPE daemon =====
Check for Listening port
netstat -at | grep nrpe
should have output as
tcp 0 0 *:nrpe *:* LISTEN
Run the call to service
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
Should return **NRPE v2.15**
===== Additional plugins =====
Copy any additional plugins to ''/usr/local/nagios/libexec/'' such as ''check_linux_stats.pl''
===== File locations =====
Nagios Core, Nagios NRPE Deamon and Nagios Plugin Locations
==== Compiled Version ====
=== Plugins (executables) ===
/usr/local/nagios/libexec/check_nrpe
=== NRPE Deamon config file (settings) ===
/etc/xinetd.d/nrpe
=== NRPE Config file (commands) ===
/usr/local/nagios/etc/nrpe.cfg
==== Ubuntu ====
=== Core Nagios Monitoring config directory (settings) ===
/etc/nagios3/conf.d/
=== Plugin Location (executables) ===
/usr/lib/nagios/plugins
==== Redhat ====
=== NRPE Config file (commands) ===
/etc/nagios/nrpe.cfg
=== Plugin Location ===
/usr/lib64/nagios/plugins/
===== Related =====
Install ''Sys:Statistics:Linux'' via CPAN
[[http://search.cpan.org/~bloonix/Sys-Statistics-Linux-0.66/lib/Sys/Statistics/Linux.pm|Sys:Statistics:Linux]]