From 79b4518189df1b392fbbd7dfd54b7e66e9a96f49 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Mon, 19 Aug 2019 18:08:50 +0200 Subject: [PATCH] Fixed Plugin Output for multiple check packages --- lib/icinga/plugin/New-IcingaCheckPackage.psm1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 index 5c11fcb..9c8ab0d 100644 --- a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 +++ b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 @@ -72,6 +72,8 @@ function New-IcingaCheckPackage() return; } + $this.compiled = $TRUE; + if ($this.checks.Count -ne 0) { if ($this.opand) { if ($this.CheckAllOk() -eq $FALSE) { @@ -109,12 +111,10 @@ function New-IcingaCheckPackage() $this.exitcode = $IcingaEnums.IcingaExitCode.Ok; } - if ($Verbose -eq $TRUE -Or [int]$this.exitcode -ne $IcingaEnums.IcingaExitCode.Unknown) { + if ($Verbose -eq $TRUE) { $this.PrintOutputMessages(); } - $this.compiled = $TRUE; - return $this.exitcode; } @@ -259,6 +259,7 @@ function New-IcingaCheckPackage() $Check | Add-Member -membertype ScriptMethod -name 'PrintOutputMessages' -value { [bool]$printDetails = $FALSE; [bool]$printAll = $FALSE; + switch ($this.verbose) { 0 { break; }; 1 { break; }; @@ -270,7 +271,6 @@ function New-IcingaCheckPackage() $printAll = $TRUE; break; } - } $this.WritePackageOutputStatus();