Page 1 of 1

NRPE v1.9 client with Nagios Xi nrpe v2.15

Posted: Mon Jan 11, 2016 10:31 pm
by steven.giang
Hi All,

I have trouble of getting both different NRPE version to exchange details, thanks you in advance and really appreciated for your help

OS: RHLE 4 (no subscriptions) this is the old machine which left by our ex-employee years and years and I believe never got maintenance
NRPE v1.9 (latest nrpe that I could update on the no subscription RHLE system) I ran an update from nrpe v1.5 up to nrpe v1.9
IP Address: 192.168.100.184

location of file:
configuration file - /usr/local/nagios/nrpe.conf
server file - /usr/local/nagios/nrpe
plugin - /usr/local/nagios/libexec

Command I have tried to troubleshoot the issue
nrpe01.JPG
/usr/local/nagios/nrpe.conf

Code: Select all

#############################################################################
# Sample NRPE Config File 
# Written by: Ethan Galstad ([email protected])
# 
# Last Modified: 06-03-2002
#
# NOTES:
# This is a sample configuration file for the NRPE daemon.  It needs to be
# located on the remote host that is running the NRPE daemon, not the host
# from which the check_nrpe client is being executed.
#############################################################################



# PORT NUMBER
# Port number we should wait for connections on.
# NOTE: This must be a non-priviledged port (i.e. > 1024).
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

server_port=5666



# SERVER ADDRESS
# Address that nrpe should bind to in case there are more than one interface
# and you do not want nrpe to bind on all interfaces.
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

#server_address=192.168.1.1



# ALLOWED HOST ADDRESSES
# This is a comma-delimited list of IP address of hosts that are allowed
# to talk to the NRPE daemon.
#
# NOTE: The daemon only does rudimentary checking of the client's IP
#       address.  I would highly recommend adding entries in your
#	/etc/hosts.allow file to allow only the specified host to connect
#	to the port you are running this daemon on.
#
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

allowed_hosts=127.0.0.1, 192.168.101.20



# NRPE USER
# This determines the effective user that the NRPE daemon should run as.  
# You can either supply a username or a UID.
# 
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

nrpe_user=nagios



# NRPE GROUP
# This determines the effective group that the NRPE daemon should run as.  
# You can either supply a group name or a GID.
# 
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

nrpe_group=nagios



# DEBUGGING OPTION
# This option determines whether or not debugging messages are logged to the
# syslog facility.
# Values: 0=debugging off, 1=debugging on

debug=0



# COMMAND DEFINITIONS
# Command definitions that this daemon will run.  Definitions
# are in the following format:
#
# command[<command_name>]=<command_line>
#
# When the daemon receives a request to return the results of <command_name>
# it will execute the command specified by the <command_line> argument.
#
# Unlike Nagios, the command line cannot contain macros - it must be
# typed exactly as it should be executed.
#
# Note: Any plugins that are used in the command lines must reside
# on the machine that this daemon is running on!  The examples below
# assume that you have plugins installed in a /usr/local/nagios/libexec
# directory.

#command[check_users]=/usr/local/nagios/libexec/check_users 380 395
command[check_load]=/usr/local/nagios/libexec/check_load -w 3,3,1 -c 5,4,3 
command[check_disk_slash]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /
command[check_disk_usr]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /usr
command[check_disk_var]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /var
command[check_disk_tmp]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /tmp
command[check_disk_run]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /run
command[check_disk_psd_apps]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /psd_apps
command[check_disk_home]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /home
command[check_disk_test]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /test
command[check_disk_temp]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /temp
command[check_disk_live]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /live
command[check_disk_pro]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /pro
command[check_disk_dbs]=/usr/local/nagios/libexec/check_disk -w 7% -c 5% /dbs
command[check_disk_logs]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /logs
command[check_disk_livetemp]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /livetemp
command[check_disk_reports]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /reports
command[check_disk_testtemp]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /testtemp
command[check_disk_testreports]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /testreports
command[check_disk_usrpronto]=/usr/local/nagios/libexec/check_disk -w 10% -c 7% /usr_pronto
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs 50 100 Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs 400 600 
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 60% -c 40% 
command[check_probatch]=/usr/local/nagios/libexec/check_probatch
# For the prowho below if you need it then unhash it and replace the "W" with
# the warnign user count and the "C" with the crotical user count eg 50 80
#command[check_prowho]=/usr/local/nagios/libexec/check_prowho W C
command[check_memory]=/usr/local/nagios/libexec/check_memory -t physical -w 10 -c 5
command[check_dns]=/usr/local/nagios/libexec/check_dns -H www.abtgroup.com.au -w 1 -c 5 
/etc/xinetd.d/nrpe

Code: Select all

# default: on
        # description: NRPE
        service nrpe
        {
                flags           = REUSE
                socket_type     = stream
                port            = 5666
                wait            = no
                user            = nagios
                group           = nagios
                server          = /usr/local/nagios/nrpe
                server_args     = -c /usr/local/nagios/nrpe.cfg --inetd
                log_on_failure  += USERID
                disable         = no
                only_from       = 127.0.0.1 192.168.101.20
        }

Centos 6.5
NRPE v2.15
When I ran the command from the Nagios xi server
[root@ABTG-NAG-01 libexec]# ./check_nrpe -H 192.168.100.184
This is the result shown on the client (ip address 192.168.100.184)

lsof -i:5666

Code: Select all

COMMAND   PID   USER   FD   TYPE DEVICE SIZE NODE NAME
nrpe      971 nagios    0u  IPv4 101876       TCP 192.168.100.184:nrpe->abtg-nag-01.abtgroup.com.au:59905 (ESTABLISHED)
nrpe      971 nagios    1u  IPv4 101876       TCP 192.168.100.184:nrpe->abtg-nag-01.abtgroup.com.au:59905 (ESTABLISHED)
nrpe      971 nagios    2u  IPv4 101876       TCP 192.168.100.184:nrpe->abtg-nag-01.abtgroup.com.au:59905 (ESTABLISHED)
xinetd  32716   root    5u  IPv4 100734       TCP *:nrpe (LISTEN)
tail -f /var/log/messages

Code: Select all

Jan 12 14:18:04 onestop xinetd[32716]: START: nrpe pid=872 from=192.168.101.20
Jan 12 14:18:15 onestop nrpe[872]: Could not read request from client, bailing out...
Jan 12 14:18:15 onestop xinetd[32716]: EXIT: nrpe status=0 pid=872 duration=11(sec)
Jan 12 14:20:31 onestop xinetd[32716]: START: nrpe pid=944 from=192.168.101.20
Jan 12 14:20:42 onestop nrpe[944]: Could not read request from client, bailing out...
Jan 12 14:20:42 onestop xinetd[32716]: EXIT: nrpe status=0 pid=944 duration=11(sec)
Jan 12 14:21:23 onestop xinetd[32716]: START: nrpe pid=971 from=192.168.101.20
Jan 12 14:21:33 onestop nrpe[971]: Could not read request from client, bailing out...
Jan 12 14:21:33 onestop xinetd[32716]: EXIT: nrpe status=0 pid=971 duration=10(sec)

Re: NRPE v1.9 client with Nagios Xi nrpe v2.15

Posted: Tue Jan 12, 2016 10:51 am
by hsmith
What happens if you add the "-n" flag to the end of the check_nrpe command? This version of NRPE predates me, but this could be part of the problem. We also have a common NRPE issue troubleshooting guide here: https://assets.nagios.com/downloads/nag ... utions.pdf, I'm not 100% sure if it is applicable in this scenario though.

Re: NRPE v1.9 client with Nagios Xi nrpe v2.15

Posted: Tue Jan 12, 2016 5:10 pm
by steven.giang
I did the no ssl "-n" check_nrpe result from the Nagios Xi

Code: Select all

[root@ABTG-NAG-01 libexec]# ./check_nrpe -H 192.168.100.184 -n
CHECK_NRPE: Socket timeout after 10 seconds.
I add extra -t 300

Code: Select all

[root@ABTG-NAG-01 libexec]# ./check_nrpe -H 192.168.100.184 -n -t 300
CHECK_NRPE: Received 0 bytes from daemon.  Check the remote server logs for error messages.
I did all the troubleshooting from that document and research on the internet already before I come here, I don't seem to find an NRPE compatibility by version at all.

I did tried to run the binary without xinetd on the remote host, and the result
/usr/local/nagios/nrpe -c /usr/local/nagios/nrpe.cfg --inetd

Code: Select all

Jan 13 09:04:33 onestop nrpe[2973]: Could not read request from client, bailing out...
Btw, I should of inform that this is a migration so basically the new Nagios xi server with NRPE v2.15 , the old server is Nagios core and with NRPE v2.13 (the remote host is working with the nagios core)

I believe this is more to do with the Nagios xi the way it run compared to nagios core. Guys if there is a change there should be a known issue by now from Nagios.

I found a very similar issue related to after the upgrade from nagios core to nagios xi
https://support.nagios.com/forum/viewto ... =6&t=36448

Re: NRPE v1.9 client with Nagios Xi nrpe v2.15

Posted: Wed Jan 13, 2016 3:37 pm
by lmiltchev
What is the error that you are getting if you DON'T pass the '-n' flag? Show the output of the following commands run on the Nagios XI box:

Code: Select all

ip addr
nmap 192.168.100.184 -p 5666
./check_nrpe -H 192.168.100.184
Run the following commands on the client machine and show the output:

Code: Select all

ps auxw | grep nrpe
netstat -at | grep nrpe

Re: NRPE v1.9 client with Nagios Xi nrpe v2.15

Posted: Thu Jan 14, 2016 12:55 am
by steven.giang
ip addr

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:50:56:a4:4f:aa brd ff:ff:ff:ff:ff:ff
    inet 192.168.101.20/24 brd 192.168.101.255 scope global eth0
    inet6 fe80::250:56ff:fea4:4faa/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:50:56:a4:21:55 brd ff:ff:ff:ff:ff:ff
    inet 192.168.102.20/24 brd 192.168.102.255 scope global eth1
    inet6 fe80::250:56ff:fea4:2155/64 scope link
       valid_lft forever preferred_lft forever
nmap 192.168.100.184 -p 5666

Code: Select all

Starting Nmap 5.51 ( http://nmap.org ) at 2016-01-14 16:43 AEDT
Nmap scan report for 192.168.100.184
Host is up (0.0012s latency).
PORT     STATE SERVICE
5666/tcp open  nrpe

Nmap done: 1 IP address (1 host up) scanned in 0.10 seconds
./check_nrpe -H 192.168.100.184

Code: Select all

[root@ABTG-NAG-01 libexec]# ./check_nrpe -H 192.168.100.184
CHECK_NRPE: Socket timeout after 10 seconds.
ps auxw | grep nrpe

Code: Select all

root     16481  0.0  0.0   3908   664 pts/1    S+   16:42   0:00 grep nrpe
netstat -at | grep nrpe

Code: Select all

tcp        0      0 *:nrpe                      *:*                         LISTEN
tcp        0      0 192.168.100.184:nrpe        abtg-nag-01.abtgroup.:59690 TIME_WAIT

Re: NRPE v1.9 client with Nagios Xi nrpe v2.15

Posted: Thu Jan 14, 2016 12:42 pm
by hsmith
Do you have port 5666 open in your firewall?

Re: NRPE v1.9 client with Nagios Xi nrpe v2.15

Posted: Wed Feb 24, 2016 6:26 pm
by steven.giang
Hi,

Been awhile and I should provide the resolution of my own issue and it is all working now.

Since getting the old nrpe (none-SSL) box to talk with the newer Nagios Xi system, By default Nagios Xi used SSL.

All I have to do is compile NRPE and Nagios-Plugin on the old Linux box with disable SSL. Please note this is work for my own environment and I won't take any responsibility to the the below guide

############################################
NRPE v2.15
COMMAND
$ ./configure --disable-ssl --enable-command-args
$ make all
$ make install-plugin
$ make install-daemon
$ make install-daemon-config
$ make install-xinetd

Nagios-plugin 2.1.1
COMMAND
$ ./configure --prefix=/usr/local/nagios --with-cgiurl=/nagios/cgi-bin
$ make
$ make install
###############################################

Thanks to the team who were keen to support the issue.

Admin please mark this as resolved.

Steve

Re: NRPE v1.9 client with Nagios Xi nrpe v2.15

Posted: Thu Feb 25, 2016 10:44 am
by rkennedy
Awesome! Thanks for coming back and posting your resolution.

Marking this one as resolved, and closing it up. Feel free to create a new thread if you ever need assistance in the future.