enh(core): counter template - can use negative and float values for min/max (#3266)

This commit is contained in:
qgarnier 2021-11-22 09:03:41 +01:00 committed by GitHub
parent 594c35863f
commit 48ffc55fbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -195,13 +195,13 @@ sub perfdata {
$template = $perf->{template} if (defined($perf->{template}));
$label = $perf->{label} if (defined($perf->{label}));
if (defined($perf->{min})) {
$min = ($perf->{min} =~ /[^0-9]/) ? $self->{result_values}->{$perf->{min}} : $perf->{min};
$min = ($perf->{min} =~ /[^0-9.-]/) ? $self->{result_values}->{$perf->{min}} : $perf->{min};
}
if (defined($perf->{max})) {
$max = ($perf->{max} =~ /[^0-9]/) ? $self->{result_values}->{$perf->{max}} : $perf->{max};
$max = ($perf->{max} =~ /[^0-9.-]/) ? $self->{result_values}->{$perf->{max}} : $perf->{max};
}
if (defined($perf->{threshold_total})) {
$th_total = ($perf->{threshold_total} =~ /[^0-9]/) ? $self->{result_values}->{$perf->{threshold_total}} : $perf->{threshold_total};
$th_total = ($perf->{threshold_total} =~ /[^0-9.-]/) ? $self->{result_values}->{$perf->{threshold_total}} : $perf->{threshold_total};
}
my $instances;