From d68be2674c43fb3e711c62e6705cf6f5891061b7 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Thu, 24 Apr 2025 08:16:33 +0200 Subject: [PATCH] Fixes AddSummaryHeader not adding any check information to check package --- doc/100-General/10-Changelog.md | 1 + lib/icinga/plugin/New-IcingaCheckPackage.psm1 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/100-General/10-Changelog.md b/doc/100-General/10-Changelog.md index 4c3aa88..da3e3ea 100644 --- a/doc/100-General/10-Changelog.md +++ b/doc/100-General/10-Changelog.md @@ -25,6 +25,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic * [#787](https://github.com/Icinga/icinga-powershell-framework/pull/787) Fixes the return value in case the `Agent` component could not be installed from `$FALSE` to `null` * [#796](https://github.com/Icinga/icinga-powershell-framework/issues/796) [#798](https://github.com/Icinga/icinga-powershell-framework/issues/798) Fixes an issue with the new check handling, which did not properly convert values from checks to the correct performance data values and base values in some cases * [#797](https://github.com/Icinga/icinga-powershell-framework/issues/797) Fixes plugins throwing `UNKNOWN` in case `-TresholdInterval` is used for Metrics over Time, when checks are newly registered and checked, before the first MoT is executed and collected +* [#809](https://github.com/Icinga/icinga-powershell-framework/issues/809) Fixes plugin compiler not handling `AddSummaryHeader` properly for nested check packages, not adding any check information ### Enhancements diff --git a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 index 7ed0322..bb786df 100644 --- a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 +++ b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 @@ -101,8 +101,8 @@ function New-IcingaCheckPackage() $CheckSummary = New-Object -TypeName 'System.Text.StringBuilder'; [bool]$HasContent = $FALSE; - # Only apply this to the top parent package - if ($this.__GetIndention() -eq 0) { + # Always apply this to the first package or if we specify AddSummaryHeader + if ($this.__GetIndention() -eq 0 -Or $this.AddSummaryHeader) { if ($this.__UnknownChecks.Count -ne 0) { $UnknownChecks = [string]::Format(' [UNKNOWN] {0}', ([string]::Join(', ', $this.__UnknownChecks))); $CheckSummary.Append(