(collection) use all variables in thresholds attributes (#3569)

This commit is contained in:
qgarnier 2022-03-29 10:34:59 +02:00 committed by GitHub
parent 75aa25b152
commit d039666f45
3 changed files with 24 additions and 6 deletions

View File

@ -1460,8 +1460,14 @@ sub prepare_variables {
my ($self, %options) = @_;
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 {

View File

@ -1318,8 +1318,14 @@ sub prepare_variables {
my ($self, %options) = @_;
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 {

View File

@ -1222,8 +1222,14 @@ sub prepare_variables {
my ($self, %options) = @_;
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 {