diff --git a/centreon-plugins/apps/protocols/http/mode/collection.pm b/centreon-plugins/apps/protocols/http/mode/collection.pm index 5c2dbd193..1f8237279 100644 --- a/centreon-plugins/apps/protocols/http/mode/collection.pm +++ b/centreon-plugins/apps/protocols/http/mode/collection.pm @@ -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 { diff --git a/centreon-plugins/apps/protocols/snmp/mode/collection.pm b/centreon-plugins/apps/protocols/snmp/mode/collection.pm index 2fb2ff55b..5bfa825c9 100644 --- a/centreon-plugins/apps/protocols/snmp/mode/collection.pm +++ b/centreon-plugins/apps/protocols/snmp/mode/collection.pm @@ -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 { diff --git a/centreon-plugins/centreon/common/protocols/sql/mode/collection.pm b/centreon-plugins/centreon/common/protocols/sql/mode/collection.pm index 69e88208b..b3a853b9d 100644 --- a/centreon-plugins/centreon/common/protocols/sql/mode/collection.pm +++ b/centreon-plugins/centreon/common/protocols/sql/mode/collection.pm @@ -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 {