Merge pull request #262 from Icinga:fix/another_input_value_to_decimal_fix

Fix: Input value from check objects was sometimes not properly converted to decimal

Fixes input value conversion to `decimal` for check input values.
This commit is contained in:
Lord Hepipud 2021-05-29 11:36:07 +02:00 committed by GitHub
commit 9b5c64eacb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,6 +113,11 @@ function Compare-IcingaPluginThresholds()
$TempValue = (Convert-IcingaPluginThresholds -Threshold ([string]::Format('{0}{1}', $InputValue, $Unit))); $TempValue = (Convert-IcingaPluginThresholds -Threshold ([string]::Format('{0}{1}', $InputValue, $Unit)));
$InputValue = $TempValue.Value; $InputValue = $TempValue.Value;
$TmpUnit = $TempValue.Unit; $TmpUnit = $TempValue.Unit;
if (Test-Numeric $InputValue) {
[decimal]$InputValue = [decimal]$InputValue;
}
$IcingaThresholds.RawValue = $InputValue; $IcingaThresholds.RawValue = $InputValue;
$TempValue = (Convert-IcingaPluginThresholds -Threshold ([string]::Format('{0}{1}', $BaseValue, $Unit))); $TempValue = (Convert-IcingaPluginThresholds -Threshold ([string]::Format('{0}{1}', $BaseValue, $Unit)));
$BaseValue = $TempValue.Value; $BaseValue = $TempValue.Value;