From 4a40a001e8505f046d578839214408c9307a008e Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Mon, 26 Jan 2026 15:37:23 +0100 Subject: [PATCH] Fixes invalid threshold comparison in case either warning or critical threshold is empty --- lib/icinga/plugin/New-IcingaCheck.psm1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/icinga/plugin/New-IcingaCheck.psm1 b/lib/icinga/plugin/New-IcingaCheck.psm1 index 994f579..7c0de72 100644 --- a/lib/icinga/plugin/New-IcingaCheck.psm1 +++ b/lib/icinga/plugin/New-IcingaCheck.psm1 @@ -1075,6 +1075,11 @@ function New-IcingaCheck() return; } + # Just in case one of the thresholds is not set, we cannot validate anything + if ([string]::IsNullOrEmpty($this.__WarningValue.Threshold.Threshold) -or [string]::IsNullOrEmpty($this.__CriticalValue.Threshold.Threshold)) { + return; + } + [bool]$OutOfRange = $FALSE; # Both thresholds use the mode