Page 2 of 3

Re: Errors importing cfg files into Nagios XI

Posted: Wed Apr 16, 2014 10:38 am
by rickwilson7425
I am making progress but am getting a persistent error when verifying the config files. I have edited the file to take out the definition at that line number and it still bombs at the same line number. Here is the message:

Error: Unexpected start of object definition in file '/usr/local/nagios/etc/commands.cfg' on line 369. Make sure you close preceding objects before starting a new one.

Nagios Core 3.5.0
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 03-15-2013
License: GPL

Website: http://www.nagios.org
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 369. 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: Errors importing cfg files into Nagios XI

Posted: Wed Apr 16, 2014 10:53 am
by abrist
rickwilson7425 wrote:Error: Unexpected start of object definition in file '/usr/local/nagios/etc/commands.cfg' on line 369. Make sure you close preceding objects before starting a new one.
This sounds like you have an object that was not closed with a " } ". What is the output of:

Code: Select all

head -379 /usr/local/nagios/etc/commands.cfg | tail -20

Re: Errors importing cfg files into Nagios XI

Posted: Wed Apr 16, 2014 1:22 pm
by rickwilson7425
It is:

[root@pcp045088pcs etc]# head -379 /usr/local/nagios/etc/commands.cfg | tail -20
define command {
command_name check_windows_remoting
command_line $USER1$/check_x224 -H $HOSTADDRESS$
}
define command {
command_name check_windows_memory_physical
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckMEM -a MaxWarn=$ARG1$% MaxCrit=$ARG2$% ShowAll type=physical
}
define command {
command_name check_windows_cluster
command_line $USER1$/check_cluster --service -l $ARG1$ -w $ARG2$ -c $ARG3$ -d $ARG4$
}
define command {
command_name check_nrpe_disk_generic
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_nrpe_filesystem_generic -a "$ARG1$"
}
define command {
command_name check_windows_file
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckFiles -a path="$ARG1$" pattern=$ARG2$ filter="$ARG3$ $ARG4$ $ARG5$" MaxCrit=1
}

Re: Errors importing cfg files into Nagios XI

Posted: Wed Apr 16, 2014 3:26 pm
by tmcdonald
Could you PM that contacts.cfg file to me so I can see the whole thing?

EDIT: Sorry for the confusion, I meant the commands.cfg file

Re: Errors importing cfg files into Nagios XI

Posted: Tue Apr 22, 2014 9:40 am
by tmcdonald
The file that you sent me, commands.cfg, is that the /usr/local/nagios/etc/commands.cfg file? It doesn't have the typical format (comments at the top) that XI typically uses. There are only 268 lines in that file.

Re: Errors importing cfg files into Nagios XI

Posted: Mon Apr 28, 2014 12:09 pm
by tmcdonald
Worked with rickwilson via PM. Could not find any commands.cfg file with 369 lines anywhere in his /usr/local/nagios/etc directory.

Re: Errors importing cfg files into Nagios XI

Posted: Mon May 05, 2014 9:47 am
by rickwilson7425
I tried installing a fresh copy of NagiosXI from source code onto a RedHat 6.5 virtual system.

Everything went fine until I started importing the processed original cfg files.

I imported the commands.cfg, wrote the config file and verified it. It worked fine.

I then imported the timeperiods.cfg and again everything went fine.

Then I imported the notification_commands.cfg. I wrote the config out to disk without errors. When I tried to verify the config file I got an error message that there was a missing close bracket for a definition at line 736. This is the same thing that has happened previously with 3 separate installations and attempts to convert the core 3.5 files into XI. Close examination of the file shows that there are no missing brackets.

Re: Errors importing cfg files into Nagios XI

Posted: Mon May 05, 2014 12:48 pm
by lmiltchev
Let's clarify - you imported the "commands.cfg", wrote the config and verified it. Then you imported the "timeperiods.cfg", wrote it, and verified it. Up to this point you didn't get any config errors. Only after importing the "notification_commands.cfg", you got the config errors, correct?
Can you PM this file to any of us on the Nagios Tech Support team?

Re: Errors importing cfg files into Nagios XI

Posted: Mon May 05, 2014 1:08 pm
by rickwilson7425
That is correct.

I already PM'ed Tim McDonald and sent him the file a week ago.

Re: Errors importing cfg files into Nagios XI

Posted: Mon May 05, 2014 1:35 pm
by rickwilson7425
lmiltchev - I sent you a PM with the error and the files attached.