Imported Config files w/o Error. Apply files with no details

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bbramlett
Posts: 8
Joined: Thu Apr 17, 2014 1:59 am

Imported Config files w/o Error. Apply files with no details

Post by bbramlett »

Worked around the XI Import process documents that do not matching the XI 2014 version.
We are using working object configuration files from the CORE version, and they finally Import and Verify and Write, but when you restart Nagios it fails with no details or reasons why to correct.
Trying to Apply in other screens also fails with no details to correct it.

Command submitted for processing...
Waiting for configuration verification....
Configuration verification failed.
An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.

How do we identify what the Nagios Verifier does not see as an issue until you restart nagios so we can determine if jumping to Nagios XI is worth it or more stable than Core?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Imported Config files w/o Error. Apply files with no det

Post by slansing »

So it does not appear as though they are actually verifying correctly, what is the output of the following?:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
bbramlett
Posts: 8
Joined: Thu Apr 17, 2014 1:59 am

Re: Imported Config files w/o Error. Apply files with no det

Post by bbramlett »

This core 4.0.5 parser shows missing references to host groups that the import process erased/ignored from the original files.
I had to manually added them back in and match to the existing hostgroups Nagios comes with (windows-server), and got it working.
It does not import the other resource assignments/such we had .. that passed the PHP cmd line prep process. Oh well.

We have 3 other environments to upgrade with 100's of hosts, so don't want to use the Web GUI.
1. To get through this inefficient workflow to upgrade from 3.5.1 to XI 2014 (build 2014 and migrate configs) are these CFG files the Source of Truth?
No details are found on the import to DB, versus CFG files that will be used and when they are, etc. So it is not clear what applies or does not and when.

2. How do we determine which folders are queued up versions of configs from the previous import attempts to be applied, versus mandatory CFG files for XI, versus which ones are just samples, versus which ones are the resultant ones being used, versus what the DB honors or does not?

Which begs, if regular "Core" version CFG files outside the DB can be used/edited, do I need the buggy import process?

3. Can't I just place working CFG files into this path, have it overwrite the DB with them, and avoid the import process, if so, which folder?

4. How/where do I bulk clear the DB data entries and config entries, to start clean for another import attempt?
Files are written that have duplicate entries, when the originals don't have them.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Imported Config files w/o Error. Apply files with no det

Post by lmiltchev »

You you don't want to import via the web UI, you can probably do the following:

1. Make sure you don't have any config errors. Apply Configuration, so that you will have a "good" config snapshot to revert to in case you mess up your configs, during the import.

2. Place all of the files that you want to import in the "/usr/local/nagios/etc/import/" directory

3. Run the following commands:

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
If you run into some issues (config errors that you cannot fix), you can always revert to the previous "good" snapshot by going to:

Code: Select all

Admin->Config Snapshots->Restore
Note: Keep in mind that we recommend importing in the following order:

commands -> timeperiods -> contacttemplates -> contacts -> contactgroups ->
hosttemplates -> hosts -> hostgroups -> servicetemplates -> services -> servicegroups
Be sure to check out our Knowledgebase for helpful articles and solutions!
bbramlett
Posts: 8
Joined: Thu Apr 17, 2014 1:59 am

Re: Imported Config files w/o Error. Apply files with no det

Post by bbramlett »

Thanks this helps! Applying this and will reply back.
bbramlett
Posts: 8
Joined: Thu Apr 17, 2014 1:59 am

Re: Imported Config files w/o Error. Apply files with no det

Post by bbramlett »

Don't understand why Nagios XI 2014 the latest version does not understand the working Nagios Core 3.5.x CFG files?
We would have to spend days entering this stuff in manually to just determine if this fixes the unreliability with Nagios Core, and so we can get better than this protracted email support model with Nagios.

Tools/Import Method
The files are good and the CFGPREP on each file creates the updated /orig files into /cfgprep with not error messages, just goes to new cmd line for next parse.
Running the Tools/Import works with no errors, and the Verify says good. Run the Write files and it chokes.

Import Folder
Placing the CFG files in the /import folder works and imports at least the hosts and contacts, etc. but fails when viewing them in the GUI with missing service template references, that are actually in the service template files we placed for import.
Adding them into the GUI does not work to resolve what the CFG files did not import.
Nothing logs the details of what it is complaining about, or we don't know where that is.

Config Checks to Diagnose
Running a -v on the files can only run on a single file at a time fails because it does not understand the references (in other files).
Is there a cfg_dir option (as was with previous versions) that I can temporarily enable. I will hack and see if cfg_dir works and can be part of the "-v check".
The entries get into the DB and in the GUI, but running Apply and they fail. Adding what it wants from the Apply message in the GUI-DB (that mysteriously) did not import does not work.

SUMMARY
Q. What logs can indicate what is missing or can identify what XI needs so we don't have to manually spend days entering stuff in again? :(
Q. What settings can we use to allow the -v check to read all the files in a folder to identify the issue?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Imported Config files w/o Error. Apply files with no det

Post by tmcdonald »

Have you requested a Quickstart yet? A Quickstart is a free one-hour remote session with voice chat where we can help you get started with XI, although we sometimes will tackle issues such as these that are a little more advanced than a simple intro. I'm not sure of your timezone or operating hours, but if you are available between 9AM and 2PM CDT we can start the quickstart somewhere in there.

http://www.nagios.com/services/quickstart/request
Former Nagios employee
bbramlett
Posts: 8
Joined: Thu Apr 17, 2014 1:59 am

Re: Imported Config files w/o Error. Apply files with no det

Post by bbramlett »

Yes, I contacted sales this morning to get our support options and the soonest avail QuickStart is setup for tomorrow morning.
Thx
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Imported Config files w/o Error. Apply files with no det

Post by lmiltchev »

Great!
Be sure to check out our Knowledgebase for helpful articles and solutions!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Imported Config files w/o Error. Apply files with no det

Post by tmcdonald »

Notes from quickstart:
  • "register 0" needs to be included in any of the templates you wish to use or they will not be imported properly
  • Any files created by xiconfigprep with a size of 0 can be ignored when importing
  • Use the write->verify->fix cycle to troubleshoot issues
Former Nagios employee
Locked