Page 1 of 5

CHECK_NRPE: Error

Posted: Mon Nov 05, 2018 10:49 am
by BrunoLosse1
Guys,

I've been having a lot of issues trying to configure Nagios Core to monitor some servers.
After a lot of research and settings at my servers I got lost.

My last problem is that I'm receiving the message: CHECK_NRPE: Error - Could not connect to 10.63.248.105: Connection reset by peer.

So here's my Settings:
Nagios Version: 4.4.2
Ubuntu Version: 16.4
NSClient at Windows Server: 0.5.2035

I'm uploading the ini file and the log file.

Can someone help me make the check NRPE work?

Re: CHECK_NRPE: Error

Posted: Mon Nov 05, 2018 4:11 pm
by benjaminsmith
Hi @ BrunoLosse1

This type of error is often caused by the NRPE settings ( nrpre.cfg) are not set to allow communication with the Nagios server IP. I know you were setting up some other checks recently, were you having trouble with NRPE then?

Please verifty that the line allowed_hosts=127.0.0.1,<Nagios server ip> in the NRPE configuration file contains your Nagios IP address.

For more documentation see this:
CHECK_NRPE: Error - Could not connect to xxx.xxx.xxx.xxx: Connection reset by peer
https://support.nagios.com/forum/viewto ... 048#266568

Re: CHECK_NRPE: Error

Posted: Mon Nov 05, 2018 4:51 pm
by BrunoLosse1
But I'm monitoring a Windows Server, the allowed Server is supposed to be at the nsclient.ini right?
There's no nrpe.cfg at my Ubuntu Server.

Re: CHECK_NRPE: Error

Posted: Tue Nov 06, 2018 11:17 am
by benjaminsmith
Ok, lets first make sure Nagios can reach the Windows server using the check_nrpe command. On your Nagios server let me know if your able to run the following command:

Code: Select all

cd /usr/local/nagios/libexec
./check_nrpe -H 10.10.83.94
Where 10.10.83.94 is the ip address of your windows server from the nsclient.ini file.

Re: CHECK_NRPE: Error

Posted: Tue Nov 06, 2018 11:38 am
by BrunoLosse1
benjaminsmith wrote:Ok, lets first make sure Nagios can reach the Windows server using the check_nrpe command. On your Nagios server let me know if your able to run the following command:

Code: Select all

cd /usr/local/nagios/libexec
./check_nrpe -H 10.10.83.94
Where 10.10.83.94 is the ip address of your windows server from the nsclient.ini file.
Yesterday I realised that I had the wrong IP at the allowed hosts under [/settings/NRPE/server] because I copied and pasted the whole .ini from another post I was reading here.

I still have problems with the NRPE after fixing it thou.

Here's the results of the command you gave me:

Using my remote host IP:

administrator@GEUL3BNAGPAS01:/usr/local/nagios/libexec$ ./check_nrpe -H 10.63.248.105
CHECK_NRPE STATE CRITICAL: Socket timeout after 10 seconds.

Using my nagios server IP:

administrator@GEUL3BNAGPAS01:/usr/local/nagios/libexec$ ./check_nrpe -H 10.63.248.131
CHECK_NRPE: Error - Could not connect to 10.63.248.131: Connection reset by peer

Re: CHECK_NRPE: Error

Posted: Tue Nov 06, 2018 12:18 pm
by benjaminsmith
After making changes to your nsclient.ini file, did you restart the service? Are you able to ping the windows box from Nagios?

Our documenation on how to setup Nsclient++ on WIndows for NRPE:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: CHECK_NRPE: Error

Posted: Tue Nov 06, 2018 12:34 pm
by BrunoLosse1
Yes, I always restart the service.
Yes, I can ping.

The docummentation is for NSClient++ 0.4.x but mine is 0.5.2035 and Nagios XI mine is core.
Does it apply?

Re: CHECK_NRPE: Error

Posted: Tue Nov 06, 2018 2:02 pm
by BrunoLosse1
benjaminsmith wrote:After making changes to your nsclient.ini file, did you restart the service? Are you able to ping the windows box from Nagios?

Our documenation on how to setup Nsclient++ on WIndows for NRPE:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
After following the steps I got this error: CHECK_NRPE: (ssl_err != 5) Error - Could not complete SSL handshake with 10.63.228.51: 1

I'll attach my .ini again.
There are a lot of "UNKNOWN" there, is it normal?

Re: CHECK_NRPE: Error

Posted: Tue Nov 06, 2018 3:41 pm
by benjaminsmith
Hello,

Thank you for the updated ini file, and let's try to make a few changes.

1. At the the top of the file, you'll find a setting for allowed hosts = 10.63.248.131. Make sure that is set to your Nagios server ip.

2. At line number 31, set the ssl options to ssl options =.

Lastly, if your're still having trouble, please try using the attached nsclient.ini file along with the correct entries for allowed host and password.

Let me know if you're able to get it working.

Re: CHECK_NRPE: Error

Posted: Wed Nov 07, 2018 7:38 am
by BrunoLosse1
The IP is correct, I changed what you said and didnt work, also tried using your .ini and it didnt work either.
I tried not using a password as well to see if anything changes but still the same.

I'll Upload the log, my commands.cfg and windows.cfg, maybe there's something wrong there.

Thank you so much for the attention by the way. I'm almost freaking out with this project.


This is the mess that is my current Web Interface lol
https://imgur.com/a/dWsef3T
Image

And my Objects directory is like that with duplicate files with a "~"
Do you know what that means?

https://imgur.com/a/OktmbFU
Image