In this article, we describes you how to install NRPE Nagios Client on Linux. In the previous article, we have discussed about the installation of nagios server on Linux in the last article, click here to see how to configure and install the nagios on Linux servers.
If you are interested in learning, Request you to go through the below recommended tutorial.
DevOps Full Course Tutorial for Beginners - DevOps Free Training Online
Docker Full Course Tutorial for Beginners - Docker Free Training Online
Kubernetes Full Course Tutorial for Beginners - Kubernetes Free Training Online
Ansible Full Course Tutorial for Beginners - Ansible Free Training Online
Openstack Full Course Tutorial for Beginners - Openstack Free Training Online
This article will show you that, how to install Nagios NRPE client on Linux server.Docker Full Course Tutorial for Beginners - Docker Free Training Online
Kubernetes Full Course Tutorial for Beginners - Kubernetes Free Training Online
Ansible Full Course Tutorial for Beginners - Ansible Free Training Online
Openstack Full Course Tutorial for Beginners - Openstack Free Training Online
How to install NRPE Nagios Client on Linux
Our Setup:
Server IP Address : 192.168.2.1
Client IP Address : 192.168.2.2 (Here only we are going to install nagios nrpe client)
1. Install Required Dependencies Packages
Please install all below required dependencies for Nagios through yum server, because installing these packages individually is more complicated. So we recommended to go with Yum server.
yum install -y gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel
2. Download Nagios Client (NRPE) Software and Nagios Plugins
If you wish to download the latest version, please visit https://www.nagios.org/download/
I have downloaded from the below link and kept in my linux client already in the folder /home/learnitguide.
Nagios NRPE : http://sourceforge.net/projects/nagios/files/nrpe-2.x/
Nagios Plugin Link : http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
[learnitguide@nagios-client ~]# cd /home/learnitguide/
Extract Nagios Core and its Plugins:
[learnitguide@nagios-client ~]# tar -xvf nrpe-2.15.tar.gz
[learnitguide@nagios-client ~]# tar -xvf nagios-plugins-2.0.3.tar.gz
3. Create a dedicated user and group for nagios
[learnitguide@nagios-client ~]# groupadd nagios
[learnitguide@nagios-client ~]# useradd -g nagios -d /home/nagios nagios
Set the password for Nagios user:
[learnitguide@nagios-client ~]# passwd nagios
Changing password for user nagios.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
4. Install the Nagios Plugin:
Go to the directory of nagios plugin which we extracted recently and start installing it.
[learnitguide@nagios-client ~]# cd nagios-plugins-2.0.3
[learnitguide@nagios-client nagios-plugins-2.0.3]# ./configure
[learnitguide@nagios-client nagios-plugins-2.0.3]# make
[learnitguide@nagios-client nagios-plugins-2.0.3]# make install
5. Change the ownership of the Nagios directories to the Nagios group & Nagios user.
[learnitguide@nagios-client nagios-plugins-2.0.3]# chown -R nagios:nagios /usr/local/nagios
6. Install the NRPE Nagios Client:
Go to the directory of nrpe nagios plugin which we extracted recently and start installing it.
[learnitguide@nagios-client nagios-plugins-2.0.3]# cd /root/nrpe-2.15
[learnitguide@nagios-client nrpe-2.15] ./configure
[learnitguide@nagios-client nrpe-2.15] make all
[learnitguide@nagios-client nrpe-2.15] make install-plugin
[learnitguide@nagios-client nrpe-2.15] make install-daemon
[learnitguide@nagios-client nrpe-2.15] make install-daemon-config
[learnitguide@nagios-client nrpe-2.15] make install-xinetd
7. Edit the /etc/xinetd.d/nrpe file to work through xinetd and add the nagios server IP address to allow requests.
Before Change:
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
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 = 127.0.0.1
}
After change:
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
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 = 127.0.0.1 192.168.2.1
}
8. Edit the /etc/services file and add nrpe to the services at the end of the line.
nrpe 5666/tcp # NRPE
9. Restart the xinetd service and check if the nrpe is being listened.
[learnitguide@nagios-client nrpe-2.15] /etc/init.d/xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
[learnitguide@nagios-client nrpe-2.15] netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN
[learnitguide@nagios-client nrpe-2.15] /usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.15
If you get the NRPE Version as output here, you have done the NRPE installation on Linux successfully.
10. Ensure the connectivity between the Nagios client and the Nagios server:
Login into Nagios server 192.168.2.1 and run the below command, here we should get the nrpe version of the client.
[root@nagios-server ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.2.2
NRPE v2.15
We are done the installation of NRPE client, we will see the NRPE Configuration on Linux in other upcoming article.
Related Content on Linux might be useful to you to improve your Linux Skills.
How to Configure IP Address on Ubuntu using Netplan
How to Access Linux Server from Windows Remotely
Configure SSH Passwordless Login Authentication (SSH-keygen)
How to Create LVM Partition in Linux – LVM Tutorial
Install & Configure Samba Server on Linux (RHEL7 / CentOS7)
How to Access Linux Server from Windows Remotely
Configure SSH Passwordless Login Authentication (SSH-keygen)
How to Create LVM Partition in Linux – LVM Tutorial
Install & Configure Samba Server on Linux (RHEL7 / CentOS7)
Keep practicing and have fun. Leave your comments if any.
Support Us: Share with your friends and groups.Stay connected with us on social networking sites, Thank you.
0 Comments