diff --git a/doc/100-General/10-Changelog.md b/doc/100-General/10-Changelog.md index 553080f6..586962d6 100644 --- a/doc/100-General/10-Changelog.md +++ b/doc/100-General/10-Changelog.md @@ -15,6 +15,10 @@ 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` +## 1.13.3 (tbd) + +* [#800](https://github.com/Icinga/icinga-powershell-framework/pull/800) Fixes an issue for certain plugins, like `Invoke-IcingaCheckProcess`, which reports unknown if MetricsOverTime is used for checks that do not write performance data + ## 1.13.2 (2025-02-03) [Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/40) diff --git a/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 b/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 index 5b98ba32..0dae7aef 100644 --- a/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 +++ b/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 @@ -97,7 +97,8 @@ function Compare-IcingaPluginThresholds() [switch]$IsBetween = $FALSE, [switch]$IsLowerEqual = $FALSE, [switch]$IsGreaterEqual = $FALSE, - [string]$TimeInterval = $null + [string]$TimeInterval = $null, + [switch]$NoPerfData = $FALSE ); try { @@ -109,6 +110,13 @@ function Compare-IcingaPluginThresholds() 'Interval' = $TimeInterval; }; + # Ensure we do not include our checks for which we do not write any performance data + # Metrics over time will not work for those, as the metrics are not stored. + # There just set the variable to null which means they won't be processed + if ($NoPerfData) { + $MoTData = $null; + } + if ($TestInput.Decimal) { [decimal]$InputValue = [decimal]$TestInput.Value; } diff --git a/lib/icinga/plugin/New-IcingaCheck.psm1 b/lib/icinga/plugin/New-IcingaCheck.psm1 index bbefe8d0..16adf13e 100644 --- a/lib/icinga/plugin/New-IcingaCheck.psm1 +++ b/lib/icinga/plugin/New-IcingaCheck.psm1 @@ -39,7 +39,7 @@ function New-IcingaCheck() $IcingaCheck | Add-Member -MemberType NoteProperty -Name 'ObjectExists' -Value $ObjectExists; $IcingaCheck | Add-Member -MemberType NoteProperty -Name 'Translation' -Value $Translation; $IcingaCheck | Add-Member -MemberType NoteProperty -Name 'LabelName' -Value $LabelName; - $IcingaCheck | Add-Member -MemberType NoteProperty -Name 'NoPerfData' -Value $NoPerfData; + $IcingaCheck | Add-Member -MemberType NoteProperty -Name 'NoPerfData' -Value ([bool]$NoPerfData); $IcingaCheck | Add-Member -MemberType NoteProperty -Name '__WarningValue' -Value $null; $IcingaCheck | Add-Member -MemberType NoteProperty -Name '__CriticalValue' -Value $null; $IcingaCheck | Add-Member -MemberType NoteProperty -Name '__LockedState' -Value $FALSE; @@ -490,6 +490,7 @@ function New-IcingaCheck() '-ThresholdCache' = (Get-IcingaThresholdCache -CheckCommand $this.__CheckCommand); '-Translation' = $this.Translation; '-TimeInterval' = $this.__TimeInterval; + '-NoPerfData' = $this.NoPerfData; }; }