Page 1 of 3

connect to address ... and port 12489 connection refused

Posted: Wed Oct 04, 2017 9:58 am
by inform
Hi,

I installed Nagios XI using the .ova file from http://www.nagios.com into my vmware vSphere.

Then i installed NSClient ++ (NSCP-0.5.1.44-x64) on my Exchange server.

Then i folowed another nagios guide to activate NRPE

using these commands :

cd "C:\Program Files\NSClient++"
nscp settings --activate-module NRPEServer --add-defaults
nscp settings --path /settings/NRPE/server --key "allow arguments" --set true
nscp settings --path /settings/NRPE/server --key "allow nasty characters" --set true
nscp settings --path /settings/NRPE/server --key insecure --set true
nscp settings --path /settings/NRPE/server --key "verify mode" --set none
nscp settings --activate-module CheckExternalScripts --add-defaults
nscp settings --path "/settings/external scripts" --key "allow arguments" --set true
nscp settings --path "/settings/external scripts" --key "allow nasty characters" --set true

I see my exchange server in the host and it is UP.

But i can't get any service status to work.

I get the error : Connect to adress 10.0.0.6 and port 12489: connection refused

Can anyone help me please?

Thanks

Re: connect to address ... and port 12489 connection refused

Posted: Wed Oct 04, 2017 10:21 am
by npolovenko
Hello, @inform! Could you also upload your NSC ini configuration file from the Exchange server? It's located on C:/ProgramFiles/NSClient++/nsclient.ini

Re: connect to address ... and port 12489 connection refused

Posted: Wed Oct 04, 2017 12:22 pm
by inform
npolovenko wrote:Hello, @inform! Could you also upload your NSC ini configuration file from the Exchange server? It's located on C:/ProgramFiles/NSClient++/nsclient.ini
Here it is

Thanks for your help.

Almir.

Re: connect to address ... and port 12489 connection refused

Posted: Wed Oct 04, 2017 1:16 pm
by bolson
From the command line on your Nagios XI host, run the following command and let us know if you're able to connect:

Code: Select all

telnet put_ip_addr_here 12489
If neccessary, run:

Code: Select all

yum -y install telnet

Re: connect to address ... and port 12489 connection refused

Posted: Wed Oct 04, 2017 1:21 pm
by mcapra
It looks as though NSClient++ is having trouble binding to port 12489. From your nsclient log file:

Code: Select all

2017-10-02 16:35:12: debug:c:\source\master\service\logger\nsclient_logger.cpp:52: Creating logger: threaded-file
2017-10-02 16:35:12: error:c:\source\master\include\socket/server.hpp:217: Failed to bind [::]:12489(ipv6): Une tentative d’accès à un socket de manière interdite par ses autorisations d’accès a été tentée
2017-10-02 16:35:13: error:c:\source\master\include\socket/server.hpp:217: Failed to bind [::]:12489(ipv6): Une tentative d’accès à un socket de manière interdite par ses autorisations d’accès a été tentée
2017-10-02 16:35:14: error:c:\source\master\include\socket/server.hpp:217: Failed to bind [::]:12489(ipv6): Une tentative d’accès à un socket de manière interdite par ses autorisations d’accès a été tentée
2017-10-02 16:35:14: error:c:\source\master\include\socket/server.hpp:165: Failed to setup endpoint
2017-10-02 16:35:14: error:c:\source\master\include\socket/server.hpp:217: Failed to bind 0.0.0.0:12489(ipv4): Une tentative d’accès à un socket de manière interdite par ses autorisations d’accès a été tentée
2017-10-02 16:35:15: error:c:\source\master\include\socket/server.hpp:217: Failed to bind 0.0.0.0:12489(ipv4): Une tentative d’accès à un socket de manière interdite par ses autorisations d’accès a été tentée
2017-10-02 16:35:16: error:c:\source\master\include\socket/server.hpp:217: Failed to bind 0.0.0.0:12489(ipv4): Une tentative d’accès à un socket de manière interdite par ses autorisations d’accès a été tentée
2017-10-02 16:35:16: error:c:\source\master\include\socket/server.hpp:165: Failed to setup endpoint
2017-10-02 16:35:16: error:c:\source\master\include\socket/server.hpp:170: NO endpoints available
My French is quite limited, but it sounds like the context in which NSClient++ is running doesn't have the proper permissions to bind to port 12489. If you run NSClient++ as administrator, does that solve the problems you're facing? If so, you might need to check your permissions.

You might also check to verify that no other applications on this server are binding to port 12489. Per this NSClient++ community thread:
https://forums.nsclient.org/t/0-5-0-62- ... ons/4325/2

Re: connect to address ... and port 12489 connection refused

Posted: Wed Oct 04, 2017 1:38 pm
by inform
bolson wrote:From the command line on your Nagios XI host, run the following command and let us know if you're able to connect:

Code: Select all

telnet put_ip_addr_here 12489
If neccessary, run:

Code: Select all

yum -y install telnet
First thanks alot for helping me.

From my Nagios XI host i get the same error.

Just to be sure i did the right thing :

1- Installed telnet like u told me
2- telnet 10.0.0.6 (my echange server ip) 12489

Re: connect to address ... and port 12489 connection refused

Posted: Wed Oct 04, 2017 1:53 pm
by bolson
This would either indicate that Windows Firewall is blocking the port or that the nsclient service is not listening on port 12489. On the Windows host, run the following from a command prompt:

Code: Select all

netstat -an | find "12489"
And see if the service shows up as listening. If it does, then it's almost surely being blocked by your firewall.

Re: connect to address ... and port 12489 connection refused

Posted: Wed Oct 04, 2017 2:29 pm
by inform
bolson wrote:This would either indicate that Windows Firewall is blocking the port or that the nsclient service is not listening on port 12489. On the Windows host, run the following from a command prompt:

Code: Select all

netstat -an | find "12489"
And see if the service shows up as listening. If it does, then it's almost surely being blocked by your firewall.
Windows Firewall on my exchange server is desactivated. i still checked in the allowed programs of the firewall and i saw NSClient ++, then i stoped the firewall service but i still have the same problem.

I run the command you told me.

but it give no resultats.

Re: connect to address ... and port 12489 connection refused

Posted: Wed Oct 04, 2017 2:34 pm
by inform
More information :

I installed NSClient ++ (NSCP-0.5.1.44-x64) on two more servers (Windows 2008 R2). And i have the same error.

Windows firewall on the servers are turned off.

I got Eset antivirus on thems, and i turned thems off, but still the same error.

Re: connect to address ... and port 12489 connection refused

Posted: Wed Oct 04, 2017 2:43 pm
by inform
mcapra wrote:It looks as though NSClient++ is having trouble binding to port 12489. From your nsclient log file:

My French is quite limited, but it sounds like the context in which NSClient++ is running doesn't have the proper permissions to bind to port 12489. If you run NSClient++ as administrator, does that solve the problems you're facing? If so, you might need to check your permissions.

You might also check to verify that no other applications on this server are binding to port 12489. Per this NSClient++ community thread:
https://forums.nsclient.org/t/0-5-0-62- ... ons/4325/2
When you say "if u run NSClient++ as administrator"

you mean the NSCP-0.5.1.44-x64.msi installation file? or u mean running a program as admin?

i can't seem to find any programs that i can run as admin in "C:\Program Files\NSClient++"

And since it is not en .exe but an msi, when i install it, i only have the option' install"

when i installed NSClient i was logged with administrator account on the server.

how can i check if anything else use that port on my server? and since i installed the NSclient on two more servers(and i got the same error), i doubt that it is an program on the server that use that port.

i still checked and i got no java installed (like the guy in the other forum)

here is a pic of what i got installed on the server