Page 1 of 2

Physical memory check not reporting total memory correctly

Posted: Fri Jul 26, 2019 9:32 am
by rferebee
Hello,

I'm using the following command to check physical memory on my Exchange servers and the check is not reporting the amount of memory the server has correctly.

[nagios@nagiosxi ~]$ /usr/local/nagios/libexec/check_nrpe -2 -H 10.131.10.56 -t 30 -c check_memory type=physical 'warn=used>90%' 'crit=used>95%' WARNING: committed = 15.28GB, physical = 13.423GB|'committed'=15.28021GB;14.69955;16.53699;0;18.37443 'committed %'=83%;80;90;0;100 'physical'=13.42266GB;12.79955;14.39949;0;15.99943 'physical %'=84%;80;90;0;100

It says the server only has 13.423GB of physical memory, but it has 16GB. Is there a way to get this to report accurately or perhaps there is a way to hard code the amount of memory the server has?

Thank you.

Re: Physical memory check not reporting total memory correct

Posted: Fri Jul 26, 2019 2:13 pm
by benjaminsmith
Hi @rferebee,

I tested this on my system and it does looks right. The plugin will return the amount of used physical memory, and that's why you're seeing the warning as you are using 13.423 GB of physical memory. The documentation for this check is on the following page:

https://docs.nsclient.org/reference/win ... eck_memory

Let me know if you have any questions.

Re: Physical memory check not reporting total memory correct

Posted: Fri Jul 26, 2019 3:00 pm
by rferebee
So, what's 'committed'=15.28021GB?

Also, even if I set the check to Warn at 95%, it's still warning even though 13.423GB isn't 95% of 16GBs.

Re: Physical memory check not reporting total memory correct

Posted: Fri Jul 26, 2019 4:43 pm
by ssax
commited includes the pagefile (windows swap/cache), you can either use a different plugin or reach out to the nsclient++ developers to have them adjust their agent but all it does is report what it sees so you'll likely see the same in any other.

Even on a linux machine (or in the windows properties on RAM size back in the day) it shows a discrepency in the real amount, what does this show on the remote system when you run it from a powershell console?

Code: Select all

Get-WmiObject -Class Win32_ComputerSystem TotalPhysicalMemory
Please send fresh output of the other command as well so that I can run the calculations.

Re: Physical memory check not reporting total memory correct

Posted: Fri Jul 26, 2019 5:08 pm
by rferebee
Here's what I get when I run the PS command:

PS C:\Users\ferebeer> Get-WmiObject -Class Win32_ComputerSystem TotalPhysicalMemory


__GENUS : 2
__CLASS : Win32_ComputerSystem
__SUPERCLASS :
__DYNASTY :
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
TotalPhysicalMemory : 17179267072
PSComputerName :

I understand that 16GBs doesn't mean exactly 16GBs, but what I'm trying to point out is that there is no reason the check should be in Warning if the system is only using 13.423GBs when the check is set to warn at 90%... it's only 83% utilized.

Here's the fresh check:

[nagios@nagiosxi ~]$ /usr/local/nagios/libexec/check_nrpe -2 -H 10.131.10.56 -t 30 -c check_memory type=physical 'warn=free<10%' 'crit=free<5%' WARNING: committed = 15.256GB, physical = 13.397GB|'committed'=15.25551GB;14.69955;16.53699;0;18.37443 'committed %'=83%;80;90;0;100 'physical'=13.39747GB;12.79955;14.39949;0;15.99943 'physical %'=84%;80;90;0;100

Re: Physical memory check not reporting total memory correct

Posted: Mon Jul 29, 2019 8:11 am
by lmiltchev
I understand that 16GBs doesn't mean exactly 16GBs, but what I'm trying to point out is that there is no reason the check should be in Warning if the system is only using 13.423GBs when the check is set to warn at 90%... it's only 83% utilized.
Actually, this seems correct. 83% utilization means that you have 7% free memory. In your check, you have the following thresholds:
'warn=free<10%' 'crit=free<5%'
7% is less than 10%, so you get a warning. If you had a value less than 5%, you would get a critical.

Re: Physical memory check not reporting total memory correct

Posted: Mon Jul 29, 2019 9:51 am
by rferebee
83% utilization would mean I have 17% free memory. If the check is set to warn at 10% free and 17% is more than 10%, it shouldn't be warning.

Re: Physical memory check not reporting total memory correct

Posted: Mon Jul 29, 2019 10:00 am
by lmiltchev
My bad. You posted before I could delete my reply... I suppose my math is awful on Monday mornings... You are correct. I don't know yet why the check returns a warning. We will have to do some more digging into this. Sorry about the previous post!

Re: Physical memory check not reporting total memory correct

Posted: Mon Jul 29, 2019 10:04 am
by rferebee
It's all good, I'm just happy I'm not crazy. I thought I was transported to the Twilight Zone this wonderful Monday morning.

Do you want me to send you an update system profile so you can take a look?

Re: Physical memory check not reporting total memory correct

Posted: Mon Jul 29, 2019 10:18 am
by lmiltchev
Update: Looking at your command, and the output, I believe you are not passing the thresholds at all as you are missing the "-a" flag... Does your command work, when you use "-a"?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -2 -H 10.131.10.56 -t 30 -c check_memory -a type=physical 'warn=free<10%' 'crit=free<5%'
NRPE syntax:

Code: Select all

./check_nrpe -c <command> -a <args>