From 889d2729e3d82dfc79945d280320e70b36582cc1 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Mon, 22 Nov 2021 09:03:41 +0100 Subject: [PATCH] enh(core): counter template - can use negative and float values for min/max (#3266) --- centreon-plugins/centreon/plugins/values.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-plugins/centreon/plugins/values.pm b/centreon-plugins/centreon/plugins/values.pm index 886fe9aaa..785b91fd8 100644 --- a/centreon-plugins/centreon/plugins/values.pm +++ b/centreon-plugins/centreon/plugins/values.pm @@ -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;