Socket Timeouts and Connection Refused Errors
Socket Timeouts and Connection Refused Errors
Have tried everything we can think of but we're getting a few Services with these two errors:
connect to address ######## and port 12489: Connection refused
and
Critical - Socket timeout
Have tried the following:
1. Reloaded software
2. Changed options on install
3. Added known good .ini file with added port settings
4. Ran netstat check
5. Checked ports with port query tool
6. Added exceptions to one server with firewall turn on. all other servers with issue, donot have firewall turned on.
7. Checked Nagios blogs
8. Adjusted time out settings from 10 - 30 seconds
See attached screen print.
Thanks,
Martin Keey
connect to address ######## and port 12489: Connection refused
and
Critical - Socket timeout
Have tried the following:
1. Reloaded software
2. Changed options on install
3. Added known good .ini file with added port settings
4. Ran netstat check
5. Checked ports with port query tool
6. Added exceptions to one server with firewall turn on. all other servers with issue, donot have firewall turned on.
7. Checked Nagios blogs
8. Adjusted time out settings from 10 - 30 seconds
See attached screen print.
Thanks,
Martin Keey
Last edited by benjaminsmith on Tue Feb 19, 2019 12:01 pm, edited 1 time in total.
Reason: images removed at request
Reason: images removed at request
Re: Socket Timeouts and Connection Refused Errors
Make sure you have the following entries in the nsclient.ini file:
Save, exit and restart the NSClient++ service on the Windows box.
If this doesn't fix your issue, please post the entire nsclient.ini file on the forum. Obfuscate sensitive data.
Save, exit and restart the NSClient++ service on the Windows box.
If this doesn't fix your issue, please post the entire nsclient.ini file on the forum. Obfuscate sensitive data.
Last edited by benjaminsmith on Tue Feb 19, 2019 12:01 pm, edited 1 time in total.
Reason: log removed at request
Reason: log removed at request
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Socket Timeouts and Connection Refused Errors
Added some lines that were missing. The error switch to the "could not fetch" error. So, we're closer!
Please note I changed the allowed hosts IP address to fictitious names.
# If you want to fill this file with all avalible options run the following command:
# nscp settings --generate --add-defaults --load-all
# If you want to activate a module and bring in all its options use:
# nscp settings --activate-module <MODULE NAME> --add-defaults
# For details run: nscp settings --help
; Undocumented section
[/settings/default]
; Undocumented key
allowed hosts = host names
; Undocumented section
[/modules]
; Undocumented key
CheckExternalScripts = 1
; Undocumented key
CheckHelpers = 1
; Undocumented key
CheckNSCP = 1
; Undocumented key
CheckEventLog = 1
; Undocumented key
CheckDisk = 1
; Undocumented key
CheckSystem = 1
; Undocumented key
NSClientServer = 1
; Section for NSClient (NSClientServer.dll) (check_nt) protocol options.
[/settings/NSClient/server]
; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 0
; PERFORMANCE DATA - Send performance data back to Nagios (set this to 0 to remove all performance data).
performance data = 1
; PORT NUMBER - Port to use for check_nt.
port = 12489
Please note I changed the allowed hosts IP address to fictitious names.
# If you want to fill this file with all avalible options run the following command:
# nscp settings --generate --add-defaults --load-all
# If you want to activate a module and bring in all its options use:
# nscp settings --activate-module <MODULE NAME> --add-defaults
# For details run: nscp settings --help
; Undocumented section
[/settings/default]
; Undocumented key
allowed hosts = host names
; Undocumented section
[/modules]
; Undocumented key
CheckExternalScripts = 1
; Undocumented key
CheckHelpers = 1
; Undocumented key
CheckNSCP = 1
; Undocumented key
CheckEventLog = 1
; Undocumented key
CheckDisk = 1
; Undocumented key
CheckSystem = 1
; Undocumented key
NSClientServer = 1
; Section for NSClient (NSClientServer.dll) (check_nt) protocol options.
[/settings/NSClient/server]
; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 0
; PERFORMANCE DATA - Send performance data back to Nagios (set this to 0 to remove all performance data).
performance data = 1
; PORT NUMBER - Port to use for check_nt.
port = 12489
Re: Socket Timeouts and Connection Refused Errors
Do you have hostnames (FQDN) or IPs on the "allowed hosts" line?
Are you sure, this is not a firewall issue? Can you run the following commands in the CLI on the Nagios XI server, and show the output? Hide sensitive info.
Did you check the nsclient.log for clues (more info)?allowed hosts = host names
Are you sure, this is not a firewall issue? Can you run the following commands in the CLI on the Nagios XI server, and show the output? Hide sensitive info.
Code: Select all
/usr/local/nagios/libexec/check_nt -H <windows ip> -p 12489 -s <password> -v CLIENTVERSION
nmap <windows ip> -p 12489Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Socket Timeouts and Connection Refused Errors
Agent is in the same domain so there isn't a firewall involved.
Ran command from XI server. Change agent server's IP to "ServerIpAddr"....
Also, we did not define a user/password for the agents.
PS - Checked windows firewall and it is not active on the box. This is a Win2003 R2 SP2 server.
Forgot! Sorry about that... Seeing these errors in the Agent Log...
2018-08-03 15:58:43: error:c:\source\nscp\include\check_nt/server/protocol.hpp:67: Rejected connection from: NagiosXIServerIpAddr
Ran command from XI server. Change agent server's IP to "ServerIpAddr"....
Also, we did not define a user/password for the agents.
PS - Checked windows firewall and it is not active on the box. This is a Win2003 R2 SP2 server.
Forgot! Sorry about that... Seeing these errors in the Agent Log...
2018-08-03 15:58:43: error:c:\source\nscp\include\check_nt/server/protocol.hpp:67: Rejected connection from: NagiosXIServerIpAddr
Last edited by benjaminsmith on Tue Feb 19, 2019 12:03 pm, edited 1 time in total.
Reason: code removed at request
Reason: code removed at request
Re: Socket Timeouts and Connection Refused Errors
Sorry if this seems redundant, but unless the variables are consistently used to hide sensitive info, we can't be sure the line has been updated correctly and the help from the nsclient site only points this as a being the cause of this message(https://docs.nsclient.org/faq/).
Make sure to restart nsclient after making any changes to the .ini file. Without a restart, the old settings will continue to be used.
Make sure to restart nsclient after making any changes to the .ini file. Without a restart, the old settings will continue to be used.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Socket Timeouts and Connection Refused Errors
Your statement: "restart the nsclient"
Reply... yes, we did that
Your question: "Does hostname == NagiosXIServerIpAddr"
Answer... Yes
Maybe this will be easier...
; Undocumented section
[/settings/default]
; Undocumented key
allowed hosts = ip addresses
; Undocumented section
[/modules]
; Undocumented key
CheckExternalScripts = 1
; Undocumented key
CheckHelpers = 1
; Undocumented key
CheckNSCP = 1
; Undocumented key
CheckEventLog = 1
; Undocumented key
CheckDisk = 1
; Undocumented key
CheckSystem = 1
; Undocumented key
NSClientServer = 1
; Section for NSClient (NSClientServer.dll) (check_nt) protocol options.
[/settings/NSClient/server]
; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 0
; PERFORMANCE DATA - Send performance data back to Nagios (set this to 0 to remove all performance data).
performance data = 1
; PORT NUMBER - Port to use for check_nt.
port = 12489
Reply... yes, we did that
Your question: "Does hostname == NagiosXIServerIpAddr"
Answer... Yes
Maybe this will be easier...
; Undocumented section
[/settings/default]
; Undocumented key
allowed hosts = ip addresses
; Undocumented section
[/modules]
; Undocumented key
CheckExternalScripts = 1
; Undocumented key
CheckHelpers = 1
; Undocumented key
CheckNSCP = 1
; Undocumented key
CheckEventLog = 1
; Undocumented key
CheckDisk = 1
; Undocumented key
CheckSystem = 1
; Undocumented key
NSClientServer = 1
; Section for NSClient (NSClientServer.dll) (check_nt) protocol options.
[/settings/NSClient/server]
; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 0
; PERFORMANCE DATA - Send performance data back to Nagios (set this to 0 to remove all performance data).
performance data = 1
; PORT NUMBER - Port to use for check_nt.
port = 12489
- rexconsulting
- Posts: 60
- Joined: Fri May 04, 2012 4:27 pm
- Location: Oakland, CA
- Contact:
Re: Socket Timeouts and Connection Refused Errors
I'm kind of wondering why anyone would use the unencrypted "check_nt" anymore, when NSClient++ works perfectly well in SSL mode with check_nrpe.
CP
--
Chris Paul
Rex Consulting, Inc
5652 Florence Terrace, Oakland, CA 94611
email: [email protected]
web: http://www.rexconsulting.net
phone, toll-free: +1 (888) 403-8996 ext 1
--
Chris Paul
Rex Consulting, Inc
5652 Florence Terrace, Oakland, CA 94611
email: [email protected]
web: http://www.rexconsulting.net
phone, toll-free: +1 (888) 403-8996 ext 1
Re: Socket Timeouts and Connection Refused Errors
@mkeey, did you run this as one command?
These are two separate commands:
and
Can you try running both commands again, and show the output? Obfuscate sensitive info.
These are two separate commands:
Code: Select all
/usr/local/nagios/libexec/check_nt -H <windows ip> -p 12489 -s <password> -v CLIENTVERSIONCode: Select all
nmap <windows ip> -p 12489
Last edited by benjaminsmith on Tue Feb 19, 2019 12:03 pm, edited 1 time in total.
Reason: log removed at request
Reason: log removed at request
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Socket Timeouts and Connection Refused Errors
My apologies, I did run it as one command. Here are the results of the separated commands...
Last edited by benjaminsmith on Tue Feb 19, 2019 12:04 pm, edited 1 time in total.
Reason: output removed at request
Reason: output removed at request