From f9c192db6697469625194a508a74625aff54225e Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Wed, 11 Feb 2026 10:55:20 +0100 Subject: [PATCH] Fixes CPU check failing on certain machines with error "Divided by 0" --- doc/100-General/10-Changelog.md | 8 ++++++++ lib/core/framework/New-IcingaEnvironmentVariable.psm1 | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/100-General/10-Changelog.md b/doc/100-General/10-Changelog.md index f89550a..fd3993a 100644 --- a/doc/100-General/10-Changelog.md +++ b/doc/100-General/10-Changelog.md @@ -7,6 +7,14 @@ documentation before upgrading to a new release. Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed). +## 1.14.1 (2026-02-11) + +[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/43) + +### Bugfixes + +* [#859](https://github.com/Icinga/icinga-powershell-framework/issues/859) Fixes CPU plugin throwing an exception on certain Windows machines with `Divided by 0` + ## 1.14.0 (2026-02-11) [Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/38) diff --git a/lib/core/framework/New-IcingaEnvironmentVariable.psm1 b/lib/core/framework/New-IcingaEnvironmentVariable.psm1 index a8d1a6a..8885241 100644 --- a/lib/core/framework/New-IcingaEnvironmentVariable.psm1 +++ b/lib/core/framework/New-IcingaEnvironmentVariable.psm1 @@ -103,6 +103,6 @@ function New-IcingaEnvironmentVariable() 'FetchedServices' = $FALSE; } ); - $Global:Icinga.Protected.Add('CPUSockets', (Get-IcingaWindowsInformation Win32_Processor).Count); + $Global:Icinga.Protected.Add('CPUSockets', ([array](Get-IcingaWindowsInformation Win32_Processor)).count); } }