NRPE (Nagios Remote Plugin Executor) is used for executing Nagios plugins on remote client systems. In previous article we had described about installation of Nagios Server on Ubuntu operating system. This article will help you to install NRPE on Ubuntu 18.04 LTS, 16.04 LTS & LinuxMint 19/18 systems.
Useful Articles:
Step 1 – Install NRPE on Ubuntu
NRPE packages are available under the default repositories on Ubuntu systems. Open a terminal and run the following command to install:
sudo apt update sudo apt install nagios-nrpe-server nagios-plugins
Here nagios-nrpe-server package install service on system and nagios-plugins provides monitoring scripts, which is called with NRPE client on request of Nagios server.
Step 2 – Configure NRPE
In NRPE configuration, first we need to nrpe to which nagios servers it accepts requests, For example your Nagios server IP is 192.168.1.100, then add this IP to allowed hosts list. Edit NRPE configuration file /etc/nagios/nrpe.cfg and make the necessary changes like below:
sudo nano /etc/nagios/nrpe.cfg
allowed_hosts=127.0.0.1, 192.168.1.100
We can allow multiple Nagios servers by a comma-separated list.
Next, restart NRPE service. Now it is ready to listen to requests from Nagios server
sudo /etc/init.d/nagios-nrpe-server restart
Step 3 – Verify Connection
Let’s verify the connection between the Nagios server and NRPE client machine. Login to your Nagios server and check the Nagios server can communicate with NRPE service properly.
Use check_nrpe command on the Nagios server under the plugins directory. The command will be like as below here 192.168.1.11 is the IP address of client machine.
check_nrpe -H 192.168.1.11 NRPE v2.15
The output “NRPE v2.15” shows that the Nagios server successfully communicated with NRPE.
Step 4 – Add Check Commands in NRPE
All the services check commands with the nagios plugins packages, which is by default installed in /usr/lib/nagios/plugins/ for 32 bit systems. Default installation adds few commands in configuration file. Add more commands as per your requirements like below
vim /etc/nagios/nrpe.cfg
command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10 command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20 command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1 command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
Step 5 – Manage NRPE Service
Use the following commands to start, stop or restart NRPE service. Each time we make any changes in the configuration file required to restart service
sudo /etc/init.d/nagios-nrpe-server stop sudo /etc/init.d/nagios-nrpe-server start sudo /etc/init.d/nagios-nrpe-server restart
20 Comments
CHECK_NRPE: (ssl_err != 5) Error – Could not complete SSL handshake with 192.168.0.172: 1
how to resolve this issue
my nagios server is installed in ubuntu 18.04
and nrpe is installed in ubuntu 14.04
all the remote host which as ubuntu 18.04 has no issue but for the os version below 16.04 is facing this issue
This is probably due to the DH key being too small on the older ubuntu/nrpe. Try logging manually with “-g out.log -s -1” (example: /usr/local/nagios/libexec/check_nrpe -H ubuntu1404.example.com -g /tmp/out.log -s -1) and see if it says “dh key too small”. You may need to upgrade the version of nrpe you’re using on the older server.
Hi rahul
i have configured nagios on 50+ servers but for one of my server its showing this !!
for disk
DISK CRITICAL – /sys/kernel/debug/tracing is not accessible: Permission denied
For memory
NRPE: Unable to read output
Hi Tarandeep,
Which operating system are you using on your server?
check_nrpe results in “command not found” sir
(Return code of 255 is out of bounds)
Hi
i have installed the NRPE in one the server and I am trying to monitor the through the Nagios server I have little confusion about IP address
which IP address should give while defining the host in Nagios server whether it is public Ip or private IP
and the second one is in client side which Ip should I mention in whether it public Ip of Nagios server or the public Ip of Nagios server
If you are connecting NRPE with LAN IP then add private IP. If connecting through public IP then use Public.
HI..
I have done nagios core in ubuntu 16.04LTS then installed and configured nrpe plug in and nrpe server finally i got the below error
1153:~# check_nrpe -H 192.168.31.61
check_nrpe: command not found
check_nrpe not available .
Hello,
I have a 2 Ubuntu 17.04 Server, 1 with nagios installed and NRPE client (plugin) installed, the other with NRPE Server installed.
When I run check nrpe from the NRPE client, I have this result.
sheenlim08@Server1:/etc/nagios3/conf.d$ /usr/lib/nagios/plugins/check_nrpe -H 192.168.36.144 -c check_load
CHECK_NRPE: Error – Could not connect to 192.168.36.144: Connection reset by peer
sheenlim08@Server1:/etc/nagios3/conf.d$ tail /var/log/syslog
Aug 8 05:39:06 Server1 systemd[1]: Started Clean php session files.
Aug 8 05:46:38 Server1 dhclient[948]: DHCPREQUEST of 192.168.36.137 on ens33 to 192.168.36.254 port 67 (xid=0x483d61d1)
Aug 8 05:46:38 Server1 dhclient[948]: DHCPACK of 192.168.36.137 from 192.168.36.254
Aug 8 05:46:38 Server1 dhclient[948]: bound to 192.168.36.137 — renewal in 807 seconds.
Aug 8 05:49:55 Server1 check_nrpe: Error: Could not complete SSL handshake with 192.168.36.144: rc=-1 SSL-error=5
Aug 8 05:54:15 Server1 systemd[1682]: Time has been changed
Aug 8 05:54:15 Server1 systemd[1]: Time has been changed
Aug 8 05:54:15 Server1 systemd[1]: apt-daily.timer: Adding 7h 35min 17.413926s random time.
Aug 8 05:54:15 Server1 systemd[1]: snapd.refresh.timer: Adding 3h 28min 6.371800s random time.
Aug 8 05:56:09 Server1 check_nrpe: Error: Could not complete SSL handshake with 192.168.36.144: rc=-1 SSL-error=5
On the NRPE Server side, these are the logs that are shown.
sheenlim08@Server3:~$ tail /var/log/syslog
Aug 8 05:35:23 Server3 dhclient[878]: DHCPACK of 192.168.36.144 from 192.168.36.254
Aug 8 05:35:23 Server3 dhclient[878]: bound to 192.168.36.144 — renewal in 770 seconds.
Aug 8 05:46:07 Server3 kernel: [28496.550944] perf: interrupt took too long (3452 > 3148), lowering kernel.perf_event_max_sample_rate to 57750
Aug 8 05:48:13 Server3 dhclient[878]: DHCPREQUEST of 192.168.36.144 on ens33 to 192.168.36.254 port 67 (xid=0x2aed808)
Aug 8 05:48:13 Server3 dhclient[878]: DHCPACK of 192.168.36.144 from 192.168.36.254
Aug 8 05:48:13 Server3 dhclient[878]: bound to 192.168.36.144 — renewal in 824 seconds.
Aug 8 05:49:55 Server3 nrpe[15350]: Error: Request packet version was invalid!
Aug 8 05:49:55 Server3 nrpe[15350]: Could not read request from client 192.168.36.137, bailing out…
Aug 8 05:56:09 Server3 nrpe[15357]: Error: Request packet version was invalid!
Aug 8 05:56:09 Server3 nrpe[15357]: Could not read request from client 192.168.36.137, bailing out…
Any ideas why the SSL Handshake is failing? I’m just started to learn linux nagios and I’m quite lost.
It looks you didn’t allowed Nagios server in NRPE configuration. Please check Step 2.
Also, make sure NRPE port is accessible to Nagios server.
Hi Rahul,
Actually, I did.
I have added the server address where the “nagios-nrpe-server” is installed (which is the target server).
192.168.36.137 – Is the server where nagios is and the “nagios-nrpe-plugin” is installed.
Please see image below via link, I am being blocked by your website when posting the content of the nrpe.cfg
!ApePyXZrHH4NhvETTo34dpVlLigTcg
Hi Rahul,
For Nagios Server I am choosing ” Amazon Linux AMI 2017.03.0 (HVM), SSD Volume Type – ami-c58c1dd3 ”
And I try to add CentOs, Ubuntu, Windows Servers. It taking only Centos and AWS Linux servers, But I try to ADD Ubuntu And Window I am getting Error:
[root@ip-172-31-9-101 nagios]# vim nagios.cfg
[root@ip-172-31-9-101 nagios]# service nagios restart
Running configuration check… CONFIG ERROR! Restart aborted. Check your Nagios configuration.
If I uncomment the Ubuntu Path in Nagios.cfg file (Ubuntu Server :#cfg_file=/etc/nagios/servers/ProdAppEmpi.cfg), It’s Working.
[root@ip-172-31-9-101 nagios]# vim nagios.cfg
[root@ip-172-31-9-101 nagios]# service nagios restart
Running configuration check…done.
Stopping nagios: done.
Starting nagios: done.
Here My question is, does we choosing Centos for Nagios server it Accept only centos Server for Remote monitoring. And If we choose Ubuntu Does it accept only Ubuntu servers.
We do have any Option to add all types of NRPE (Remote Monitor Servers) to one Nagios Server(either centos r Ubuntu r windows..etc..) ?????
Hi Prabhu,
You can install Nagios on any OS and it will monitor everything. There will be some issue with ProdAppEmpi.cfg configuration file. Can you please show me this file content?
HI Rahul..i have been trying to install nagios for monitoring purpose. I have got the nagios dashbord also but the hosts i am adding are not reflecting. Kindly suggest which are the necessary confg files where i need to make changes? Also tell me how to configure email and sms alerts in nagios?
check_nrpe did not work until I added the /usr/lib/nagios/plugins into the environments file. Overall nice work.
I am getting this below error.
cpu_load
CRITICAL 04-23-2016 12:59:11 0d 21h 50m 33s 3/3 (No output on stdout) stderr: execvp(/usr/lib/nagios/plugins/check_nrpe, …) failed. errno is 2: No such file or directory
Myserver is centos4.0.8 and client is ubuntu
I have done all the steps i am able to communicate to client. i am getting the check_load also from server end.but it is not displayed on nagios web page.
This is all client side rick.
The problem with this explanation, every explanation so far, is that it isn’t clear weather your talking about the Nagios server or Client side configuration.