Importing Core config files....error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
[email protected]
Posts: 38
Joined: Fri Mar 28, 2014 9:27 am

Importing Core config files....error

Post by [email protected] »

Fresh install of ova as of today of CentOS running XI version 2014R1.0

Running Core 3.5.0 in production and working on moving to XI. Bought the licenses a while back, but haven't really had the time to focus on it. Set up a couple of dev hosts with XI on it and have begun trying to get our Core instance imported into XI. Followed all the import wiki docs and got the 'Write', 'Verify', then restart done fine( no errors at the end after I deleted the problem config files). Now I did run into errors when doing the verify and deleted config files from the : /usr/local/nagios/etc/hosts/ directory that we no longer use( they were giving me errors during the import). Is that the proper way to do it?

Anyways when I go to apply the configuration it errors out. Check the config and this is the error it gives me:

Nagios Core 4.0.5
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 04-11-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting at line 14)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting at line 92)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 14)
Error: Template 'dummy-host' specified in host definition could not be not found (config file '/usr/local/nagios/etc/hosts/rtp5-1b-dci03c-gw2.cfg', starting on line 14)
Error processing object config files!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

Ok so the config file it errored out on was one of the ones I deleted.......supposedly. I'm certain I'm leaving out a ton of info that you need, but I've been fighting with this for a couple of days and after much googling really haven't come up with an answer.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Importing Core config files....error

Post by tmcdonald »

It sounds like you are mixing static config files with the CCM. In XI you typically will use the CCM for everything and should never have to edit or remove a file by hand. Do you have anything in your /usr/local/nagios/etc/static directory?
Former Nagios employee
[email protected]
Posts: 38
Joined: Fri Mar 28, 2014 9:27 am

Re: Importing Core config files....error

Post by [email protected] »

this is what's in there
xiobjects.cfg xitemplates.cfg xitest.cfg

this is what the objects file looks like

# XI OBJECTS - DO NOT MODIFY!



####################################################
# CONTACTS
####################################################

define contact{
contact_name xi_default_contact
email root@localhost
alias Default Contact
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handler
host_notification_period xi_timeperiod_none
service_notification_period xi_timeperiod_none
host_notification_options n
service_notification_options n
}


####################################################
# HOST GROUPS
####################################################



####################################################
# TIMEPERIODS
####################################################

define timeperiod{
timeperiod_name xi_timeperiod_none
alias None
}
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Importing Core config files....error

Post by tmcdonald »

Do you have a disabled template in the CCM called "dummy-host" by chance?
Former Nagios employee
[email protected]
Posts: 38
Joined: Fri Mar 28, 2014 9:27 am

Re: Importing Core config files....error

Post by [email protected] »

went to ccm->host templates and don't see anything labeled dummy host. We used dummy host in Nagios Core for things like gateways, switches and routers. So upon trying to import config files Nagios XI is fine with the import and write portion. Verifying I had to delete the hosts that were gateways we are no longer monitoring as it freaked out. Got through that fine eventually. Then apply configuration fails.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Importing Core config files....error

Post by tmcdonald »

You will need to re-create the dummy-host template in the CCM if your hosts are relying on it being there.
Former Nagios employee
[email protected]
Posts: 38
Joined: Fri Mar 28, 2014 9:27 am

Re: Importing Core config files....error

Post by [email protected] »

Ok so I created a dummy_host template and I am beginning the import process again. We have our hosts, hostgroups and services all in one config file. I have just ran the import tool: php /usr/local/nagiosxi/tools/xiprepimport.php on my commands, contacts, my config file( with hosts, services and host groups) and my timeperiods. My output is this:
-rw-r--r-- 1 root nagios 6534 May 29 15:18 commands.cfg
-rw-r--r-- 1 root nagios 862 May 29 15:18 contacts.cfg
-rw-r--r-- 1 root nagios 1845 May 29 15:18 _empty_host.cfg
-rw-r--r-- 1 root nagios 140 May 29 15:18 ias-code-mtv.cfg
-rw-r--r-- 1 root nagios 25502 May 29 15:18 _multiple_hosts.cfg
-rw-r--r-- 1 root nagios 45232 May 29 15:18 pki.cfg
-rw-r--r-- 1 root nagios 993 May 29 15:18 timeperiods.cfg

Which of those files should I import? pki(has all our hosts, groups and services), timeperiods, contacts and commands make sense. The ias-code one is another host.....why it broke it out on its own is beyond me. Also is it possible to import just the hosts/host groups/services config file and not the rest? Then configure those through the UI or are they dependent on one another?
Last edited by [email protected] on Thu May 29, 2014 2:28 pm, edited 1 time in total.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Importing Core config files....error

Post by scottwilkerson »

[email protected] wrote:Which of those files should I import?
All of them
[email protected] wrote:Also does is it possible to import just the hosts/host groups/services config file and not the rest?
Not likely because these hosts/host groups/services configs will likely have commands and templates specified that are in use and if you do not import the templates and commands, it will be missing items like it was prior.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Importing Core config files....error

Post by sreinhardt »

When I do our paid imports, I use the following commands to determine the order of import. Some things will absolutely get duplicated, and in some cases a few files may never get imported if they do not provide anything. Go through these in order, and import every file that each command says, at each step. Again you will almost definitely get duplicates, and some errors, but it should import everything in your configs. In your case, you might be able to better judge or separate out what needs to be imported when if you have the configs already separated out somewhat.

Code: Select all

grep -Ri 'define command{' ./ | sort -u
grep -Ri 'define timeperiod{' ./ | sort -u
grep -Ri 'define contact{' ./ | sort -u
grep -Ri 'define contact{' ./ | sort -u
grep -Ri 'define contactgroup{' ./ | sort -u
grep -Ri 'define host{' ./ | sort -u
grep -Ri 'define host{' ./ | sort -u
grep -Ri 'define hostgroup{' ./ | sort -u
grep -Ri 'define service{' ./ | sort -u
grep -Ri 'define service{' ./ | sort -u
grep -Ri 'define servicegroup{' ./ | sort -u
Note: I move the original files before importing begins, but after import prep happens, to make this all much more readable and so that you don't have to ignore ./orig/ files. Also you should run these commands from the cfgprep directory.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
[email protected]
Posts: 38
Joined: Fri Mar 28, 2014 9:27 am

Re: Importing Core config files....error

Post by [email protected] »

So seeing the above options that are available for import do you feel I'm missing something by chance? Some dependency that I missed the first time?

This is the order I'm preparing my import as:
1.commands.cfg
2.timeperiods.cfg
3.contacts.cfg
4.pki.cfg
5.ias-code-mtv.cfg
6._multiple_hosts.cfg
7._empty_host.cfg

look correct, incorrect, missing stuff, etc?
Locked