mirror of https://github.com/Icinga/icinga2.git
Conversion: Fix notification attributes.
This commit is contained in:
parent
103a0a715e
commit
4c6f4261ee
|
@ -2348,9 +2348,15 @@ sub convert_2x {
|
|||
foreach my $notification_key (keys %{$notification}) {
|
||||
next if $notification->{$notification_key}->{'type'} ne 'service';
|
||||
|
||||
my $notifications_enabled = obj_1x_get_service_attr($cfg_obj_2x, $obj_2x_service, $obj_2x_service->{'__I2CONVERT_SERVICE_HOSTNAME'}, 'notifications_enabled');
|
||||
my $notification_interval = obj_1x_get_service_attr($cfg_obj_2x, $obj_2x_service, $obj_2x_service->{'__I2CONVERT_SERVICE_HOSTNAME'}, 'notification_internval');
|
||||
my $notification_period = obj_1x_get_service_attr($cfg_obj_2x, $obj_2x_service, $obj_2x_service->{'__I2CONVERT_SERVICE_HOSTNAME'}, 'notification_period');
|
||||
|
||||
$notification->{$notification_key}->{'__I2CONVERT_NOTIFICATION_FILTERS'} = $cfg_obj_2x->{'service'}->{$service_obj_2x_key}->{'__I2CONVERT_NOTIFICATION_FILTERS'};
|
||||
$notification->{$notification_key}->{'__I2CONVERT_NOTIFICATION_INTERVAL'} = $cfg_obj_2x->{'service'}->{$service_obj_2x_key}->{'notification_interval'};
|
||||
$notification->{$notification_key}->{'__I2CONVERT_NOTIFICATION_PERIOD'} = $cfg_obj_2x->{'service'}->{$service_obj_2x_key}->{'notification_period'};
|
||||
$notification->{$notification_key}->{'__I2CONVERT_NOTIFICATION_INTERVAL'} = $notification_interval;
|
||||
$notification->{$notification_key}->{'__I2CONVERT_NOTIFICATION_PERIOD'} = $notification_period;
|
||||
$notification->{$notification_key}->{'__I2CONVERT_NOTIFICATION_ENABLED'} = $notifications_enabled;
|
||||
#say Dumper($notification->{$notification_key});
|
||||
}
|
||||
}
|
||||
#say Dumper($obj_2x_service);
|
||||
|
|
|
@ -433,10 +433,6 @@ sub dump_service_2x {
|
|||
}
|
||||
}
|
||||
|
||||
if(defined($service_2x->{'notifications_enabled'})) {
|
||||
dump_config_line($icinga2_cfg, "\tenable_notifications = $service_2x->{'notifications_enabled'},");
|
||||
}
|
||||
|
||||
####################################################
|
||||
# other service attributes, if set
|
||||
####################################################
|
||||
|
@ -729,10 +725,6 @@ sub dump_host_2x {
|
|||
}
|
||||
}
|
||||
|
||||
if(defined($service_2x->{'notifications_enabled'})) {
|
||||
dump_config_line($icinga2_cfg, "\tenable_notifications = $service_2x->{'notifications_enabled'},");
|
||||
}
|
||||
|
||||
####################################################
|
||||
# other service attributes, if set
|
||||
####################################################
|
||||
|
@ -845,6 +837,9 @@ sub dump_user_2x {
|
|||
}
|
||||
}
|
||||
|
||||
if(defined($user_2x->{'notifications_enabled'})) {
|
||||
dump_config_line($icinga2_cfg, "\tenable_notifications = \"$user_2x->{'notifications_enabled'}\",");
|
||||
}
|
||||
####################################################
|
||||
# usergroups
|
||||
####################################################
|
||||
|
@ -953,7 +948,7 @@ sub dump_notification_2x {
|
|||
}
|
||||
|
||||
if(defined($notification_2x->{'__I2CONVERT_NOTIFICATION_PERIOD'})) {
|
||||
dump_config_line($icinga2_cfg, "\tnotification_period = $notification_2x->{'__I2CONVERT_NOTIFICATION_PERIOD'},");
|
||||
dump_config_line($icinga2_cfg, "\tnotification_period = \"$notification_2x->{'__I2CONVERT_NOTIFICATION_PERIOD'}\",");
|
||||
}
|
||||
|
||||
# this is set for escalations
|
||||
|
|
Loading…
Reference in New Issue