check_nt MEMUSE - how to change view
check_nt MEMUSE - how to change view
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.
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.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: check_nt MEMUSE - how to change view
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?
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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: check_nt MEMUSE - how to change view
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?
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?
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check_nt MEMUSE - how to change view
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:
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.
Code: Select all
type=physicalhttp://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
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?
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
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'Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_nt MEMUSE - how to change view
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.
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.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check_nt MEMUSE - how to change view
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
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!
Thanks all for your help!
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check_nt MEMUSE - how to change view
Great to hear! Let us know if you need any further help with configuration.