Page 1 of 1

Failed cfg import

Posted: Mon Oct 10, 2011 1:00 pm
by bvinisky
Hi,

I'm trying to import some cfg files that have been prepped with the nagios import tool. i've imported commands, timeperiods, and all contact information. I wanted to make sure this applied cleanly before importing host and service information. However, the configuration cannot be applied. I receive this error message: "Error: Unexpected start of object definition in file '/usr/local/nagios/etc/commands.cfg' on line 949. Make sure you close preceding objects before starting a new one.
Error processing object config files!"

When I look at any of the commands.cfg that I have, I cannot find a line 949. None of the files are that long. I gather that NagiosXI is building this file during the 'Apply Configuration' and running into problems when doing that. How do I fix this? Is there something i need to do in the db? I can't find a way to reset so I can do the import over. Using the reset scripts in nagiosxi/scripts/ leads to the same error.

Thanks,

Bryant

Re: Failed cfg import

Posted: Tue Oct 11, 2011 12:03 pm
by bvinisky
I reinstalled to resolve this problem. However, i'm still curious how to fix this in case it comes up again. The information provided from the snapshot hasn't been that helpful:

Reading configuration data...
Read main config file okay...
Processing object config directory '/usr/local/nagios/etc/static'...
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/commands.cfg'...
Error: Unexpected start of object definition in file '/usr/local/nagios/etc/commands.cfg' on line 1124. Make sure you close preceding objects before starting a new one.
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.

Re: Failed cfg import

Posted: Wed Oct 12, 2011 9:06 am
by mguthrie
In the Core Config Manager->Commands page, you can click the "Download" button to view the config file that will be generated when you Apply Configuration. That's an easy way to view what it's trying to write out to the config files.