Page 1 of 1

Connection refused

Posted: Mon Jun 07, 2021 5:27 am
by kalyanpabolu
Hi Team,

We are getting "connection refused" error while monitoring a windows machine using NSClient. We have already opened 12489 port. Also, the config file looks fine to me.

Please suggest how to resolve this error.

Re: Connection refused

Posted: Mon Jun 07, 2021 1:30 pm
by vtrac
Hi,
How are you doing?

Could you please try the below command on your Nagios XI prompt?
Just want to see if you can communicate with the remote NSClient++ machine.
Please upload outputs of this command.

Code: Select all

nmap -Pn -p 12489 x.x.x.x
Example:
nmap -Pn -p 12489 x.x.x.x

Code: Select all

Starting Nmap 6.47 ( http://nmap.org ) at 2021-06-07 13:15 CDT
Nmap scan report for x.x.x.x
Host is up (0.0029s latency).
PORT      STATE SERVICE
12489/tcp open  unknown
MAC Address: F8:0B:CB:27:F4:00 (Unknown)
Install NSClient:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Configure NSClient:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Please run the below command on your Nagios XI prompt and also share outputs:
Please replace "x.x.x.x" with the IP of your remote NSClient machine and "yourNSClientPassword" inside
C:\Program Files\NSClient++\nsclient.ini file.

Code: Select all

/usr/local/nagios/libexec/check_nt -H x.x.x.x -p 12489 -s 'yourNSClientPassword' -v CPULOAD -l 5,80,90
Best Regards,
Vinh

Re: Connection refused

Posted: Mon Jun 14, 2021 1:40 am
by kalyanpabolu
Hello Team,

I think there are some changes required in config file. I can see two config files and not sure what changes are required.
Could you please check and suggest?

Re: Connection refused

Posted: Mon Jun 14, 2021 11:14 am
by vtrac
Hi,
How are you doing?
What version of NSClient++ are you running?

The configuration file in NSClient++ 0.3.x is called "NSC.ini" .... (very old, you might want to rename this to something else like "NSC.ini.old" .... and upgrade if you are still using the 0.3.x version.)

The configuration file in NSClient++ 0.4.x(or newer) is called "nsclient.ini".

I currently have NSClient++ 0.5.x installed and the configuration file is called "nsclient.ini".

Please upgrade your NSCleint++ to the 0.4.x or 0.5.x, if you can.

I have attached my "nsclient.ini" below and can be used as an example.
nsclient.ini
Best Regards,
Vinh