XI Config Import Prep Tool

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

XI Config Import Prep Tool

Post by jkinning »

I am still in the process of migrating over from Nagios Core to Nagios XI. I am running my cfg files from Nagios Core into XI but I have a directory in /usr/local/nagios/etc/contacts which has multiple user .cfg files along with other directories like pager, which have phone SMS numbers and alpha numeric pager numbers, view only to only view the web GUI. Is there an easy way to have the xiprepimport scripts take all the .cfg files within the top level directory /usr/local/nagios/etc/contacts and work it's magic and make these .cfg files ready in the /usr/local/nagios/etc/cfgprep directory?

I'm trying to follow the order that Nagios XI is recommending and don't have just one contacts.cfg file but multiple individual files. Any thoughts or recommendations?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: XI Config Import Prep Tool

Post by lmiltchev »

If you have multiple "contact" configs, you will need to run the config import prep tool against each source configuration file.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: XI Config Import Prep Tool

Post by jkinning »

In case this will help anyone else here is what I used.

Code: Select all

#!/bin/bash
find /root/nagios/<directory with sub directories> -type f -name "*.cfg" | while read cfg; do
php /usr/local/nagiosxi/tools/xiprepimport.php "$cfg";
done
I have been working on this for 2 days now and still can't get my old Nagios stuff into Nagios XI. I am attaching the error log when I try to apply the configuration.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: XI Config Import Prep Tool

Post by lmiltchev »

Can you post the "/usr/local/nagios/etc/serviceescalations.cfg" file?
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: XI Config Import Prep Tool

Post by jkinning »

###############################################################################
#
# Service escalations configuration file
#
# Created by: Nagios Core Config Manager 2.2.0
# Date: 2014-09-03 07:48:59
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

###############################################################################
#
# Service escalations configuration file
#
# END OF FILE
#
###############################################################################
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: XI Config Import Prep Tool

Post by jkinning »

I deactivated the entries I had listed in the Service Escalation window of the UI. I don't understand how they can be present there but not written to the config file which is tossing up the errors.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: XI Config Import Prep Tool

Post by slansing »

How did you import your config files? The order does matter and is outlined in the web UI before you import. This could have been caused by importing in the wrong order, or importing certain configs (escalations), then stopping, and importing the rest later (including the dependent hosts).
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: XI Config Import Prep Tool

Post by jkinning »

I imported those files in that order. Strange and I am also missing some service checks so I don't thing the import was really that helpful or successful.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: XI Config Import Prep Tool

Post by lmiltchev »

The configs won't be written if there are config errors. It is always a good idea to verify your configuration using the Write Config Tool (after importing files), BEFORE applying configuration. Config Import Proep Tools is not perfect but it does a pretty good job in the majority of the cases. I am surprised you are having so many issues. Can you apply configuration successfully now?
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: XI Config Import Prep Tool

Post by jkinning »

Luckily this is a VM which I took a snapshot prior too starting this conversion. I'll revert back to my original state and go through the import again this time using the Write Config File option as well.

I wouldn't think migrating all the cfg files from Nagios Core to Nagios XI would be so daunting.
Locked