Connection refused " status" Help

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
bviscount
Posts: 6
Joined: Tue Dec 27, 2011 10:50 am

Connection refused " status" Help

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Connection refused " status" Help

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
bviscount
Posts: 6
Joined: Tue Dec 27, 2011 10:50 am

Re: Connection refused " status" Help

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Connection refused " status" Help

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
bviscount
Posts: 6
Joined: Tue Dec 27, 2011 10:50 am

Re: Connection refused " status" Help

Post by bviscount »

output:
-bash: ./check_nt: No such file or directory
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Connection refused " status" Help

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
bviscount
Posts: 6
Joined: Tue Dec 27, 2011 10:50 am

Re: Connection refused " status" Help

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Connection refused " status" Help

Post 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/
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
bviscount
Posts: 6
Joined: Tue Dec 27, 2011 10:50 am

Re: Connection refused " status" Help

Post by bviscount »

Output:

could not fetch information from server
[root@localhost libexec]# could not fetch information from server


tx for the putty advice.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Connection refused " status" Help

Post 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:

Code: Select all

allowed_hosts=
Make sure you have your nagios server IP listed there
and this one:

Code: Select all

password=
Make sure you use the same password, when you run your check from the command line.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked