Page 1 of 2

Service Re-Configuration Failed

Posted: Mon Jul 22, 2013 7:41 am
by amakorju
A failure occurred while attempting to re-configure the service with the new settings

Code: Select all

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/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.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'...
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 125)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 126.
   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.

When Write to Config File: Result

Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!

When I Click Verify Configuration: Result

Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 126.

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/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.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'...
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 125)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 126.
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: Service Re-Configuration Failed

Posted: Mon Jul 22, 2013 10:43 am
by abrist
You may have to use the CCM (Core Config Manager) to hunt down the config issue. Go to --> Configure --> Core Config Manager --> Tools --> Write Config Files. Click write and then verify. Post the output here in code wraps.

Re: Service Re-Configuration Failed

Posted: Tue Jul 23, 2013 11:08 am
by amakorju
write config file

Code: Select all

Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!

verify config file

Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 132.

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/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.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'...
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 131)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 132.
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.

Restart Nagios

RESTART FAILED. CONFIG ERROR:
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 132.

Re: Service Re-Configuration Failed

Posted: Tue Jul 23, 2013 12:37 pm
by lmiltchev
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 125)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 126.
It seems like the "xi_timeperiod_24x7" is defined twice - once in the database, and once - in the static. I would recommend commenting out (or deleting) the "xi_timeperiod_24x7" definition in "/usr/local/nagios/etc/static/xiobjects.cfg". Save and exit, then run the Write Config Tool again to check for config errors. If there are no errors, Apply Configuration.

Hope this helps.

Re: Service Re-Configuration Failed

Posted: Tue Jul 23, 2013 1:25 pm
by amakorju
This was the errors (in brief) i got.

Code: Select all

Write Config file

Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!

Code: Select all

Verify Config File

Error: Contact 'xi_default_contact' specified in service 'Ping' for host 'AbiaHouse_Link' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'AbiaHouse_Link' is not defined anywhere!
Error: Notification period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'AbiaHouse_Link' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'Abia_House' is not defined anywhere!
Error: Notification period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'Abia_House' is not defined anywhere!
Error: Contact 'xi_default_contact' specified in service 'Ping' for host 'ICT_Operation_Printer' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'ICT_Operation_Printer' is not defined anywhere!
Error: Notification period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'ICT_Operation_Printer' is not defined anywhere!
Error: Contact 'xi_default_contact' specified in service 'Printer Status' for host 'ICT_Operation_Printer' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Printer Status' on host 'ICT_Operation_Printer' is not defined anywhere!
Error: Notification period 'xi_timeperiod_24x7' specified for service 'Printer Status' on host 'ICT_Operation_Printer' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'Kaduna_Link' is not defined anywhere!
Error: Notification period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'Kaduna_Link' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'Lagos_Link' is not defined anywhere!
Error: Notification period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'Lagos_Link' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'HTTP' on host 'SigmaFire' is not defined anywhere! 

Restart Nagios

RESTART FAILED. CONFIG ERROR:
Error: Contact 'xi_default_contact' specified in service 'Ping' for host 'AbiaHouse_Link' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'AbiaHouse_Link' is not defined anywhere!
Error: Notification period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'AbiaHouse_Link' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'Abia_House' is not defined anywhere!
Error: Notification period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'Abia_House' is not defined anywhere!
Error: Contact 'xi_default_contact' specified in service 'Ping' for host 'ICT_Operation_Printer' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'ICT_Operation_Printer' is not defined anywhere!
Error: Notification period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'ICT_Operation_Printer' is not defined anywhere!
Error: Contact 'xi_default_contact' specified in service 'Printer Status' for host 'ICT_Operation_Printer' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Printer Status' on host 'ICT_Operation_Printer' is not defined anywhere!
Error: Notification period 'xi_timeperiod_24x7' specified for service 'Printer Status' on host 'ICT_Operation_Printer' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'Kaduna_Link' is not defined anywhere!
Error: Notification period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'Kaduna_Link' is not defined anywhere!
Error: Check period 'xi_timeperiod_24x7' specified for service 'Ping' on host 'Lagos_Link' is not defined anywhere!

Re: Service Re-Configuration Failed

Posted: Tue Jul 23, 2013 4:16 pm
by sreinhardt
OK, now you are missing the xi_timeperiod_24x7 entirely and the xi_default_contact. What exactly did you change?

Re: Service Re-Configuration Failed

Posted: Thu Jul 25, 2013 6:38 am
by amakorju
I deleted the "xi_timeperiod_24x7" definition in "/usr/local/nagios/etc/static/xiobjects.cfg"

Re: Service Re-Configuration Failed

Posted: Thu Jul 25, 2013 6:50 am
by danieloo
This happens when you try to edit two things related to each other without applying configuration first...
when this happens within services/hosts i delete those files from disk and re-apply configuration from within nagiosxi, this recreates all config files.
I do not know if this happens for xiobjects.cfg as well, looking at the timestamp it doesn't

Re: Service Re-Configuration Failed

Posted: Thu Jul 25, 2013 6:52 am
by danieloo
It clearly says do not modify! please reinstate this file to it's original default maybe using the code below

Code: Select all

# 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
        }
backup your file: /usr/local/nagios/etc/timeperiods.cfg like
cp /usr/local/nagios/etc/timeperiods.cfg ~/tmp/.
then remove this file
rm /usr/local/nagios/etc/timeperiods.cfg

re-apply config

Re: Service Re-Configuration Failed

Posted: Thu Jul 25, 2013 7:04 am
by amakorju
After i try to apply configuration (which won't work), it generates a duplicate nagios.cfg (.swp), timeperiods.cfg (swp) and commands.cfg (swp) in the /usr/local/nagios/etc folder.