How to Install and Configure Nagios NRPE

In the previous article, i have guide you on how to install Nagios Core, mainly for network and services monitoring. In this post, i will guide you on how to install Nagios NRPE. Nagios Remote Plugin Executor (NRPE) is a Nagios agent that allows to remotely execute Nagios plugins on other Linux/Unix machines. NRPE can also communicate with Windows agent addons like NSClient++. It allows for monitoring resources such as disk usage, CPU load, etc. Please follow the following steps to install Nagios NRPE on your Nagios server.

How to Install Nagios on CentOS 5.5

1. Install the Nagios NRPE and Nagios-devel. For your information, Nagios-devel is a header files, libraries and development documentation for nagios.

[root@server ~]# yum --enablerepo=rpmforge install nagios-nrpe nagios-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons:
 * base:
 * epel:
 * extras:
 * rpmforge:
 * updates:
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nagios-devel.i386 0:3.2.3-3.el5.rf set to be updated
---> Package nagios-nrpe.i386 0:2.12-1.el5.rf set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

 Package               Arch          Version                 Repository         Size
 nagios-devel          i386          3.2.3-3.el5.rf          rpmforge           42 k
 nagios-nrpe           i386          2.12-1.el5.rf           rpmforge           35 k

Transaction Summary
Install       2 Package(s)
Upgrade       0 Package(s)

Total download size: 76 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): nagios-nrpe-2.12-1.el5.rf.i386.rpm                     |  35 kB     00:00
(2/2): nagios-devel-3.2.3-3.el5.rf.i386.rpm                   |  42 kB     00:00
Total                                                 23 kB/s |  76 kB     00:03
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : nagios-nrpe                                                   1/2
  Installing     : nagios-devel                                                  2/2

  nagios-devel.i386 0:3.2.3-3.el5.rf         nagios-nrpe.i386 0:2.12-1.el5.rf


2. Set nrpe to start at boot and start nrpe

[root@server ~]# chkconfig nrpe on
[root@server ~]# /etc/init.d/nrpe start
Starting Nagios NRPE daemon (nrpe):                        [  OK  ]

3. Update the /etc/services. At the following line at the bottom of the page.

[root@server ~]# vi /etc/services
nrpe            5666/tcp                        # NRPE

4. Test NRPE daemon install

[root@server ~]# netstat -at |grep nrpe
tcp        0      0 server.intranet.local:nrpe  *:*                         LISTEN