-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoke-IcingaCheckMemory detects wrong size for Pagefile #360
Comments
+1
|
It seems the issue is caused by different versions of Windows. One will report the Pagefile in bytes, while the other will report it in MB/GB. I will have to check on which systems the values are different and provide a global fix. |
Are you sure about this? Every reference I can find to the https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-pagefilesetting
Anyway here's the version info from my system which presents the values in megabytes:
|
@LordHepipud, I do have servers with Windows 2022 were the check is correctly gathering the size and on others it is not (and all of them are VMs cloned from the same template with the exact same update level). |
The unit for pagefile attributes was changed from megabytes to bytes in PR#346 but the call to New-IcingaCheck was not updated to reflect this. Fixes Icinga#360.
The unit for pagefile attributes was changed from megabytes to bytes in Fixes Icinga#360.
The unit for pagefile attributes was changed from megabytes to bytes in GH346 but the call to New-IcingaCheck was not updated to reflect this. Fixes Icinga#360.
The unit for pagefile attributes was changed from megabytes to bytes in IcingaGH-346 but the call to New-IcingaCheck was not updated to reflect this. Fixes Icinga#360.
Can you check the version of the plugins component on the servers where it is working, because this issue seems to a side effect of #346 rather than due to any differences in WMI class property units? |
@atj outputs from a Windows 2022 VM where it is working:
Outputs from a VM with the same Windows 2022 template (same version, updates, etc.) where huge numbers are presented for the pagefile:
Usage data from this system:
|
@atj problem might start once the pagefile is utilized and might be fine on systems without pagefile consumption but would have to go through all Windows Servers where we adapted the thresholds to TB or PB. |
@mattpoel, the issue is due to the unit being specified as megabytes when it is actually bytes here:
So if your pagefile usage is zero then the issue won't be triggered:
If you want to try the fix, you can do the following: Edit - -Unit 'MB' `
+ -Unit 'B' ` Then run > Invoke-IcingaCheckMemory -PageFileWarning 10GB -PageFileCritical 20GB -Verbosity 3
[CRITICAL] Memory Usage [CRITICAL] PageFile Usage (All must be [OK])
\_ [CRITICAL] PageFile Usage (All must be [OK])
\_ [CRITICAL] C:\pagefile.sys: 363.86TB is greater than threshold 21.47GB
\_ [OK] Used Memory: 3.85GiB
| 'memory::ifw_memory::used'=4136940000B;;;0;4294414000 'cpagefilesys::ifw_pagefile::used'=363855900000000B;10737418240;21474836480;0;12884900000000000
2
> # edit Invoke-IcingaCheckMemory.psm1
> Copy-IcingaFrameworkCacheTemplate
> # open new PS session
> Invoke-IcingaCheckMemory -PageFileWarning 10GB -PageFileCritical 20GB -Verbosity 3
[OK] Memory Usage (All must be [OK])
\_ [OK] PageFile Usage (All must be [OK])
\_ [OK] C:\pagefile.sys: 452.00MiB
\_ [OK] Used Memory: 3.85GiB
| 'memory::ifw_memory::used'=4129587000B;;;0;4294414000 'cpagefilesys::ifw_pagefile::used'=473956400B;10737418240;21474836480;0;12884900000
0 |
@atj looking good. Icinga is still reporting the wrong usage after the modification (service restart was restarted). Do you know what could be the cause for this? |
@mattpoel: that's strange, I'd expect the changes to take effect after a service restart. Are you using the API check forwarder? |
@atj: It's a "default" setup. No explicit configuration. We stumbled upon another issue on a Windows 2016 server, where IcingaCheckMemory (only via Icinga) will report an invalid threshold for the pagefile. Per Icinga command definition, the following command is executed from the debug.log:
A "pure" execution of Invoke-IcingaCheckMemory doesn't report the error and even a percent threshold is working:
This is only happening on this specific Windows 2016 server where we just deployed Icinga for Windows. Shall I report this problem in a separate issue? Thanks a lot in advance! |
@mattpoel: I believe the cause of the invalid threshold error is the same as this issue, so my fix should resolve it:
My guess as to why you're seeing different behaviour between |
As a final update on this, contrary to what I stated in my previous comment the The following PowerShell snippet will fix the plugin, recompile the plugins cache and restart the Icinga 2 service: $ErrorActionPreference = 'Stop';
$file = 'C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-plugins\plugins\Invoke-IcingaCheckMemory.psm1';
$content = Get-Content -Path $file -Raw;
$content.Replace("-Unit 'MB'", "-Unit 'B'") | Set-Content -Path $file;
Write-IcingaForWindowsComponentCompilationFile `
-ScriptRootPath 'C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-plugins\plugins' `
-CompiledFilePath 'C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-plugins\compiled\icinga-powershell-plugins.ifw_compilation.psm1';
Restart-IcingaWindowsService; |
Thanks for all the input. You are correct, the Unit was the error on the plugin. Though I'm not sure on why on my test machines I had issues with only on some machines reporting wrong values, while others worked fine with v1.11.0. I will provide a fix for this with v1.11.1 |
You can simply run
by the way. This will force the cache rebuild. In addition starting with v1.11.0, you can use
which will then compile the cache for all components |
After finding the actual cause of this issue I went to the effort of submitting a (admittedly trivial) PR to fix it but you created your own and merged it without even notifying me. If Icinga want to encourage contributions from partners this isn't the way to do it. |
Hello, I'm really sorry about that - I didn't see your PR for this issue 🙁 |
May I politely ask when we can expect V.1.11.1 to be released? We are waiting to deploy several new hosts, but can't because the PS "update from snapshot option" doesn't offer to install anything. IMO if a released version has severe bugs, like complete failure of check plugins, there should be either a new subversion available as soon as the issue is fixed, or the complete rollout procedure should be generally thought over. Something like a Release Candidate of Beta channel for early adopters, but then the released software should be more stable than it is now. |
Invoke-IcingaCheckMemory reports a Pagefile usage of
157.29TB
:Actual usage via
Win32_PageFileUsage
reports 150MB out of 1920MB:Version information:
The text was updated successfully, but these errors were encountered: