Skip to content

NRPE Installation and Client Configuration [ Nagios ]

This is just a custom guide to install and configure Nagios Remote Plugin Executor  on Centos 7.x, this could be more technical and advanced, if you do not understand or don’t know what you are doing, I kindly request you to take extreme caution and the components used here on GCP are billable. SKYDEVOPS/I/WE do not take any responsibility if the guide causes any serious damage or issues, which you have to take full responsibility.

Installation Guide:

  1. Installation of check_nrpe on the Nagios server
  2. Installation of NRPE on the Nagios client
  3. Installation of Plugins on the Nagios client
  4. installation od xinetd on the Nagios Client
  5. Configuration of Hosts and Services configurations on Nagios Server
  • Installation on Nagios Server
    • To Installation and configuration of Nagios Server on Centos 7.x, use the following link [ Nagios Server Installation Guide ]
    • Installation and configuration of check_nrpe:
  • Installation on Nagios Client
# Install Pre-Requesites
$ sudo yum install -y gcc glibc glibc-common openssl openssl-devel perl wget
# Download the latest NRPE
$ cd /opt
$ sudo wget
# Extract NRPE
$ sudo tar xf nrpe-3.2.1.tar.gz
# Compile and Install NRPE
$ sudo ./configure && sudo make all && sudo make install
  • Nagios Plugin Installation on the Client
$ cd /opt
$ sudo wget
$ sudo tar xf nagios-plugins-2.2.1.tar.gz
$ cd nagios-plugins-2.2.1
$ sudo ./configure && sudo make all && sudo make install
  • Installation of xinetd super deamon on the Nagios Client

$ sudo yum install xinetd -y

  • configuring xinetd server

$ sudo vi /etc/xinetd.d/nrpe

service nrpe
flags = REUSE
port = 5666
socket_type = stream
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from =

  • Configuration files on Nagios Client

# Create necessary configuration files

$ sudo mkdir -p /usr/local/nagios/etc
$ sudo cp /opt/nrpe-3.2.1/sample-config/nrpe.cfg /usr/local/nagios/etc
$ sudo touch /usr/local/nagios/etc/hosts.cfg
$ sudo touch /usr/local/nagios/etc/services.cfg

  • Added Hosts and Service config to main Nagios configuration

# Edit the main Nagios Server config to add hosts and services confs

$ sudo vi /usr/local/nagios/etc/nagios.cfg


  • Defining client configuration on the Server

# defining hosts
define host {
use linux-server
host_name ngwebsrv
alias SKY Nginx web server
max_check_attempts 5
check_period 24x7
notification_interval 30
notification_period 24x7

  • Defining check_nrpe command

# Defining check_nrpe command
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

  • Defining services for the client

# CPU Load example
define service{
use generic-service
host_name ngwebsrv
service_description CPU Load
check_command check_nrpe!check_load

# USER Check example
define service{
use generic-service
host_name ngwebsrv
service_description Current Users
check_command check_nrpe!check_users

# Total Process
define service{
use generic-service
host_name ngwebsrv
service_description Total Processes
check_command check_nrpe!check_total_procs

  • Restart the Nagios server and you can start monitoring the clients on the server

$ sudo systemctl restart nagios

Shashi View All

A passionate devops and automation engineer

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: