icinga-powershell-plugins
icinga-powershell-plugins copied to clipboard
Invoke-IcingaCheckUsedPartitionSpace throws an error if the argument -CheckUsedSpace is set
After updating the icinga-powershell-plugins from version 1.9.0 to version 1.10.0 I get the following error message when using the argument "-CheckUsedSpace" for the check IcingaCheckUsedPartitionSpace.
Icinga Exception: The argument transformation for the parameter "CheckUsedSpace" cannot be processed. The value "System.String" cannot be converted to the type "System.Management.Automation.SwitchParameter". Boolean parameters only accept Boolean values or numbers like "$True", "$False", "1" or "0". CheckCommand: Invoke-IcingaCheckUsedPartitionSpace Arguments: System.Collections.Hashtable StackTrace: bei Exit-IcingaExecutePlugin, C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1: Zeile 26461 bei , : Zeile 1
I have already tried to rebuild the framework cache on the affected servers. Unfortunately without success. I suspect it is a bug in the conversion of the arguments.
Icinga for Windows environment overview:
Environment configuration:
PowerShell Root => C:\Program Files\WindowsPowerShell\Modules
Icinga for Windows Service Path => C:\Program Files\icinga-framework-service
Icinga for Windows Service User => NT AUTHORITY\NetworkService Icinga for Windows Service Pid => 3388 Icinga for Windows JEA Pid => Icinga Agent Path => C:\Program Files\ICINGA2
Icinga Agent User => NT AUTHORITY\NetworkService Defined Default User => NT AUTHORITY\NetworkService Icinga Managed User => False PowerShell Version => 5.1.20348.859 Operating System => Microsoft Windows Server 2022 Datacenter Operating System Version => 10.0.20348 JEA Context => JEA Session File => Api Check Forwarder => True Debug Mode => FalseIcinga for Windows Certificate:
Not installed
List of configured background daemons on this system:
Start-IcingaWindowsRESTApi
No arguments defined
List of configured background service checks on this system: => https://icinga.com/docs/icinga-for-windows/latest/doc/110-Installation/06-Collect-Metrics-over-Time/
No background service checks configured
List of configured repositories on this system. The list order matches the apply order:
Icinga Stable
CloneSource => Enabled => True LocalPath => Order => 0 RemotePath => https://packages.icinga.com/IcingaForWindows/stable/ifw.repo.json UseSCP => False
Installed components on this system:
Component Version Available
agent 2.13.5 2.13.5 framework 1.10.0 1.10.0 plugins 1.10.0 1.10.0 service 1.2.0 1.2.0
Available versions flagged with "*" mean that this component is locked to this version
Can you please test this behaviour with 1.10.1 tomorrow? I can't reproduce this issue and it might have resolved itself.
I just ran into the same issue. After changing from Invoke-IcingaCheckUsedPartitionSpace to Invoke-IcingaCheckPartitionSpace the parameter isn't needed any more, but it would be working if needed.
The documentation of Invoke-IcingaCheckUsedPartitionSpace is misleading and doesn't explain the name change to Invoke-IcingaCheckPartitionSpace (I think this happened in 1.7). Since then Invoke-IcingaCheckUsedPartitionSpace is just an alias. So it seems that just the alias version has problems.
It's also worth mentioning that the examples in the documentation are wrong (missing percentage sign).
Thanks for the message. Have you tried to run the plugins with version v1.10.1 yet? There were some changes made regarding plugin compilation to fix the alias handling.
For the documentation I will provide an update in the next weeks, as there are many topics that require some smaller updates.
Actually I made my tests with version 1.10.1.