cisco sensor: manage when threshold low and high are the same

This commit is contained in:
garnier-quentin 2019-03-18 14:35:40 +01:00
parent 11fd902671
commit 18b41ae807
1 changed files with 10 additions and 2 deletions

View File

@ -140,6 +140,10 @@ sub get_default_warning_threshold {
}
}
# when it's the same value. Means no threshold.
if (defined($low_th) && defined($high_th) && $high_th < $low_th) {
return '';
}
my $th = '';
$th = centreon::plugins::misc::expand_exponential(value => $low_th) . ':' if (defined($low_th));
$th .= centreon::plugins::misc::expand_exponential(value => $high_th) if (defined($high_th));
@ -169,6 +173,10 @@ sub get_default_critical_threshold {
}
}
# when it's the same value. Means no threshold.
if (defined($low_th) && defined($high_th) && $high_th < $low_th) {
return '';
}
my $th = '';
$th = centreon::plugins::misc::expand_exponential(value => $low_th) . ':' if (defined($low_th));
$th .= centreon::plugins::misc::expand_exponential(value => $high_th) if (defined($high_th));