mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
(collection) use all variables in thresholds attributes (#3569)
This commit is contained in:
parent
75aa25b152
commit
d039666f45
@ -1460,8 +1460,14 @@ sub prepare_variables {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
return undef if (!defined($options{value}));
|
return undef if (!defined($options{value}));
|
||||||
$options{value} =~ s/%\(([a-zA-Z0-9\._:]+?)\)/\$expand->{'$1'}/g;
|
|
||||||
return $options{value};
|
while ($options{value} =~ /%\(([a-zA-Z0-9\.]+?)\)/g) {
|
||||||
|
next if ($1 =~ /^http\./);
|
||||||
|
$options{value} =~ s/%\(($1)\)/\$expand->{'$1'}/g;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $expression = $self->substitute_string(value => $options{value});
|
||||||
|
return $expression;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_filter {
|
sub check_filter {
|
||||||
|
@ -1318,8 +1318,14 @@ sub prepare_variables {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
return undef if (!defined($options{value}));
|
return undef if (!defined($options{value}));
|
||||||
$options{value} =~ s/%\(([a-zA-Z0-9\.]+?)\)/\$expand->{'$1'}/g;
|
|
||||||
return $options{value};
|
while ($options{value} =~ /%\(([a-zA-Z0-9\.]+?)\)/g) {
|
||||||
|
next if ($1 =~ /^snmp\./);
|
||||||
|
$options{value} =~ s/%\(($1)\)/\$expand->{'$1'}/g;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $expression = $self->substitute_string(value => $options{value});
|
||||||
|
return $expression;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_filter {
|
sub check_filter {
|
||||||
|
@ -1222,8 +1222,14 @@ sub prepare_variables {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
return undef if (!defined($options{value}));
|
return undef if (!defined($options{value}));
|
||||||
$options{value} =~ s/%\(([a-zA-Z0-9\._:]+?)\)/\$expand->{'$1'}/g;
|
|
||||||
return $options{value};
|
while ($options{value} =~ /%\(([a-zA-Z0-9\.]+?)\)/g) {
|
||||||
|
next if ($1 =~ /^sql\./);
|
||||||
|
$options{value} =~ s/%\(($1)\)/\$expand->{'$1'}/g;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $expression = $self->substitute_string(value => $options{value});
|
||||||
|
return $expression;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_filter {
|
sub check_filter {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user