Memory Usage in RHEL instances

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
akepley
Posts: 138
Joined: Wed Sep 11, 2013 1:09 pm

Memory Usage in RHEL instances

Post by akepley »

I need to understand how the memory usage service works in NagiosXI as we have a lot of servers that reach warning and critical levels when we have the service set to 20% and 10% respectively.

For instance, this server shows a `free -m` as follows:

Code: Select all

root@server1 nagios# free -m
             total       used       free     shared    buffers     cached
Mem:          3829       3577        251         35        479        438
-/+ buffers/cache:       2660       1168
Swap:            0          0          0
Since Linux uses all free memory it can for optimization, the free usage under Mem doesn't really give a good indication of what is really available for memory utilization. Even using the -n option doesn't seem to provide a real idea of what the virtual memory actually has to use if a program needs it. I would say that the 1168mb of free memory under buffers/cache would be the better number to use. Am I reading this wrong or is there an option I'm not providing to NagiosXI arguments to take into account the cache free value?

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_nrpe -H 10.200.9.125 -t 30 -c check_mem -a '-w 20 -c 10 -n'
OUTPUT: WARNING - 676 / 3829 MB (17%) Free Memory, Used: 3591 MB, Shared: 35 MB, Buffers: 479 MB, Cached: 438 MB | total=3829MB free=676MB used=3591MB shared=35 buffers=479MB cached=438MB
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Memory Usage in RHEL instances

Post by hsmith »

Unless I'm not understanding something correctly, that's still a pretty high amount of memory used.

From the man page for 'free':
used Used memory (calculated as total - free - buffers - cache)
free Unused memory (MemFree and SwapFree in /proc/meminfo)
buffers
Memory used by kernel buffers (Buffers in /proc/meminfo)

cache Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)
I'm not sure if buffers/cache would be the right approach. I think the way it works right now is pretty proper.
Former Nagios Employee.
me.
akepley
Posts: 138
Joined: Wed Sep 11, 2013 1:09 pm

Re: Memory Usage in RHEL instances

Post by akepley »

See this documentation (https://access.redhat.com/documentation ... Cache.html) from Red Hat and this link (http://www.freelinuxconsole.info/unders ... nuxunix-2/) which provides a good writeup for what the actual memory available is on RHEL linux.

This appears to show that the cache line is the actual available memory and what we really need to keep up with. Is there an option to take this line into account or another memory check plugin that will use this line?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Memory Usage in RHEL instances

Post by hsmith »

It may be an issue because not every distro puts out that information the same way. I could see where it would be good to look at it, but if it's not provided the same across multiple distrobutions, that could be the reasoning.

Take a look at my Fedora 23 machine for instance:

Code: Select all

[root@potus ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           7966         125        7578           0         262        7774
Swap:          3967           0        3967
versus my Debian Jessie VPS:

Code: Select all

             total       used       free     shared    buffers     cached
Mem:           494        482         12         12        205        112
-/+ buffers/cache:        164        330
Swap:            0          0          0


If you feel like something can be changed, please submit an issue/feature request here: https://github.com/nagios-plugins. Otherwise, this may be a favorable plugin for you: https://exchange.nagios.org/directory/P ... 29/details
Former Nagios Employee.
me.
akepley
Posts: 138
Joined: Wed Sep 11, 2013 1:09 pm

Re: Memory Usage in RHEL instances

Post by akepley »

Thanks we'll take a look!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Memory Usage in RHEL instances

Post by lmiltchev »

Sounds good! We will keep the thread open for a while. Let us know if you have any more questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked