Issues with NRPE Monitoring for a Linux Server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by venturegardengroup »

See output below:

[root@localhost ~]# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 ens192
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 ens160
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens192
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens160
[root@localhost ~]#


Regards,
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Issues with NRPE Monitoring for a Linux Server

Post by lmiltchev »

On the client, change the following line in the "/etc/xinetd.d/nrpe" from this:

Code: Select all

only_from       = 127.0.0.1 192.168.0.155
to this:

Code: Select all

only_from       = 127.0.0.1 192.168.0.155 192.168.0.250
and restart xinetd:

Code: Select all

service xinetd restart
Next, test it from the CLI by running on the nagios server:

Code: Select all

./check_nrpe -H <client ip>
Did this help?
Be sure to check out our Knowledgebase for helpful articles and solutions!
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by venturegardengroup »

See output below:

[root@localhost ~]# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 ens192
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 ens160
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens192
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens160
[root@localhost ~]#
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by venturegardengroup »

I have run the commands on both the client and the Nagios server; for the Nagios server see output I got below:

[root@localhost /]# ./check_nrpe -H 197.253.1.248
-bash: ./check_nrpe: No such file or directory
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by rkennedy »

venturegardengroup wrote:I have run the commands on both the client and the Nagios server; for the Nagios server see output I got below:

[root@localhost /]# ./check_nrpe -H 197.253.1.248
-bash: ./check_nrpe: No such file or directory
Did you make changes to the /etc/xinetd.d/nrpe file that @lmiltchev mentioned?

You need to be in the directory nrpe is installed. Try /usr/local/nagios/libexec/check_nrpe -H 197.253.1.248
Former Nagios Employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Issues with NRPE Monitoring for a Linux Server

Post by lmiltchev »

[root@localhost /]# ./check_nrpe -H 197.253.1.248
-bash: ./check_nrpe: No such file or directory
You can run "./check_nrpe" from within the "libexec" directory (where your plugins are located), i.e.

Code: Select all

cd /usr/local/nagios/libexec
./check_nrpe -H 197.253.1.248
or you can provide the full path:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 197.253.1.248
Be sure to check out our Knowledgebase for helpful articles and solutions!
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by venturegardengroup »

See output below;

[root@localhost /]# /usr/local/nagios/libexec/check_nrpe -H 197.253.1.248
CHECK_NRPE: Error - Could not complete SSL handshake.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Issues with NRPE Monitoring for a Linux Server

Post by lmiltchev »

I noticed something I didn't catch on the previous post. When you ran "ip addr" on the client, you showed us a different IP address - 192.168.3.11...
root@ERP-UAT-APP:/home/xpansa# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:8c:68:cc brd ff:ff:ff:ff:ff:ff
inet 192.168.3.11/24 brd 192.168.3.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::250:56ff:fe8c:68cc/64 scope link
valid_lft forever preferred_lft forever
Why are you running your check against the 197.253.1.248 IP address? What is the output of the following command?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.3.11
Be sure to check out our Knowledgebase for helpful articles and solutions!
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by venturegardengroup »

The 197.253.1.248 is the Internet facing IP of the linux server, whereas the 192.168.3.11 is on the local LAN. The Nagios server has no direct communication path to the client machine on 192.168.3.11 only on the 197.253.1.248 address.

[root@localhost /]# /usr/local/nagios/libexec/check_nrpe -H 192.168.3.11
CHECK_NRPE: Socket timeout after 10 seconds.
You have mail in /var/spool/mail/root
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by tgriep »

If you are trying to test the remote host across the internet, you would have to add the IP address of the internet facing side of the router the Nagios XI server is behind to the /etc/xinetd/nrpe file on the remove server and restart xinetd for the changes to take effect.
Try that and let us know if this helps.
Since the router is NATing the XI server, you will have to do this so the NRPE agent on the remote system allows the correct IP address in for running the checks.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked