Merge pull request #859 from Icinga:fix/cpu_load_divided_by_zero

Fix: CPU check failing on certain machines with error "Divided by 0"

Fixes CPU plugin throwing an exception on certain Windows machines with "Divided by 0"
This commit is contained in:
Lord Hepipud 2026-02-11 10:59:03 +01:00 committed by GitHub
commit eb2a1cd0aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -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). 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) ## 1.14.0 (2026-02-11)
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/38) [Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/38)

View file

@ -103,6 +103,6 @@ function New-IcingaEnvironmentVariable()
'FetchedServices' = $FALSE; 'FetchedServices' = $FALSE;
} }
); );
$Global:Icinga.Protected.Add('CPUSockets', (Get-IcingaWindowsInformation Win32_Processor).Count); $Global:Icinga.Protected.Add('CPUSockets', ([array](Get-IcingaWindowsInformation Win32_Processor)).count);
} }
} }