config conversion: Rename group attributes.

refs #4741
This commit is contained in:
Michael Friedrich 2013-09-25 14:20:50 +02:00
parent 00532f6da7
commit e236894de9
1 changed files with 11 additions and 6 deletions

View File

@ -345,9 +345,9 @@ sub dump_service_2x {
#say Dumper($service_2x->{'servicegroups'});
my $servicegroups = join '", "', @{$service_2x->{'servicegroups'}};
if ($service_2x->{'__I2_CONVERT_SG_ADD'} == 1) {
dump_config_line($icinga2_cfg, "\tservicegroups += [ \"$servicegroups\" ],");
dump_config_line($icinga2_cfg, "\tgroups += [ \"$servicegroups\" ],");
} else {
dump_config_line($icinga2_cfg, "\tservicegroups = [ \"$servicegroups\" ],");
dump_config_line($icinga2_cfg, "\tgroups = [ \"$servicegroups\" ],");
}
#say Dumper($service_description);
#say Dumper($service_2x->{'servicegroups'});
@ -538,9 +538,9 @@ sub dump_host_2x {
if(defined($host_2x->{'hostgroups'})) {
my $hostgroups = join '", "', @{$host_2x->{'hostgroups'}};
if ($host_2x->{'__I2_CONVERT_HG_ADD'} == 1) {
dump_config_line($icinga2_cfg, "\thostgroups += [ \"$hostgroups\" ],");
dump_config_line($icinga2_cfg, "\tgroups += [ \"$hostgroups\" ],");
} else {
dump_config_line($icinga2_cfg, "\thostgroups = [ \"$hostgroups\" ],");
dump_config_line($icinga2_cfg, "\tgroups = [ \"$hostgroups\" ],");
}
}
@ -692,9 +692,9 @@ sub dump_host_2x {
#say Dumper($service_2x->{'servicegroups'});
my $servicegroups = join '", "', @{$service_2x->{'servicegroups'}};
if ($service_2x->{'__I2_CONVERT_SG_ADD'} == 1) {
dump_config_line($icinga2_cfg, "\t\tservicegroups += [ \"$servicegroups\" ],");
dump_config_line($icinga2_cfg, "\t\tgroups += [ \"$servicegroups\" ],");
} else {
dump_config_line($icinga2_cfg, "\t\tservicegroups = [ \"$servicegroups\" ],");
dump_config_line($icinga2_cfg, "\t\tgroups = [ \"$servicegroups\" ],");
}
}
@ -993,6 +993,11 @@ sub dump_notification_2x {
dump_config_line($icinga2_cfg, "\tusers = [ \"$service_users\" ],");
}
if(defined($notification_2x->{'usergroups'}) && @{$notification_2x->{'usergroups'}} > 0) {
my $service_usergroups = join '", "', @{$notification_2x->{'usergroups'}};
dump_config_line($icinga2_cfg, "\tusergroups = [ \"$service_usergroups\" ],");
}
# this is set for escalations
if(defined($notification_2x->{'__I2CONVERT_NOTIFICATION_TIMES'}) && $notification_2x->{'__I2CONVERT_NOTIFICATION_TIMES'} != 0) {
dump_config_line($icinga2_cfg, "\ttimes = {");