Hi ,
we want to know how NCPAagent calculate memory in Linux.
is Available memory value calculated via any formula or value taken directly from ( cat /proc/meminfo ) command.As some OS doesn't show available memory in free -h command.
we want to know because NCPA agent does not show buffered/cache/shared in summary of memory alert.So we need to describe how the things (formula/calculation) working in NCPA background to clients.
Thanks
ncpa agent |memory
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: ncpa agent |memory
Hi,
NCPA uses the popular psutil module for python to gather virtual and swap memory data. You can find the documentation for psutil memory function on this page:
https://psutil.readthedocs.io/en/latest ... -functions
Also, scanning the source code, it does look like it's using the /proc/meminfo virtual file to determine values.
https://github.com/giampaolo/psutil/blo ... pslinux.py
Let me know if that helps you explain the functionality for your clients.
NCPA uses the popular psutil module for python to gather virtual and swap memory data. You can find the documentation for psutil memory function on this page:
https://psutil.readthedocs.io/en/latest ... -functions
Also, scanning the source code, it does look like it's using the /proc/meminfo virtual file to determine values.
https://github.com/giampaolo/psutil/blo ... pslinux.py
Let me know if that helps you explain the functionality for your clients.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
progressive.nagiosXI
- Posts: 277
- Joined: Mon Jul 31, 2017 5:54 am
Re: ncpa agent |memory
Hi,
actually we want to know
available memory=free + cached+ buffers
but in suse linux this concept looks not working ,Please check attachment (Server memory command + Nagios Critical summary)
Total memory=15GB
buffer/cache is 10 GB free then why memory show in critical state.
Note:- currently we monitor via NCPA
we think nagios taking Available memory detail from /proc/meminfo and compare threshold value as per configuration.
Please help to understand here.
Thanks
actually we want to know
available memory=free + cached+ buffers
but in suse linux this concept looks not working ,Please check attachment (Server memory command + Nagios Critical summary)
Total memory=15GB
buffer/cache is 10 GB free then why memory show in critical state.
Note:- currently we monitor via NCPA
we think nagios taking Available memory detail from /proc/meminfo and compare threshold value as per configuration.
Please help to understand here.
Thanks
You do not have the required permissions to view the files attached to this post.
Re: ncpa agent |memory
NCPA uses psutils, and we cannot change what metrics are available, and how they are calculated. You could monitor various types of memory via NCPA, e.g. total, free, used, and available but there is no way to include/exclude cached memory & buffers "out of the box". You would have to write your own, custom plugin in order to do that.
Here's an example of some of the NCPA memory checks, and the output of the "free -m" command:
Here's an example of some of the NCPA memory checks, and the output of the "free -m" command:
Code: Select all
[root@main-nagios-xi libexec]# ./check_ncpa.py -H x.x.x.x -t 'mytoken' -M 'memory/virtual/total' -u Mi
OK: Total was 3961.26 MiB | 'total'=3961.26MiB;;;
[root@main-nagios-xi libexec]# ./check_ncpa.py -H x.x.x.x -t 'mytoken' -M 'memory/virtual/free' -u Mi
OK: Free was 3536.05 MiB | 'free'=3536.05MiB;;;
[root@main-nagios-xi libexec]# ./check_ncpa.py -H x.x.x.x -t 'mytoken' -M 'memory/virtual/available' -u Mi
OK: Available was 3802.49 MiB | 'available'=3802.49MiB;;;
[root@main-nagios-xi libexec]# ./check_ncpa.py -H x.x.x.x -t 'mytoken' -M 'memory/virtual/used' -u Mi
OK: Used was 128.96 MiB | 'used'=128.96MiB;;;
linux-aa2t:/usr/local/nagios/libexec # free -m
total used free shared buffers cached
Mem: 3962 425 3537 0 50 245
-/+ buffers/cache: 129 3833
Swap: 2053 0 2053Be sure to check out our Knowledgebase for helpful articles and solutions!