Memory Usage

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Memory Usage

Post by hillhealthcenter »

How can I have MEM USE check physical memory only? Currently, it appears to be combining physical and paged memory.

I'm using NSClient++ 0.4.0.172 64-bit.

System:
Nagios XI Version : 2014R1.3
nagiosxi.hhc.com 2.6.32-220.23.1.el6.i686 i686
CentOS release 6.2 (Final)
Gnome is not installed

Here the contents of my nsclient.ini file:

Code: Select all

; Undocumented section


[/modules]

; CheckDisk - CheckDisk can check various file and disk related things. The current version has commands to check Size of hard drives and directories.
CheckDisk = 1

; Event log Checker. - Check for errors and warnings in the event log. This is only supported through NRPE so if you plan to use only NSClient this wont help you at all.
CheckEventLog = 1

; Check External Scripts - A simple wrapper to run external scripts and batch files.
CheckExternalScripts = 1

; Helper function - Various helper function to extend other checks. This is also only supported through NRPE.
CheckHelpers = 1

; Check NSCP - Checkes the state of the agent
CheckNSCP = 1

; CheckSystem - Various system related checks, such as CPU load, process state, service state memory usage and PDH counters.
CheckSystem = 1

; CheckWMI - CheckWMI can check various file and disk related things. The current version has commands to check Size of hard drives and directories.
CheckWMI = 1

; NRPE server - A simple server that listens for incoming NRPE connection and handles them. NRPE is preferred over NSClient as it is more flexible. You can of cource use both NSClient and NRPE.
NRPEServer = 1

; NSClient server - A simple server that listens for incoming NSClient (check_nt) connection and handles them. Although NRPE is the preferred method NSClient is fully supported and can be used for simplicity or for compatibility.
NSClientServer = 1


; Undocumented section
[/settings/default]

; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = 192.168.100.230


; Section for NSClient (NSClientServer.dll) (check_nt) protocol options.
[/settings/NSClient/server]


; Section for system checks and system settings
[/settings/check/system/windows]


; Confiure which services has to be in which state
[/settings/check/system/windows/service mapping]


; Configure crash handling properties.
[/settings/crash]


; Section for the EventLog Checker (CheckEventLog.dll).
[/settings/eventlog]


; A set of options to configure the real time checks
[/settings/eventlog/real-time]


; A set of filters to use in real-time mode
[/settings/eventlog/real-time/filters]


; Section for external scripts configuration options (CheckExternalScripts).
[/settings/external scripts]


; A list of aliases available. An alias is an internal command that has been "wrapped" (to add arguments). Be careful so you don't create loops (ie check_loop=check_a, check_a=check_loop)
[/settings/external scripts/alias]


; A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments>
[/settings/external scripts/scripts]
check_updates=cmd /c echo scripts\Check-Updates.ps1; exit $LastExitCode | powershell.exe -command -


; A list of wrappped scripts (ie. using the template mechanism)
[/settings/external scripts/wrapped scripts]


; A list of templates for wrapped scripts
[/settings/external scripts/wrappings]


; Section for configuring the log handling.
[/settings/log]


; Configure log file properties.
[/settings/log/file]


; Section for configuring the shared session.
[/settings/shared session]


; A list of avalible remote target systems
[/settings/targets]


; Section for NRPE (NRPEListener.dll) (check_nrpe) protocol options.
[/settings/NRPE/server]
You do not have the required permissions to view the files attached to this post.
Thanks so much,
Tom
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Memory Usage

Post by sreinhardt »

Try adding the following line to arg4 in your nagios service config there. check_nt and nrpe both from nsclient should work with that setting for memory checks.

Code: Select all

type=physical
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.
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Memory Usage

Post by hillhealthcenter »

Spenser,

I added the argument type=physical to arg4. However, there is no change.
Thanks so much,
Tom
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Memory Usage

Post by sreinhardt »

OK let's run both of those manually once and see what we get:

Code: Select all

cd /usr/local/nagios/libexec
./check_nt -H centcshdb -s -p 12489 -v MEMUSE -w 80 -c 90
./check_nt -H centcshdb -s -p 12489 -v MEMUSE -w 80 -c 90 type=physical
Note that you may need to change the hostname and add a password after -s if you cleared that out on your screenshots.
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.
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Memory Usage

Post by hillhealthcenter »

Here's what I got after several attempts:

Code: Select all

[root@nagiosxi libexec]# ./check_nt -H centcshdb -s -p 12489 -v MEMUSE -w 80 -c 90
check_nt: Could not parse arguments
Usage:
check_nt -H host -v variable [-p port] [-w warning] [-c critical]
[-l params] [-d SHOWALL] [-u] [-t timeout]
[root@nagiosxi libexec]# ./check_nt -H centcshdb -s -p 12489 -v MEMUSE -w 80 -c 90 type=physical
check_nt: Could not parse arguments
Usage:
check_nt -H host -v variable [-p port] [-w warning] [-c critical]
[-l params] [-d SHOWALL] [-u] [-t timeout]
[root@nagiosxi libexec]# ./check_nt -H centcshdb -v MEMUSE -p 12489 -w 80 -c 90
Memory usage: total:73725.88 MB - used: 32539.44 MB (44%) - free: 41186.44 MB (56%) | 'Memory usage'=32539.44MB;58980.70;66353.29;0.00;73725.88
[root@nagiosxi libexec]# ./check_nt -H centcshdb -v MEMUSE -p 12489 -w 80 -c 90 type=physical
Memory usage: total:73725.88 MB - used: 32538.01 MB (44%) - free: 41187.87 MB (56%) | 'Memory usage'=32538.01MB;58980.70;66353.29;0.00;73725.88
You have new mail in /var/spool/mail/root
[root@nagiosxi libexec]#
Thanks so much,
Tom
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Memory Usage

Post by Box293 »

Using check-nrpe you will be able to check physcial memory.

This post has a good write up:
http://support.nagios.com/forum/viewtop ... 8619#p8619

But in short try:

Code: Select all

./check_nrpe -H 10.25.14.2 -p 5666 -c CheckMEM -a MaxWarn=80% MaxCrit=90% ShowAll=long type=physical
Which should output something like:

Code: Select all

OK: physical memory: Total: 4G - Used: 442M (10%) - Free: 3.57G (90%)|'physical memory %'=10%;80;90 'physical memory'=441.543M;3276.444;3685.999;0;4095.555
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Memory Usage

Post by hillhealthcenter »

Box293,

I'm using NSClient++ 0.4.0.172 64-bit. It doesn't have a nsc.ini file. It has a nsclient.ini file. Should I be using a different version of NSClient++?

Code: Select all

[root@nagiosxi libexec]# ./check_nrpe -H 192.168.103.21 -p 5666 -c CheckMEM -a MaxWarn=80% MaxCrit=90% ShowAll=long type=physical
Request contained arguments (not currently allowed, check the allow arguments option).
[root@nagiosxi libexec]#
Thanks so much,
Tom
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Memory Usage

Post by hillhealthcenter »

Box293,

I had to add these nsclient.ini section for NRPE:
allow arguments = 1
Thanks so much,
Tom
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Memory Usage

Post by hillhealthcenter »

BTW, are we calling this issue a bug?
Thanks so much,
Tom
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Memory Usage

Post by lmiltchev »

It's a known issue. I am not sure if you would consider it a bug. Anyway, here's some input from the developer:

http://www.nsclient.org/forums/topic/old-1410/
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked