Skip to content

Commit 0ff9286

Browse files
authored
Merge pull request #811 from Icinga:fix/add_summary_header_for_check_compiler_not_adding_check_details
Fix: AddSummaryHeader not adding any check information to check package Fixes plugin compiler not handling `AddSummaryHeader` properly for nested check packages, not adding any check information ```powershell [WARNING] CPU Load [WARNING] Socket #0 (All must be [OK]) \_ [OK] Overall Load: 8.283808% \_ [WARNING] Socket #0: 2 Warning 3 Ok [WARNING] Core 0, Core 2 (All must be [OK]) \_ [WARNING] Core 0: Value 18.86168% is greater than threshold 9% \_ [OK] Core 1: 4.852731% \_ [WARNING] Core 2: Value 9.340026% is greater than threshold 9% \_ [OK] Core 3: 0.080795% \_ [OK] Core Total: 8.283808% | totalload::ifw_cpu::load=8.283808%;9;;0;100 0_0::ifw_cpu::load=18.86168%;9;;0;100 0_1::ifw_cpu::load=4.852731%;9;;0;100 0_2::ifw_cpu::load=9.340026%;9;;0;100 0_3::ifw_cpu::load=0.080795%;9;;0;100 0_total::ifw_cpu::load=8.283808%;9;;0;100 ```
2 parents 647cedb + d68be26 commit 0ff9286

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

doc/100-General/10-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
2525
* [#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`
2626
* [#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
2727
* [#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
28+
* [#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
2829

2930
### Enhancements
3031

lib/icinga/plugin/New-IcingaCheckPackage.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ function New-IcingaCheckPackage()
101101
$CheckSummary = New-Object -TypeName 'System.Text.StringBuilder';
102102
[bool]$HasContent = $FALSE;
103103

104-
# Only apply this to the top parent package
105-
if ($this.__GetIndention() -eq 0) {
104+
# Always apply this to the first package or if we specify AddSummaryHeader
105+
if ($this.__GetIndention() -eq 0 -Or $this.AddSummaryHeader) {
106106
if ($this.__UnknownChecks.Count -ne 0) {
107107
$UnknownChecks = [string]::Format(' [UNKNOWN] {0}', ([string]::Join(', ', $this.__UnknownChecks)));
108108
$CheckSummary.Append(

0 commit comments

Comments
 (0)