How to install Nagios client (NRPE)

How to install Nagios client (NRPE) post thumbnail image

You need to do installation and basic client configuration on remote server to monitor your host and services with Nagios Core.

Step 1: First of all you need to install all required packages.

# yum install gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel vim wget xinetd

Step 2: Create user using below command.

# useradd -s /usr/sbin/nologin nagios

Step 3: Download required packages from web using wget command.

# wget
# wget

Step 4: Now extract downloaded files to compile.

# tar xzf nagios-plugins-2.1.2.tar.gz
# cd nagios-plugins-2.1.2
# ./configure
# make
# make install

** Now extract nrpe file as well **
# tar xzf nrpe-3.2.1.tar.gz
# cd nrpe-3.2.1
# ./configure
# make all
# make install-plugin;
# make install-daemon;
# make install-daemon-config;
# make install-xinetd

Step 5: Setup permissions for required directories.

# chown nagios:nagios /usr/local/nagios
# chown -R nagios:nagios /usr/local/nagios/libexec

Step 6: Make an entry into /etc/services

# echo "nrpe 5666/tcp # NRPE" >> /etc/services

Sample Entry:

Step 7: Add nagios server ip in to /etc/xinetd.d/nrpe file

# sed -i 's/ <nagios-server-ip>/g' /etc/xinetd.d/nrpe

Note: Replace <nagios-server-ip> with your nagios core IP.

Step 8: Restart service and check if it is configured correctly or not.

# systemctl restart xinetd.service
# /usr/local/nagios/libexec/check_nrpe -H

The Out put should like this.

[root@nagios-client]# /usr/local/nagios/libexec/check_nrpe -H
NRPE v2.3.1

That’s it!! You are good to go.

NOTE: If you are using iptables or firewall in your servers then you need to allow 5666 port.

Read how to intall Nagios Core in ubuntu.

Related Post