config: Temporarily set hostname for services.

This commit is contained in:
Gunnar Beutner 2013-09-13 13:05:55 +02:00
parent 4fdab9e2ac
commit e0d5e2bf93
1 changed files with 3 additions and 0 deletions

View File

@ -1396,7 +1396,10 @@ sub convert_2x {
# save all command args as macros
my $arg_cnt = 1;
foreach my $command_arg_1x (@command_args_1x) {
$obj_1x_service->{__I2CONVERT_SERVICE_HOSTNAME} = $service_host_name;
my $command_arg_2x = resolve_macros($cfg_obj_1x, $obj_1x_service, $command_arg_1x);
$obj_1x_service->{__I2CONVERT_SERVICE_HOSTNAME} = undef;
@$cfg_obj_2x{'service'}->{$service_cnt}->{'__I2CONVERT_MACROS'}->{"ARG" . $arg_cnt} = Icinga2::Utils::escape_str($command_arg_2x);
$arg_cnt++;
}