Page 2 of 4

Re: Issues with NRPE Monitoring for a Linux Server

Posted: Mon Jul 11, 2016 10:33 am
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,

Re: Issues with NRPE Monitoring for a Linux Server

Posted: Mon Jul 11, 2016 11:23 am
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?

Re: Issues with NRPE Monitoring for a Linux Server

Posted: Tue Jul 12, 2016 4:55 am
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 ~]#

Re: Issues with NRPE Monitoring for a Linux Server

Posted: Tue Jul 12, 2016 5:14 am
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

Re: Issues with NRPE Monitoring for a Linux Server

Posted: Tue Jul 12, 2016 9:36 am
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

Re: Issues with NRPE Monitoring for a Linux Server

Posted: Tue Jul 12, 2016 9:39 am
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

Re: Issues with NRPE Monitoring for a Linux Server

Posted: Tue Jul 12, 2016 10:34 am
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.

Re: Issues with NRPE Monitoring for a Linux Server

Posted: Tue Jul 12, 2016 10:52 am
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

Re: Issues with NRPE Monitoring for a Linux Server

Posted: Tue Jul 12, 2016 11:31 am
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

Re: Issues with NRPE Monitoring for a Linux Server

Posted: Tue Jul 12, 2016 12:00 pm
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.