Page 2 of 3

Re: Error reloading configuration

Posted: Wed Aug 24, 2016 12:33 pm
by lmiltchev
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 89)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 90.
Error processing object config files!
I suspect that you have 'xi_timeperiod_24x7' defined in two places - in the database (CCM), and in the "/usr/local/nagios/etc/static/xiobjects.cfg", which causes the error. Try removing (or commenting out) the 'xi_timeperiod_24x7' definition in the "static" directory. Let us know if this fixes the issue.

Re: Error reloading configuration

Posted: Thu Aug 25, 2016 4:57 am
by cyient
lmiltchev wrote:
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 89)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 90.
Error processing object config files!
I suspect that you have 'xi_timeperiod_24x7' defined in two places - in the database (CCM), and in the "/usr/local/nagios/etc/static/xiobjects.cfg", which causes the error. Try removing (or commenting out) the 'xi_timeperiod_24x7' definition in the "static" directory. Let us know if this fixes the issue.
Hi,

I have tried commenting the xi_timeperiod_24x7 in "/usr/local/nagios/etc/static/xiobjects.cfg" and tried applying configuration but it failed with below error.

Code: Select all



Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
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/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.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'...
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/servicegroups.cfg'...
Processing object config file '/usr/local/nagios/etc/hosttemplates.cfg'...
Warning: Duplicate definition found for host 'xi_host_firewall' (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 382)
Error: Could not add object property in file '/usr/local/nagios/etc/hosttemplates.cfg' on line 383.
   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: Error reloading configuration

Posted: Thu Aug 25, 2016 12:11 pm
by lmiltchev
What is on line 383 in '/usr/local/nagios/etc/hosttemplates.cfg'? Can you post it?
Didn't you say you disabled almost all of the timeperiods? Can you re-enable them to see if this is going to fix the issue?

Re: Error reloading configuration

Posted: Fri Aug 26, 2016 9:13 am
by cyient
lmiltchev wrote:What is on line 383 in '/usr/local/nagios/etc/hosttemplates.cfg'? Can you post it?
Didn't you say you disabled almost all of the timeperiods? Can you re-enable them to see if this is going to fix the issue?
hi,

One line 383 there is nothing but

Code: Select all


    383 #
    384 # Check command configuration file
    385 #
    386 # END OF FILE

Onething does contents of files in /usr/local/nagios/etc/static change ? Since i notice the xiobjects.cfg contents changing after applying configuration.
I have enabled all timeperiods and applied configuration got below error

Code: Select all


Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
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/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.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'...
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 89)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 90.
   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.

and content on line 90 is EOL

Does content of /usr/local/nagios/etc/static change ? since i notice xiobjects.cfg change after applying configuration

Re: Error reloading configuration

Posted: Fri Aug 26, 2016 1:37 pm
by lmiltchev
Nagios reverted to the "last known good snapshot" as applying configuration failed. This is probably why the contents of static changed. Normally it shouldn't. Try removing the "xi_timeperiod_24x7" timeperiod from the "/usr/local/nagios/etc/static/xiobjects.cfg" again.

Show us the file after the mods:

Code: Select all

cat /usr/local/nagios/etc/static/xiobjects.cfg
After this, go to the CCM->Tools->Write Config Files, click on "Write", and "Verify", and show the output after each click.

Note: If you don't see any errors after clicking on "Write", and "Verify", apply configuration.

Re: Error reloading configuration

Posted: Tue Aug 30, 2016 11:59 am
by cyient
Surely I will come up with that.

These two today's I couldn't revert back.

Re: Error reloading configuration

Posted: Tue Aug 30, 2016 3:21 pm
by lmiltchev
Sure. Show us the "xiobjects.cfg" and the output after running the "Write Config Files" tool whenever you are ready.

Re: Error reloading configuration

Posted: Wed Aug 31, 2016 8:45 am
by cyient
lmiltchev wrote:Sure. Show us the "xiobjects.cfg" and the output after running the "Write Config Files" tool whenever you are ready.

Code: Select all


cat /usr/local/nagios/etc/static/xiobjects.cfg
# 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_24x7
#       alias           24x7
#       sunday          00:00-24:00
#       monday          00:00-24:00
#       tuesday         00:00-24:00
#       wednesday       00:00-24:00
#       thursday        00:00-24:00
#       friday          00:00-24:00
#       saturday        00:00-24:00
#       }
#
define timeperiod{
        timeperiod_name xi_timeperiod_none
        alias                   None
        }
Below is the output after writing config files and checking

Code: Select all


Warning: Duplicate definition found for timeperiod 'xi_timeperiod_none' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 101) 
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 102. 
Error processing object config files! 


Nagios Core 3.4.1 
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors 
Copyright (c) 1999-2009 Ethan Galstad 
Last Modified: 05-11-2012 
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/xiobjects.cfg'... 
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'... 
Processing object config file '/usr/local/nagios/etc/static/xitest.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'... 
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_none' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 101) 
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 102. 
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. 

Below is the output of /usr/local/nagios/etc/timeperiod.cfg

Code: Select all


###############################################################################
#
# Timeperiod configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date:	      2016-08-31 14:39:27
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define timeperiod {
	timeperiod_name               		24x7
	alias                         		24 Hours A Day, 7 Days A Week
	saturday                      		00:00-24:00
	friday                        		00:00-24:00
	thursday                      		00:00-24:00
	wednesday                     		00:00-24:00
	tuesday                       		00:00-24:00
	monday                        		00:00-24:00
	sunday                        		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		24x7_sans_holidays
	alias                         		24x7 Sans Holidays
	use                           		us-holidays
	tuesday                       		00:00-24:00
	thursday                      		00:00-24:00
	sunday                        		00:00-24:00
	saturday                      		00:00-24:00
	monday                        		00:00-24:00
	friday                        		00:00-24:00
	wednesday                     		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		Matt_notification_times
	alias                         		Notification Times for Matt
	saturday                      		00:00-24:00
	friday                        		00:00-24:00
	thursday                      		00:00-24:00
	wednesday                     		00:00-24:00
	tuesday                       		00:00-24:00
	monday                        		00:00-24:00
	sunday                        		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		nagiosadmin_notification_times
	alias                         		Notification Times for nagiosadmin
	saturday                      		00:00-24:00
	thursday                      		00:00-24:00
	wednesday                     		00:00-24:00
	monday                        		00:00-24:00
	tuesday                       		00:00-24:00
	sunday                        		00:00-24:00
	friday                        		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		none
	alias                         		No Time Is A Good Time
	}	

define timeperiod {
	timeperiod_name               		us-holidays
	alias                         		U.S. Holidays
	name                          		us-holidays
	monday 1 september            		00:00-00:00
	july 4                        		00:00-00:00
	january 1                     		00:00-00:00
	december 25                   		00:00-00:00
	thursday -1 november          		00:00-00:00
	}	

define timeperiod {
	timeperiod_name               		workhours
	alias                         		Normal Work Hours
	wednesday                     		09:00-17:00
	tuesday                       		09:00-17:00
	thursday                      		09:00-17:00
	monday                        		09:00-17:00
	friday                        		09:00-17:00
	}	

define timeperiod {
	timeperiod_name               		xi_timeperiod_24x7
	alias                         		24x7
	sunday                        		00:00-24:00
	monday                        		00:00-24:00
	tuesday                       		00:00-24:00
	wednesday                     		00:00-24:00
	thursday                      		00:00-24:00
	friday                        		00:00-24:00
	saturday                      		00:00-24:00
	}	

 101 define timeperiod {
    102         timeperiod_name                         xi_timeperiod_none
    103         alias                                   None
    104         }
    105
    106 ###############################################################################
    107 #
    108 # Timeperiod configuration file
    109 #
    110 # END OF FILE
    111 #
    112 ###############################################################################


Re: Error reloading configuration

Posted: Wed Aug 31, 2016 12:37 pm
by lmiltchev
I believe we are getting close. The first error was about the 'xi_timeperiod_24x7' timeperiod:
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 89)
You commented it out in the static, so now you are getting a different error:
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_none' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 101)
Comment out the 'xi_timeperiod_none' timeperiod, too to see if this is going to fix your issue:

Code: Select all

#define timeperiod{
#        timeperiod_name xi_timeperiod_none
#        alias                   None
#        }

Re: Error reloading configuration

Posted: Thu Sep 01, 2016 9:01 am
by cyient
lmiltchev wrote:I believe we are getting close. The first error was about the 'xi_timeperiod_24x7' timeperiod:
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 89)
You commented it out in the static, so now you are getting a different error:
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_none' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 101)
Comment out the 'xi_timeperiod_none' timeperiod, too to see if this is going to fix your issue:

Code: Select all

#define timeperiod{
#        timeperiod_name xi_timeperiod_none
#        alias                   None
#        }
I have commented it out and i get a different error now after checking Configuration files as below

Code: Select all


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

#define timeperiod{
#       timeperiod_name xi_timeperiod_24x7
#       alias           24x7
#       sunday          00:00-24:00
#       monday          00:00-24:00
#       tuesday         00:00-24:00
#       wednesday       00:00-24:00
#       thursday        00:00-24:00
#       friday          00:00-24:00
#       saturday        00:00-24:00
#       }
#
#define timeperiod{
#       timeperiod_name xi_timeperiod_none
#       alias                   None
#       }

Code: Select all


Warning: Duplicate definition found for host 'xi_host_firewall' (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 384) 
Error: Could not add object property in file '/usr/local/nagios/etc/hosttemplates.cfg' on line 385. 
Error processing object config files! 


Nagios Core 3.4.1 
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors 
Copyright (c) 1999-2009 Ethan Galstad 
Last Modified: 05-11-2012 
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/xiobjects.cfg'... 
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'... 
Processing object config file '/usr/local/nagios/etc/static/xitest.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'... 
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'... 
Processing object config file '/usr/local/nagios/etc/servicegroups.cfg'... 
Processing object config file '/usr/local/nagios/etc/hosttemplates.cfg'... 
Warning: Duplicate definition found for host 'xi_host_firewall' (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 384) 
Error: Could not add object property in file '/usr/local/nagios/etc/hosttemplates.cfg' on line 385. 
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. 

Content on line 385 of file '/usr/local/nagios/etc/hosttemplates.cfg' is below

Code: Select all


 384 define host {
    385        name                                     xi_host_firewall
    386        alias                                    Firewall
    387        check_command                            check_xi_host_ping
    388        use                                      xi_host_generic
    389        _template_description                    Firewall
    390        register                                 0
    391
    392 }