# DUMP ALL OBJECTS 2.x
################################################################################
+sub dump_cfg_resource_2x {
+ my $icinga2_cfg = shift;
+ my $icinga2_global_macros = shift;
+
+ start_object_type_config_dump($icinga2_cfg, 'resource');
+
+ dump_config_line($icinga2_cfg, "set IcingaMacros = {");
+ foreach my $global_macro_2x_key (sort keys %{$icinga2_global_macros}) {
+ dump_config_line($icinga2_cfg, "\t\"$global_macro_2x_key\" = \"$icinga2_global_macros->{$global_macro_2x_key}\",");
+ }
+
+ dump_config_line($icinga2_cfg, "}");
+
+ end_object_type_config_dump($icinga2_cfg);
+}
sub dump_cfg_obj_2x {
my $icinga2_cfg = shift;
if ($opt->{help}) { pod2usage(1); }
$icinga2_cfg->{'main'}= "$conf_prefix/icinga2.conf";
+$icinga2_cfg->{'resource'}= "$conf_prefix/resource.conf";
$icinga2_cfg->{'hosts'}= "$conf_prefix/hosts.conf";
$icinga2_cfg->{'services'}= "$conf_prefix/services.conf";
$icinga2_cfg->{'users'}= "$conf_prefix/users.conf";
my $icinga2_cfg_obj = Icinga2::Convert::convert_2x($icinga2_cfg, $icinga1_cfg_obj, $icinga1_cfg_obj_cache, $icinga1_user_macros);
# the export
+Icinga2::ExportIcinga2Cfg::dump_cfg_resource_2x($icinga2_cfg, $icinga1_user_macros);
Icinga2::ExportIcinga2Cfg::dump_cfg_obj_2x($icinga2_cfg, $icinga2_cfg_obj);
# vi: sw=4 ts=4 expandtab :