mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-29 00:24:46 +02:00
fix json (#2327)
This commit is contained in:
parent
b69ac6751c
commit
cc370eb5fb
@ -231,12 +231,12 @@ sub lookup {
|
|||||||
my $count = 0;
|
my $count = 0;
|
||||||
foreach my $value (@{$self->{values}}) {
|
foreach my $value (@{$self->{values}}) {
|
||||||
$count++;
|
$count++;
|
||||||
if ($value =~ /^[0-9.]+$/) {
|
if ($value =~ /^(?:[0-9.]+|([0-9.]*)e([-+]?)(\d*))$/) {
|
||||||
$value = centreon::plugins::misc::expand_exponential(value => $value);
|
my $value_expand = centreon::plugins::misc::expand_exponential(value => $value);
|
||||||
if ($self->{option_results}->{threshold_value} eq 'values') {
|
if ($self->{option_results}->{threshold_value} eq 'values') {
|
||||||
my $exit = lc(
|
my $exit = lc(
|
||||||
$self->{perfdata}->threshold_check(
|
$self->{perfdata}->threshold_check(
|
||||||
value => $value,
|
value => $value_expand,
|
||||||
threshold => [ { label => 'critical-numeric', exit_litteral => 'critical' }, { label => 'warning-numeric', exit_litteral => 'warning' } ]
|
threshold => [ { label => 'critical-numeric', exit_litteral => 'critical' }, { label => 'warning-numeric', exit_litteral => 'warning' } ]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -245,7 +245,7 @@ sub lookup {
|
|||||||
}
|
}
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => 'element_' . $count,
|
label => 'element_' . $count,
|
||||||
value => $value,
|
value => $value_expand,
|
||||||
warning => $self->{option_results}->{threshold_value} eq 'values' ? $self->{perfdata}->get_perfdata_for_output(label => 'warning-numeric') : undef,
|
warning => $self->{option_results}->{threshold_value} eq 'values' ? $self->{perfdata}->get_perfdata_for_output(label => 'warning-numeric') : undef,
|
||||||
critical => $self->{option_results}->{threshold_value} eq 'values' ? $self->{perfdata}->get_perfdata_for_output(label => 'critical-numeric') : undef
|
critical => $self->{option_results}->{threshold_value} eq 'values' ? $self->{perfdata}->get_perfdata_for_output(label => 'critical-numeric') : undef
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user