Page 1 of 4

NCPA reading memory wrong for terabite

Posted: Mon Dec 23, 2019 11:56 am
by rnjie
i have a physical server with 6TB of memory, before i used snmp to monitor the memory but i always got inaccurate results, i decided to switch to ncpa client, its been working for a while but i noticed lately that it wasnt as accurate when we added a few GB of memory. please see the current memory usage of my system

free -h
total used free shared buffers cached
Mem: 5.9T 5.9T 38G 1.1T 1.0G 1.2T
-/+ buffers/cache: 4.6T 1.3T
Swap: 15G 0B 15G


as you can see i still have almost 1.5T of memory cached but Nagios keeps sending critical alerts stating memory is 98% used

Re: NCPA reading memory wrong for terabite

Posted: Mon Dec 23, 2019 12:27 pm
by mbellerue
Can you post the full check_ncpa command that you're using for this? Also, what version of NCPA is this?

Re: NCPA reading memory wrong for terabite

Posted: Mon Dec 23, 2019 1:19 pm
by rnjie
my client server is rhel 6 and the version is
Agent_version was ['1.2.0']

But the nagios server ncpa wizard version is the latest 2.2.1
command on wizard is check_xi_ncpa -H (hostname) -t 'plut0' -P 5693 -M memory/virtual -u Gi -w 85 -c 95

Re: NCPA reading memory wrong for terabite

Posted: Mon Dec 23, 2019 2:42 pm
by mbellerue
Oh wow, yeah. It's possible that the old version wasn't reading memory properly. Is upgrading the client a possibility? 1.2.0 is pretty old.

Re: NCPA reading memory wrong for terabite

Posted: Mon Dec 23, 2019 4:16 pm
by rnjie
you mean upgrading the client operating system or ncpa version? the applications we run on the system only requires rhel 6 so it cnt be upgraded to rhel 7, but if ncpa can be updated then il like to know how

Re: NCPA reading memory wrong for terabite

Posted: Mon Dec 23, 2019 4:43 pm
by mbellerue
I'm sorry, yes I mean upgrade the NCPA client. You can download the RPM or use the Nagios repository. It would probably be worth a little time testing since you are upgrading from a fairly old version.
https://www.nagios.org/ncpa/#downloads

2.2.0 is the version that I was using, and it seems to measure memory in the correct fashion. Where cache is not counted as actual used memory.

Re: NCPA reading memory wrong for terabite

Posted: Mon Dec 23, 2019 5:00 pm
by rnjie
i just got the latest version and am still getting thesame results

ncpa-2.2.0-1

/usr/local/nagios/libexec/check_ncpa.py -H LXDODBT1 -t 'plut0' -P 5693 -M memory/virtual -u Gi -w 85 -c 95
CRITICAL: Used memory was 97.20 % (Available: 171.28 GiB, Total: 6057.84 GiB, Free: 43.91 GiB, Used: 4743.91 GiB) | 'available'=171.28GiB;5149;5755; 'total'=6057.84GiB;5149;5755; 'free'=43.91GiB;5149;5755; 'used'=4743.91GiB;5149;5755;

this is the memory usage of the server

Code: Select all

 free -h
        total       used       free     shared    buffers     cached
Mem:     5.9T       5.9T        44G       1.1T       1.0G       1.2T
-/+ buffers/cache:    4.6T       1.3T
Swap:          15G         0B        15G

Re: NCPA reading memory wrong for terabite

Posted: Mon Dec 23, 2019 5:10 pm
by mbellerue
Does it show those same numbers in the NCPA web interface if you navigate to API, Memory, Virtual?

Re: NCPA reading memory wrong for terabite

Posted: Mon Dec 23, 2019 5:25 pm
by rnjie
yes.

Re: NCPA reading memory wrong for terabite

Posted: Thu Dec 26, 2019 10:38 am
by lmiltchev
What is the value (from the NCPA output) that you think is incorrect? NCPA uses the psutil in order to calculate memory. Here's an explanation of how the memory is actually calculated:

https://psutil.readthedocs.io/en/latest/#memory