"Connection Refused" on local network

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
whitetree
Posts: 9
Joined: Wed Jan 11, 2012 12:38 pm

Re: "Connection Refused" on local network

Post by whitetree »

scottwilkerson wrote:
whitetree wrote: There is no password set for this machine as it is internal.
Ludmil was referring to the passphrase in the nsc.ini and on the server. They need to share and use the same password

Understood. I did not set a password in the Monitoring Wizard or on the NSClient++ program or it's nsc.ini file.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: "Connection Refused" on local network

Post by scottwilkerson »

So, now that you have the listener working, what do you get when you run

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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
whitetree
Posts: 9
Joined: Wed Jan 11, 2012 12:38 pm

Re: "Connection Refused" on local network

Post by whitetree »

scottwilkerson wrote:So, now that you have the listener working, what do you get when you run

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
[root@localhost libexec]# ./check_nt -H 192.168.1.xx -p 12489 -v MEMUSE -w 80 -c 90
could not fetch information from server

and

[root@localhost libexec]# telnet 192.168.1.xx 12489
Trying 192.168.1.xx...
Connected to 192.168.1.xx.
Escape character is '^]'.
Connection closed by foreign host.


Does it matter if Nagios is pointing to the internal IP but the NSClient++ is pointed to the external IP of Nagios?

EDIT: Now Nagios is having issues connecting to a different servers external IP Address despite me being able to run ./check_nt -H <externalIP> -p 12489 -v MEMUSE -w 80 -c 90 The command reports incorrect memory use. In addition to this Nagios cannot find the machines internal IP Address. The gateway and subnets are configured correctly...


Memory usage: total:16380.54 Mb - used: 4890.67 Mb (30%) - free: 11489.87 Mb (70%) | 'Memory usage'=4890.67Mb;13104.43;14742.49;0.00;16380.54

This machine only has 8Gigs of RAM =\

I'd really like to get this working swimmingly on my servers so I can present it to Management tomorrow so that we can buy it!!!
whitetree
Posts: 9
Joined: Wed Jan 11, 2012 12:38 pm

Re: "Connection Refused" on local network

Post by whitetree »

I solved the problem. I had to add a password to the NSC.ini file and Nagios. It only worked if I removed the host from Core Config then readded it. I also had to remove the /usr/local/nagios/etc/hosts/server.cfg file
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: "Connection Refused" on local network

Post by scottwilkerson »

whitetree wrote:I solved the problem. I had to add a password to the NSC.ini file and Nagios. It only worked if I removed the host from Core Config then readded it. I also had to remove the /usr/local/nagios/etc/hosts/server.cfg file
Glad to hear it.

check_nt -v MEMUSE shows the complete memory (physical memory + page.sys)
There are several ways to get physical usage, one being SNMP, and the other through NSClient++ with nrep

NSClient++ can also be used using check_nrpe (you will have to make sure the NEPE
listener module is enabled and properly configured)

Here are example of memory checks you can do with check_nrpe:

Physical memory:
CheckMem ShowAll=long MaxWarn=$ARG1$ MaxCrit=$ARG2$ type=physical

Page file:
CheckMem ShowAll=long MaxWarn=$ARG1$ MaxCrit=$ARG2$ type=virtual

All memort (RAM+SWAP):
CheckMem ShowAll=long MaxWarn=$ARG1$ MaxCrit=$ARG2$ type=paged


You can set them as aliases ($ARGx$ are nrpe arguments) or even call
CheckMem as the NRPE command and the rest of the line are the nrpe
arguments (-a).
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
whitetree
Posts: 9
Joined: Wed Jan 11, 2012 12:38 pm

Re: "Connection Refused" on local network

Post by whitetree »

scottwilkerson wrote:
whitetree wrote:I solved the problem. I had to add a password to the NSC.ini file and Nagios. It only worked if I removed the host from Core Config then readded it. I also had to remove the /usr/local/nagios/etc/hosts/server.cfg file
Glad to hear it.

check_nt -v MEMUSE shows the complete memory (physical memory + page.sys)
There are several ways to get physical usage, one being SNMP, and the other through NSClient++ with nrep

NSClient++ can also be used using check_nrpe (you will have to make sure the NEPE
listener module is enabled and properly configured)

Here are example of memory checks you can do with check_nrpe:

Physical memory:
CheckMem ShowAll=long MaxWarn=$ARG1$ MaxCrit=$ARG2$ type=physical

Page file:
CheckMem ShowAll=long MaxWarn=$ARG1$ MaxCrit=$ARG2$ type=virtual

All memort (RAM+SWAP):
CheckMem ShowAll=long MaxWarn=$ARG1$ MaxCrit=$ARG2$ type=paged


You can set them as aliases ($ARGx$ are nrpe arguments) or even call
CheckMem as the NRPE command and the rest of the line are the nrpe
arguments (-a).
Thanks for the tips. All your guys help was critical to me troubleshooting this.

Now all I need to do is figure out how to add services to monitor to hosts which I forgot to set up, set it up so it kicks emails to SMS and how to monitor MS SQL instances like host\SQL2008! But I can probably do that on my own.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: "Connection Refused" on local network

Post by lmiltchev »

whitetree,

Thanks for your feedback!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked