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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ShlomiUni
Posts: 12
Joined: Wed Nov 06, 2019 4:11 am

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

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
ShlomiUni
Posts: 12
Joined: Wed Nov 06, 2019 4:11 am

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

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked