Page 1 of 1

NCPA memory/swap - Why does it monitor Memory + Swap?

Posted: Wed Jan 22, 2020 4:26 am
by ShlomiUni
Hi, I'm trying to monitor my Swap usage only, but when using NCPA memory/swap "check_xi_ncpa!-t 'token' -P 5693 -M memory/swap -u Gi -w 50 -c 80"
I'm getting the memory + swap total usage and not swap usage only.
How can I fix that so it will check swap usage only?

Thanks

Re: NCPA memory/swap - Why does it monitor Memory + Swap?

Posted: Wed Jan 22, 2020 9:40 am
by lmiltchev
What is the operating system that you are currently monitoring memory on? I tested the check against CentOS 6 machine, and it seems accurate.

On the client (remote box)

Code: Select all

free -h
             total       used       free     shared    buffers     cached
Mem:          7.8G       1.7G       6.1G       492K       181M       842M
-/+ buffers/cache:       766M       7.1G
Swap:         2.0G         0B       2.0G
On the Nagios XI server

Code: Select all

./check_ncpa.py -H x.x.x.x -t mytoken' -M 'memory/swap' -w 50 -c 80 -u Gi
OK: Used swap was 0.00 % (Total: 2.00 GiB, Used: 0.00 GiB, Free: 2.00 GiB) | 'total'=2.00GiB;1;2; 'used'=0.00GiB;1;2; 'free'=2.00GiB;1;2;
Are you seeing some inconsistencies when you run your check?

Re: NCPA memory/swap - Why does it monitor Memory + Swap?

Posted: Wed Jan 22, 2020 10:10 am
by ShlomiUni
lmiltchev wrote:What is the operating system that you are currently monitoring memory on? I tested the check against CentOS 6 machine, and it seems accurate.

On the client (remote box)

Code: Select all

free -h
             total       used       free     shared    buffers     cached
Mem:          7.8G       1.7G       6.1G       492K       181M       842M
-/+ buffers/cache:       766M       7.1G
Swap:         2.0G         0B       2.0G
On the Nagios XI server

Code: Select all

./check_ncpa.py -H x.x.x.x -t mytoken' -M 'memory/swap' -w 50 -c 80 -u Gi
OK: Used swap was 0.00 % (Total: 2.00 GiB, Used: 0.00 GiB, Free: 2.00 GiB) | 'total'=2.00GiB;1;2; 'used'=0.00GiB;1;2; 'free'=2.00GiB;1;2;
Are you seeing some inconsistencies when you run your check?
Hi, I'm monitoring windows servers. Actually I monitor linux servers with the same command and they are fine.
So only the windows servers are not accurate with this command.

Re: NCPA memory/swap - Why does it monitor Memory + Swap?

Posted: Wed Jan 22, 2020 10:48 am
by lmiltchev
NCPA uses values, obtained from psutls. There are probably differences on how the swap memory is calculated on Windows vs Linux machines. Here's the psutil documentation on memory checks:

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