Invoke-IcingaCheckMemory no longer accepts %-thresholds for Pagefile
mattpoel opened this issue · comments
Matthias commented
I'm not sure if this is related to #338, but up-to-date version of Invoke-IcingaCheckMemory does no longer accept %-thresholds for the Pagefile.
Command from debug.log and output on a fresh up-to-date system:
>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -ExecutionPolicy ByPass -C "try { Use-Icinga -Minimal; } catch { Write-Output 'The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check https://icinga.com/docs/windows for further details'; Write-Output 'Error:' $($_.Exception.Message)Components:`r`n$( Get-Module -ListAvailable 'icinga-powershell-*' )`r`n'Module-Path:'`r`n$($Env:PSModulePath); exit 3; }; Exit-IcingaExecutePlugin -Command 'Invoke-IcingaCheckMemory' " -Warning 98% -Critical 99% -PageFileWarning 70% -PageFileCritical 80% -IncludePageFile @() -ExcludePageFile @() -Verbosity 2
Exception calling "WarnOutOfRange" with "1" argument(s): "[UNKNOWN]: Icinga Invalid Input Error was thrown: ConversionUnitMissing
Unable to parse input value. You have to add an unit to your input value. Example: "10GB". Allowed units are: "B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB"."
Executing the same command on a system with an older version of IfW/plugins:
>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -ExecutionPolicy ByPass -C "try { Use-Icinga -Minimal; } catch { Write-Output 'The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check https://icinga.com/docs/windows for further details'; Write-Output 'Error:' $($_.Exception.Message)Components:`r`n$( Get-Module -ListAvailable 'icinga-powershell-*' )`r`n'Module-Path:'`r`n$($Env:PSModulePath); exit 3; }; Exit-IcingaExecutePlugin -Command 'Invoke-IcingaCheckMemory' " -Warning 98% -Critical 99% -PageFileWarning 70% -PageFileCritical 80% -IncludePageFile @() -ExcludePageFile @() -Verbosity 2
[OK] Memory Usage
\_ [OK] PageFile Usage
\_ [OK] C:\pagefile.sys: 34.20% (1.94GB)
\_ [OK] Used Memory: 88.48% (7.08GiB)
| 'memory::ifw_memory::used'=7599751000B;8417585540;8503479270;0;8589373000 'cpagefilesys::ifw_pagefile::used'=1941000000B;3973200000;4540800000;0;5676000000
Version information from working system:
Component Version Available
--- --- ---
agent 2.13.5 2.14.0
framework 1.10.0 1.11.0
plugins 1.10.0 1.11.0
service 1.2.0 1.2.0
Version information from the system facing the error:
Component Version Available
--- --- ---
agent 2.14.0 2.14.0
framework 1.11.0 1.11.0
plugins 1.11.0 1.11.0
service 1.2.0 1.2.0
Documentation for -PageFileWarning
and -PageFileCritical
mentions %-thresholds as an option:
It is possible to enter e.g. 10% as threshold value if you want a percentage comparison.