"Connection Refused" on local network
"Connection Refused" on local network
I've got my Nagios server configured with two NICs. One is a 192.168.1.xx and the other is my public IP xx.xx.xx.xx My remote servers that are not in my local network have no problem connecting and talking to Nagios using the public IP address. However the Windows machines in my local network get a "Connection Refused" status wether or not I use the public IP or the internal IP address. I have added a firewall exception for port 12489 AND THE NSClient++/exe is running.
How do I troubleshoot this?
How do I troubleshoot this?
Re: "Connection Refused" on local network
Did you add both IP addresses to the nsc.ini file (on this line)?
Note: After any change in the nsc.ini file, you must restart the nsclient++ service, so that the changes can take effect.
I would suggest testing it from the command line first. Run something simple from the command line and check the output, for example:
Code: Select all
allowed_hosts=I would suggest testing it from the command line first. Run something simple from the command line and check the output, for example:
Code: Select all
# cd /usr/local/nagios/libexec
# ./check_nt -H <your_target_machine_IP_address> -s <your_password> -p 12489 -v MEMUSE -w 80 -c 90Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: "Connection Refused" on local network
Thanks for the quick reply. I did add both to the NSC.ini file and the command you suggested I run returned with [root@localhost libexec]# ./check_nt -H 192.168.1.9 -s <mypass> -p 12489 -v MEMUSE -w 80 -c 90lmiltchev wrote:Did you add both IP addresses to the nsc.ini file (on this line)?Note: After any change in the nsc.ini file, you must restart the nsclient++ service, so that the changes can take effect.Code: Select all
allowed_hosts=
I would suggest testing it from the command line first. Run something simple from the command line and check the output, for example:Code: Select all
# cd /usr/local/nagios/libexec # ./check_nt -H <your_target_machine_IP_address> -s <your_password> -p 12489 -v MEMUSE -w 80 -c 90
Connection refused
could not fetch information from server
Re: "Connection Refused" on local network
Can you telnet to port 12489 from your Nagios server?
Also, on your windows machine you can open a Command Prompt (Run->cmd.exe->Enter) and run:
You can then open the "openports.txt" file in a text editor and see if port 12489 is listening.
Code: Select all
# telnet <target_machine_IP_address> 12489Code: Select all
# netstat -an |find /i "listening" > c:openports.txtBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: "Connection Refused" on local network
I cannot "connection refused"lmiltchev wrote:Can you telnet to port 12489 from your Nagios server?Code: Select all
# telnet <target_machine_IP_address> 12489
netstat does not show that the port is listening! even after I ran netsh to open the port withlmiltchev wrote:Also, on your windows machine you can open a Command Prompt (Run->cmd.exe->Enter) and run:You can then open the "openports.txt" file in a text editor and see if port 12489 is listening.Code: Select all
# netstat -an |find /i "listening" > c:openports.txt
Code: Select all
netsh firewall>set portopening tcp 12489
IMPORTANT: Command executed successfully.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: "Connection Refused" on local network
in your nsc.ini, in the [modules] section, make sure you have
not
The NSClientListener.dll is what will listen on port 12489. If you make this change, restart the NSClient++ service and try again.
Code: Select all
NSClientListener.dllCode: Select all
;NSClientListener.dllRe: "Connection Refused" on local network
Done. Still not listening...scottwilkerson wrote:in your nsc.ini, in the [modules] section, make sure you havenotCode: Select all
NSClientListener.dllThe NSClientListener.dll is what will listen on port 12489. If you make this change, restart the NSClient++ service and try again.Code: Select all
;NSClientListener.dll
One thing that is striking me as different is that the machine in my local network is requesting administrative permission every time I start and stop the service, whereas my remote servers did not...
EDIT: I uninstalled NSClient++ and reinstalled it as the Domain Admin account instead of my sysadmin user account. 12489 port is now open, i can telnet to it. The error message in Nagios has now changed to "could not fetch information from server"
Re: "Connection Refused" on local network
When you run your check from the command line, do you use the same password as the one listed in the nsc.ini file? You can play around with this - changing and/or temporarily removing the password altogether.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: "Connection Refused" on local network
There is no password set for this machine as it is internal.lmiltchev wrote:When you run your check from the command line, do you use the same password as the one listed in the nsc.ini file? You can play around with this - changing and/or temporarily removing the password altogether.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: "Connection Refused" on local network
Ludmil was referring to the passphrase in the nsc.ini and on the server. They need to share and use the same passwordwhitetree wrote: There is no password set for this machine as it is internal.