File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,8 @@ function Compare-IcingaPluginThresholds()
9797 [switch ]$IsBetween = $FALSE ,
9898 [switch ]$IsLowerEqual = $FALSE ,
9999 [switch ]$IsGreaterEqual = $FALSE ,
100- [string ]$TimeInterval = $null
100+ [string ]$TimeInterval = $null ,
101+ [switch ]$NoPerfData = $FALSE
101102 );
102103
103104 try {
@@ -109,6 +110,13 @@ function Compare-IcingaPluginThresholds()
109110 ' Interval' = $TimeInterval ;
110111 };
111112
113+ # Ensure we do not include our checks for which we do not write any performance data
114+ # Metrics over time will not work for those, as the metrics are not stored.
115+ # There just set the variable to null which means they won't be processed
116+ if ($NoPerfData ) {
117+ $MoTData = $null ;
118+ }
119+
112120 if ($TestInput.Decimal ) {
113121 [decimal ]$InputValue = [decimal ]$TestInput.Value ;
114122 }
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ function New-IcingaCheck()
3939 $IcingaCheck | Add-Member - MemberType NoteProperty - Name ' ObjectExists' - Value $ObjectExists ;
4040 $IcingaCheck | Add-Member - MemberType NoteProperty - Name ' Translation' - Value $Translation ;
4141 $IcingaCheck | Add-Member - MemberType NoteProperty - Name ' LabelName' - Value $LabelName ;
42- $IcingaCheck | Add-Member - MemberType NoteProperty - Name ' NoPerfData' - Value $NoPerfData ;
42+ $IcingaCheck | Add-Member - MemberType NoteProperty - Name ' NoPerfData' - Value ([ bool ] $NoPerfData ) ;
4343 $IcingaCheck | Add-Member - MemberType NoteProperty - Name ' __WarningValue' - Value $null ;
4444 $IcingaCheck | Add-Member - MemberType NoteProperty - Name ' __CriticalValue' - Value $null ;
4545 $IcingaCheck | Add-Member - MemberType NoteProperty - Name ' __LockedState' - Value $FALSE ;
@@ -490,6 +490,7 @@ function New-IcingaCheck()
490490 ' -ThresholdCache' = (Get-IcingaThresholdCache - CheckCommand $this.__CheckCommand );
491491 ' -Translation' = $this.Translation ;
492492 ' -TimeInterval' = $this.__TimeInterval ;
493+ ' -NoPerfData' = $this.NoPerfData ;
493494 };
494495 }
495496
You can’t perform that action at this time.
0 commit comments