Page 2 of 2

Re: "Connection Refused" on local network

Posted: Wed Jan 11, 2012 5:45 pm
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.

Re: "Connection Refused" on local network

Posted: Wed Jan 11, 2012 5:51 pm
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

Re: "Connection Refused" on local network

Posted: Wed Jan 11, 2012 6:54 pm
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!!!

Re: "Connection Refused" on local network

Posted: Thu Jan 12, 2012 1:34 pm
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

Re: "Connection Refused" on local network

Posted: Thu Jan 12, 2012 1:51 pm
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).

Re: "Connection Refused" on local network

Posted: Thu Jan 12, 2012 2:06 pm
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.

Re: "Connection Refused" on local network

Posted: Thu Jan 12, 2012 2:12 pm
by lmiltchev
whitetree,

Thanks for your feedback!