From 050461d8023c493f5fc060b0630abaf74aade5ef Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Sat, 29 May 2021 11:33:44 +0200 Subject: [PATCH] Fixes an issue with input value decimal conversion --- lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 b/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 index 3bc5d49..facfe7c 100644 --- a/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 +++ b/lib/icinga/plugin/Compare-IcingaPluginThresholds.psm1 @@ -113,6 +113,11 @@ function Compare-IcingaPluginThresholds() $TempValue = (Convert-IcingaPluginThresholds -Threshold ([string]::Format('{0}{1}', $InputValue, $Unit))); $InputValue = $TempValue.Value; $TmpUnit = $TempValue.Unit; + + if (Test-Numeric $InputValue) { + [decimal]$InputValue = [decimal]$InputValue; + } + $IcingaThresholds.RawValue = $InputValue; $TempValue = (Convert-IcingaPluginThresholds -Threshold ([string]::Format('{0}{1}', $BaseValue, $Unit))); $BaseValue = $TempValue.Value;