Page 1 of 1

CHECK_NRPE:Error -Could not connect to remote ip: Connection

Posted: Wed Mar 11, 2020 6:53 am
by mailtosudha0820
Hi Team,

After installing nrpe plugin in remote machine (ubuntu 16.x version ) . Check_* commands are failing due to below error from nagios machine
error :
=====
CHECK_NRPE: Error - Could not connect to 13.232.218.201: Connection reset by peer.

but when i checked in remote machine check_* commands working but not from nagios machine.
Commands used from nagios :-
=========================
/usr/local/nagios/libexec/check_nrpe -H 13.232.218.201 -c check_load
CHECK_NRPE: Error - Could not connect to 13.232.218.201: Connection reset by peer


Below are our observations:
=======================

Telnet connectivity is fine from nagios to (remote machine) 13.232.218.201, port 5666 reachable.

nrpe running in remote machine.( commands used : sudo /etc/init.d/nagios-nrpe-server status )

Please help us to fix this issue.

Regards,
Sudhakar Amineni

Re: CHECK_NRPE:Error -Could not connect to remote ip: Connec

Posted: Wed Mar 11, 2020 2:36 pm
by scottwilkerson
Do you have your nagios server IP in the nrpe.cfg?

Can you show the output of the following from 13.232.218.201

Code: Select all

netstat -nlp|grep 5666

Re: CHECK_NRPE:Error -Could not connect to remote ip: Connec

Posted: Thu Mar 12, 2020 8:35 am
by mailtosudha0820
Hi Scott,

Thanks for your feedabck.
Yes, I have allowed nagios IP in remote server as like below format in nrpe.cfg in remote server.

allowed_hosts=127.0.0.1,172.31.32.238,162.20.82.77

Please find below output from remote (13.232.218.201) server.
cmd : sudo netstat -nlp|grep 5666
Output/
ubuntu@ip-192-168-20-101:~$ sudo netstat -nlp|grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 9091/nrpe
tcp6 0 0 :::5666 :::* LISTEN 9091/nrpe

without sudo :
===========
ubuntu@ip-192-168-20-101:~$ netstat -nlp|grep 5666
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN -
tcp6 0 0 :::5666 :::* LISTEN -


Please help us to fix this issue.let me know if required additional information to troubleshoot this issue.

Regards,
Sudhakar Amineni.

Re: CHECK_NRPE:Error -Could not connect to remote ip: Connec

Posted: Thu Mar 12, 2020 3:34 pm
by scottwilkerson
Can you show the following from the Nagios server

Code: Select all

/usr/local/nagios/libexec/check_nrpe -h|head -10
and the following from the remote machine

Code: Select all

/usr/local/nagios/bin/nrpe -h|head -20
The path to nrpe may vary on the remote machine, if you aren't sure where it is you can run the following to see its path

Code: Select all

ps -ef|grep nrpe

Re: CHECK_NRPE:Error -Could not connect to remote ip: Connec

Posted: Fri Mar 13, 2020 2:59 am
by mailtosudha0820
Hi Scott,

Thanks for your reply.

in nagios server
==================

ubuntu@ip-172-31-32-238:~$ ps -ef | grep nrpe
ubuntu 22502 10098 0 07:25 pts/0 00:00:00 grep --color=auto nrpe
nagios 24858 1 0 Mar12 ? 00:00:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

ubuntu@ip-172-31-32-238:~$ /usr/local/nagios/libexec/check_nrpe -h| head -10
NRPE Plugin for Nagios
Version: 3.2.1

Copyright (c) 2009-2017 Nagios Enterprises
1999-2008 Ethan Galstad ([email protected])

Last Modified: 2017-09-01

License: GPL v2 with exemptions (-l for more info)

in below path from nagios server.
/usr/local/nagios/bin/nrpe
ubuntu@ip-172-31-32-238:~$ /usr/local/nagios/bin/nrpe -h|head -20
==================================================================
Incorrect command line arguments supplied

NRPE - Nagios Remote Plugin Executor
Version: 3.2.1

Copyright (c) 2009-2017 Nagios Enterprises
1999-2008 Ethan Galstad ([email protected])

Last Modified: 2017-09-01

License: GPL v2 with exemptions (-l for more info)

SSL/TLS Available, OpenSSL 0.9.6 or higher required

***************************************************************
** POSSIBLE SECURITY RISK - TCP WRAPPERS ARE NOT AVAILABLE! **
** Read the NRPE SECURITY file for more information **
***************************************************************

from Remote server
====================

output of cmd : ps -ef | grep nrpe

ubuntu@ip-192-168-20-101:~$ ps -ef | grep nrpe
ubuntu 8400 7757 0 12:53 pts/273 00:00:00 grep --color=auto nrpe
nagios 9091 1 0 Mar11 ? 00:00:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -n -d
ubuntu@ip-192-168-20-101:~$ /usr/local/nagios/bin/nrpe -h|head -20

Incorrect command line arguments supplied

NRPE - Nagios Remote Plugin Executor
Version: 3.2.1

Copyright (c) 2009-2017 Nagios Enterprises
1999-2008 Ethan Galstad ([email protected])

Last Modified: 2017-09-01

License: GPL v2 with exemptions (-l for more info)

SSL/TLS Available, OpenSSL 0.9.6 or higher required

***************************************************************
** POSSIBLE SECURITY RISK - COMMAND ARGUMENTS ARE SUPPORTED! **
** Read the NRPE SECURITY file for more information **
***************************************************************



CMD : ps -ef | grep nrpe
Output is same in nagios server and remote server.
Please review above.

thanks in advance

Regards,
Sudhakar Amineni

Re: CHECK_NRPE:Error -Could not connect to remote ip: Connec

Posted: Fri Mar 13, 2020 4:27 pm
by scottwilkerson
Does a simple version check work?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 13.232.218.201