How to Install and Configure Nagios NRPE

In network and services monitoring, Nagios Core stands as a prominent tool. However, to further enhance its capabilities, we introduce Nagios Remote Plugin Executor (NRPE). NRPE is an agent that allows Nagios plugins to be executed remotely on other Linux/Unix machines. It can also communicate with Windows agent addons like NSClient++, enabling monitoring of resources such as disk usage, CPU load, and more.

This guide will walk you through the process of installing and configuring Nagios NRPE on your Nagios server.

Installation Steps

Step 1: Install Nagios NRPE and Nagios-devel

Nagios-devel comprises header files, libraries, and development documentation for Nagios. To install Nagios NRPE and Nagios-devel, use the following command:

[root@server ~]# yum --enablerepo=rpmforge install nagios-nrpe nagios-devel

This command will resolve dependencies and install the necessary packages.

Example:

[root@server ~]# yum --enablerepo=rpmforge install nagios-nrpe nagios-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: ossm.utm.my
 * base: ossm.utm.my
 * epel: ftp.cuhk.edu.hk
 * extras: ossm.utm.my
 * rpmforge: fr2.rpmfind.net
 * updates: ossm.utm.my
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
=====================================================================================
Installing:
 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

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

Complete!

Step 2: Set NRPE to Start at Boot and Start NRPE

To ensure NRPE starts automatically at boot, use the following command:

[root@server ~]# chkconfig nrpe on

To start NRPE, use the following command:

[root@server ~]# /etc/init.d/nrpe start

...

Starting Nagios NRPE daemon (nrpe):                        [  OK  ]

Step 3: Update /etc/services

Add the following line at the bottom of the /etc/services file:

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

Step 4: Test NRPE Daemon Install

To verify that the NRPE daemon has been installed correctly, use the following command:

[root@server ~]# netstat -at |grep nrpe

If the installation was successful, you should see output similar to the following:

tcp        0      0 server.intranet.local:nrpe  *:*                         LISTEN

Commands Mentioned

  • yum –enablerepo=rpmforge install nagios-nrpe nagios-devel – Installs Nagios NRPE and Nagios-devel
  • chkconfig nrpe on – Sets NRPE to start at boot
  • /etc/init.d/nrpe start – Starts NRPE
  • vi /etc/services – Opens the /etc/services file for editing
  • netstat -at |grep nrpe – Checks if NRPE daemon is installed and running
See also  How to Install Adobe Flash Player on CentOS 6.3

Conclusion

Nagios NRPE is a powerful tool that enhances the capabilities of Nagios Core by allowing remote execution of Nagios plugins on other Linux/Unix machines.

This tutorial has provided you with step-by-step instructions on how to install and configure Nagios NRPE on your Nagios server. By following these steps, you can effectively monitor resources such as disk usage, CPU load, and more on your network. For more in-depth information on various web servers, you can explore our articles on best web servers, Apache, Nginx, and LiteSpeed. If you’re interested in different hosting options, we also have articles on dedicated server, VPS server, cloud hosting, and shared hosting.

See also  How to Install Wireshark on CentOS 6.3

Remember, the key to effective network and services monitoring lies in the proper installation and configuration of your tools.

FAQ

  1. What is Nagios NRPE?

    Nagios NRPE, or Nagios Remote Plugin Executor, is an agent that allows Nagios plugins to be executed remotely on other Linux/Unix machines. It can also communicate with Windows agent addons like NSClient++, enabling monitoring of resources such as disk usage, CPU load, and more.

  2. What is Nagios-devel?

    Nagios-devel comprises header files, libraries, and development documentation for Nagios. It is necessary for the installation and functioning of Nagios NRPE.

  3. How do I start NRPE?

    You can start NRPE by using the command “/etc/init.d/nrpe start”. This command initiates the Nagios NRPE daemon.

  4. How do I set NRPE to start at boot?

    You can set NRPE to start at boot by using the command “chkconfig nrpe on”. This ensures that NRPE automatically starts whenever your server boots up.

  5. How do I verify that NRPE is installed and running?

    You can verify that NRPE is installed and running by using the command “netstat -at |grep nrpe”. If NRPE is running, this command will return output indicating that the NRPE daemon is listening.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *