Page 1 of 1

check_nt MEMUSE - how to change view

Posted: Thu Aug 22, 2013 2:23 pm
by Theb2b
Currently our servers on the Service Status Details for Host XXXX for Memory Usage web page displays total memory which includes physical and page/swap memory. I would like to display only physical memory, total, precent used, precent avaliable. Looking through the documentation for NSClient++ shows some basic Nagios Configuration inst.

Sample Command:
CheckMEM MaxWarn=80% MaxCrit=90% ShowAll type=physical

Nagios Configuration:
define command {
command_name <<CheckMEM>>
command_line check_nrpe -H $HOSTNAME$ -P 5666 -c CheckMEM -a MaxWarn=$ARG1$% MaxCrit=$ARG2$%
}

From Commandline (with NRPE):
check_nrpe -H IP -p 5666 -c CheckMEM -a MaxWarn=80% MaxCrit=90% ShowAll type=physical

When I add this command to command.cfg file get an error on preflight check about illegal characters, remove << >> preflight passes.
When I attempt to use the command in windows.cfg get an error on preflight using an undefined command.

What am I missing here?
Any more information I need to supply please let me know.

Re: check_nt MEMUSE - how to change view

Posted: Thu Aug 22, 2013 2:30 pm
by sreinhardt
Your topic lists check_nt, however your command shows check_nrpe. They both can be run via nsclient however are completely separate checks and configurations. Do you know which you intend to use?

Illegal characters: You cannot have <<>> or really much other than - or _ in names for most nagios objects, as far as special characters go.
What is the full log of errors that you are getting on pre-flight checking?

Re: check_nt MEMUSE - how to change view

Posted: Thu Sep 12, 2013 9:14 am
by Theb2b
Finally back and ready to tackle this problem. In your response you ask which one I intend to use, based on the sample shown in the user guide it shows both so I'm a bit confused. Like to use check_nt but for no particular reason and I tried using just check_nt but still no joy.

So the question now becomes what configuration files do I need to modify to get this command to work?

In my commands.cfg file I have the following

# 'checkMEM' command definition
define command{
command_name CheckMEM
command_line check_nt -H $HOSTADDRESS$ -p 5666 -c CheckMEM -a MaxWarn=$ARG1$ MaxCrit=$ARG2$
}

Then in my windows.cfg file I have;
define service{
use generic-service
host_name testserver
service_description Memory Usage
check_command check_nt!MEMUSE!ShowAll Type=physical -w 80 -c 90
}
What am I missing here?

Re: check_nt MEMUSE - how to change view

Posted: Thu Sep 12, 2013 9:52 am
by slansing
CheckMem is a compiled module within nsclient, that being said you should be able to add this flag in the nsclient.ini file of the windows machine to that command:

Code: Select all

type=physical
This is all explained in the nsclient documentation:

http://www.nsclient.org/nscp/wiki/CheckSystem/checkMem

If you need further help tracking down what command to add that flag to let us know.

Re: check_nt MEMUSE - how to change view

Posted: Thu Sep 12, 2013 2:29 pm
by Theb2b
Yes please I need help tracking down what command to add that flag to and more importantly how.

When I run this command from the command line on Nagios;

check_nt -H testserver -p 12489 -v MEMUSE ShowAll type=physical -w 80% -c 90%

Results still show both physical and page memory combinded.

On the testserver I have this entrie in the nsclient.ini file
; Undocumented key
checkMEM = enabled

Reading through the documentation I'm not understanding what else needs to be in the .ini file and/or where?

Re: check_nt MEMUSE - how to change view

Posted: Thu Sep 12, 2013 3:43 pm
by lmiltchev
Can you run the following command successfully from the command line?

Code: Select all

./check_nrpe -H <ip> -p 5666 -c checkMem -a 'MaxWarn=80% MaxCrit=90% ShowAll type=physical'

Re: check_nt MEMUSE - how to change view

Posted: Thu Oct 03, 2013 7:39 am
by Theb2b
Unfortunately no, getting the following error;

Here is the command string I am running;
./check_nrpe -H srvxatest -p 5666 -c CheckMEM -a MaxWarn=80% MaxCrit=90% ShowAll type=physical
Here are the results;
CHECK_NRPE: Socket timeout after 10 seconds.
Using -t 20 yields the same result above but instead of stating 10 seconds gives 20 seconds.
Putting NSClient into “test” on the server, below are the results;

D /server/protocol.hpp:66 Accepting connection from: 192.168.xxx.xxx
E ocket/connection.hpp:134 Failed to read data: End of file

NSClient log I find this;
2013-10-03 07:23:09: e:D:\source\nscp\trunk\include\socket/connection.hpp:134: Failed to read data: End of file
2013-10-03 07:24:23: e:D:\source\nscp\trunk\include\socket/connection.hpp:134: Failed to read data: End of file

Windows server running 2008 R2 with NSClient version .4.1.102x64
In config file I have NRPEServer = 1, any other settings or changes do I need to make? Let me know if you need to review the config file.

Re: check_nt MEMUSE - how to change view

Posted: Thu Oct 03, 2013 11:53 am
by slansing
Do you have allow_arguments set to 1 in the nsc.ini file? If not, can you change that and restart the nsclient service Can you share your nsc.ini file with us? Please block out information you wish not to share. You may also need to expand the nsc.ini file to a full version, this was a new addition to nsclient and is part of the reason we recommend you use version 3.9.x and not a 4.x version as it is easier to configure and support.

Re: check_nt MEMUSE - how to change view

Posted: Thu Oct 03, 2013 3:57 pm
by Theb2b
Uninstalled version 4.x, installed 3.9.x, changed allow_arguments to 1, made couple of other changes in the nsc.ini file like the address for the nagios server and it is now working.

Thanks all for your help!

Re: check_nt MEMUSE - how to change view

Posted: Fri Oct 04, 2013 9:21 am
by slansing
Great to hear! Let us know if you need any further help with configuration.