Problem importing existing Nagios/Icinga files

Support requests, bug reports, questions etc.
kaplan71
NConf supporter
NConf supporter
Posts: 37
Joined: Tue Nov 01, 2011 00:34

Problem importing existing Nagios/Icinga files

Post by kaplan71 » Fri May 25, 2012 16:54

Hello --

I am trying to import the existing configuration files on an Icinga 1.7 server into the nconf database. To that end I am using the add_items_from_nagios.pl script. As part of the import process, I am running the script with the -s option to preview the results. As an added measure, I piped the results of the simulations to text files, three of which have been included with this posting.

The results of the files posted are typical of the remaining files. Virtually all of the imports result in the scripts aborting their attempts to add the files to the database. The files in question were originally from a Nagios 3.3.1 server, and were successfully imported into an Icinga 1.7 installation. If more information is needed, please let me know.
Attachments
nconf_contactgroup_results.txt
(673 Bytes) Downloaded 191 times
nconf_contact_results.txt
(298 Bytes) Downloaded 201 times
nconf_checkcommand_results.txt
(328 Bytes) Downloaded 199 times

kaplan71
NConf supporter
NConf supporter
Posts: 37
Joined: Tue Nov 01, 2011 00:34

Re: Problem importing existing Nagios/Icinga files

Post by kaplan71 » Mon Jun 04, 2012 20:44

I have a follow-up to this posting. I started the installation procedure over by removing the existing nconf directory and database. I then went through the motions of installing the 1.2.6 release, and then upgrading nconf to the 1.3.0 distribution. Both the initial install and upgrade were completed without issue. The Generate utility was run, and was successful in creating the output file in both the initial install and subsequent upgrade.

I then went through the motions of trying to import the existing cfg files into the database. The first step here was to run the command in simulation mode. The command syntax used here was the following:
bin/add_items_from_nagios.pl -c timeperiod -f /usr/local/icinga/etc/objects/timeperiods.cfg -s
The output that was generated was the following:
[INFO] Running in simulation mode. No modifications will be made to the database!
[INFO] Started executing bin/add_items_from_nagios.pl
[WARN] 'monday' is defined more than once for timeperiod (starting at line 34). Using last instance.
[INFO] Adding timeperiod '24x7'
[WARN] timeperiod with timeperiod_name '24x7' already exists!
[ERROR] Failed to add timeperiod '24x7'. Aborting
Similar commands were run in the following order:
bin/add_items_from_nagios.pl -c misccommand -f /usr/local/icinga/etc/objects/misccommands.cfg -s
bin/add_items_from_nagios.pl -c checkcommand -f /usr/local/icinga/etc/objects/checkcommands.cfg -s
bin/add_items_from_nagios.pl -c contact -f /usr/local/icinga/etc/objects/contacts.cfg -s
The output that was generated in each case was as follows:

[ Initializing NConf perl-API (library version 0.3, written by A. Gargiulo) ]
[ Copyright (c) 2006 - 2012 Sunrise Communications AG, Zurich, Switzerland ]
[INFO] Running in simulation mode. No modifications will be made to the database!
[INFO] Started executing bin/add_items_from_nagios.pl
[INFO] Adding misccommand 'notify-host-by-email'
[WARN] misccommand with command_name 'notify-host-by-email' already exists!
[ERROR] Failed to add misccommand 'notify-host-by-email'. Aborting
[ Initializing NConf perl-API (library version 0.3, written by A. Gargiulo) ]
[ Copyright (c) 2006 - 2012 Sunrise Communications AG, Zurich, Switzerland ]

[INFO] Running in simulation mode. No modifications will be made to the database!
[INFO] Started executing bin/add_items_from_nagios.pl
[INFO] Adding misccommand 'notify-host-by-email'
[WARN] misccommand with command_name 'notify-host-by-email' already exists!
[ERROR] Failed to add misccommand 'notify-host-by-email'. Aborting
[ Initializing NConf perl-API (library version 0.3, written by A. Gargiulo) ]
[ Copyright (c) 2006 - 2012 Sunrise Communications AG, Zurich, Switzerland ]

[INFO] Running in simulation mode. No modifications will be made to the database!
[INFO] Started executing bin/add_items_from_nagios.pl
[INFO] Adding checkcommand 'check_local_disk'
[WARN] checkcommand with command_name 'check_local_disk' already exists!
[ERROR] Failed to add checkcommand 'check_local_disk'. Aborting
What steps do I need to take in order to successfully import the files in question into the database?

Locked