Page 1 of 2
Connection refused " status" Help
Posted: Fri Jan 06, 2012 12:53 pm
by bviscount
Hi,
I have been tasked with the setting up of nagios xi for a proof of concept here at my office. I have been on the end-user side of things as part of the monitoring team using nagios at my previous company. This would be my first configuration from the backend. I am running nagios xi from the prebuilt vmware package on CentOS. I have installed the correct NSClient++ on my windows pc's. When monitor a windows box and go through the config wizard everything goes fine but after the initial service check the only service that comes back with "real" data is Ping. CPU usage, Disk usage memory usage and uptime all come back as "connection refused" and I don't know why or how to resolve the issue. Sounds like these checks are being blocked or I missed some plugin to install. Can someone shed some light on this please. If I left any info out that is needed please ask. Thanks.
Re: Connection refused " status" Help
Posted: Fri Jan 06, 2012 4:22 pm
by scottwilkerson
There are a quite a few thinks that need to be in place when using NSClient++
Did you set the allowed_hosts in the NSC.ini file in the NSClient++ directory?
Is the NSClient++ service running?
Is there a firewall that could be blocking port 5666?
Finally, can you look at the nsclient.log ?
Here are some additional resources
http://assets.nagios.com/downloads/nagi ... _Agent.pdf
http://assets.nagios.com/downloads/nagi ... Client.pdf
Re: Connection refused " status" Help
Posted: Mon Jan 09, 2012 10:39 am
by bviscount
Thanks, the NSClient++ service was not running so I started that and modified the .ini for it. After that, the new service status info is now "could not fetch information from server" I do not have a firewall blocking it.
Re: Connection refused " status" Help
Posted: Mon Jan 09, 2012 11:12 am
by lmiltchev
Make sure port 12489 is not blocked. Also, after ANY change in the nsc.ini, you must restart the nsclient++ service, so the changes can take effect.
Can you run the following command from the command line and post the output?
Code: Select all
# ./check_nt -H <your_target_machine's_IP_address> -s <your_password> -p 12489 -v MEMUSE -w 80 -c 90
Re: Connection refused " status" Help
Posted: Mon Jan 09, 2012 11:22 am
by bviscount
output:
-bash: ./check_nt: No such file or directory
Re: Connection refused " status" Help
Posted: Mon Jan 09, 2012 11:26 am
by lmiltchev
My bad. Forgot to mention that you have to start this command from your plugins' directory on your nagios server:
Code: Select all
# cd /usr/local/nagios/libexec
# ./check_nt -H <your_target_machine's_IP_address> -s <your_password> -p 12489 -v MEMUSE -w 80 -c 90
Re: Connection refused " status" Help
Posted: Mon Jan 09, 2012 11:45 am
by bviscount
I seemed to get output this time. Forgive me for for being a noob but how can I copy the output from the terminal and paste outside of the vm?
btw, the output I received seems to be "help" or examples and definitions of the check command.
Re: Connection refused " status" Help
Posted: Mon Jan 09, 2012 12:04 pm
by scottwilkerson
bviscount wrote:I seemed to get output this time. Forgive me for for being a noob but how can I copy the output from the terminal and paste outside of the vm?
btw, the output I received seems to be "help" or examples and definitions of the check command.
I am guessing you used a lowercase -h instead of the required capital -H
As for copying text from the VM, it is much easier if you connect to the VM with an SSH client like PuTTY
http://www.chiark.greenend.org.uk/~sgtatham/putty/
Re: Connection refused " status" Help
Posted: Mon Jan 09, 2012 12:14 pm
by bviscount
Output:
could not fetch information from server
[root@localhost libexec]# could not fetch information from server
tx for the putty advice.
Re: Connection refused " status" Help
Posted: Mon Jan 09, 2012 1:39 pm
by lmiltchev
Did you check if your port 12489 is open?
On your windows machine you can open a Command Prompt (Run->cmd.exe->Enter) and run:
Code: Select all
# netstat -an |find /i "listening" > c:openports.txt
You can then open the "openports.txt" file in a text editor and see if port 12489 is listening.
Also, from your Nagios server you can try:
Code: Select all
# telnet <your_target_machine's_IP_address> 12489
Also, double check in your nsc.ini file for the lines:
Make sure you have your nagios server IP listed there
and this one:
Make sure you use the same password, when you run your check from the command line.