mirror of https://github.com/Icinga/icinga2.git
Config Conversion: Check that icinga.cfg is passed via -c option.
This commit is contained in:
parent
61f0f7edc7
commit
4668f6fb3b
|
@ -46,7 +46,7 @@ sub get_key_from_icinga1_main_cfg {
|
||||||
my @key_arr = ();
|
my @key_arr = ();
|
||||||
|
|
||||||
if ( !-f $file) {
|
if ( !-f $file) {
|
||||||
errlog(1, "cfg file $file does not exist!");
|
print "cfg file $file does not exist!";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ GetOptions(
|
||||||
"V|version" => \$opt->{version}
|
"V|version" => \$opt->{version}
|
||||||
);
|
);
|
||||||
|
|
||||||
my $icinga1_cfg = "/etc/icinga/icinga.cfg";
|
my $icinga1_cfg;
|
||||||
my $icinga2_cfg = {};
|
my $icinga2_cfg = {};
|
||||||
my $conf_prefix = "./conf";
|
my $conf_prefix = "./conf";
|
||||||
my $verbose = 1;
|
my $verbose = 1;
|
||||||
|
@ -138,6 +138,11 @@ my $type_cnt;
|
||||||
|
|
||||||
# TODO import/export files in parallel?
|
# TODO import/export files in parallel?
|
||||||
|
|
||||||
|
# verify that we have something to read
|
||||||
|
if ( !-f $icinga1_cfg) {
|
||||||
|
pod2usage(1);
|
||||||
|
}
|
||||||
|
|
||||||
# the import
|
# the import
|
||||||
my $icinga1_cfg_obj = Icinga2::ImportIcinga1Cfg::parse_icinga1_objects($icinga1_cfg);
|
my $icinga1_cfg_obj = Icinga2::ImportIcinga1Cfg::parse_icinga1_objects($icinga1_cfg);
|
||||||
my $icinga1_cfg_obj_cache = Icinga2::ImportIcinga1Cfg::parse_icinga1_objects_cache($icinga1_cfg);
|
my $icinga1_cfg_obj_cache = Icinga2::ImportIcinga1Cfg::parse_icinga1_objects_cache($icinga1_cfg);
|
||||||
|
|
Loading…
Reference in New Issue