Error applying time period configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
luniversity
Posts: 56
Joined: Mon Dec 10, 2012 9:39 am

Error applying time period configuration

Post by luniversity »

I've taken over management of our Nagios environment and noticed that the default time period xi_timeperiod_24x7 was not set to active in the CCM time periods. So I modified and checked the "Active" box but when I try to apply the configuration I recieve the following error:

Code: Select all

Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 641)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 642.
   Error processing object config files!
When I look at the /usr/local/nagios/etc/timeperiods.cfg file I don't see any definition for this time period. The line #641 referenced in the error is a comment line making the end of the file.

Code: Select all

    641 ###############################################################################
    642 #
    643 # Timeperiod configuration file
    644 #
    645 # END OF FILE
    646 #
    647 ###############################################################################
Is it possible that this configuration exists in another config file some place? Any help is appreciated.
Mike Westmoreland
Lamar University
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Error applying time period configuration

Post by BanditBBS »

Go ahead and make your changes again and instead of hitting "Apply configuration" go to advanced and write config. Then select the write button and then verify. Then go look at the file in question again.

More than likely that time period is in another static file somewhere and you activating it in the CCM is making a dupe definition. Then it rolls back to previous good config so when yuo look inthe file you don't see the definition you activated.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
luniversity
Posts: 56
Joined: Mon Dec 10, 2012 9:39 am

Re: Error applying time period configuration

Post by luniversity »

Hey Bandit, I'm not sure I follow. When I look at the options under the "Advanced" link in the left hand menu I do not see "Write Config" as an option. The only options I have listed under advanced are:

Host Dependencies
Service Dependencies
Nagios Core Main Config
Nagios Core CGI Config

Am I missing something. Note that I'm on an older version of Nagios (XI 2012r1.2).
Mike Westmoreland
Lamar University
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Error applying time period configuration

Post by BanditBBS »

Sorry, it is right below that under Tools
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
luniversity
Posts: 56
Joined: Mon Dec 10, 2012 9:39 am

Re: Error applying time period configuration

Post by luniversity »

Got it. Unfortunately it didn't work. The definition still does not show up in the timeperiod.cfg, I still see the message in red text that reads "Apply Configuration for new changes to take effect".
Mike Westmoreland
Lamar University
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Error applying time period configuration

Post by Box293 »

Execute this command at the CLI:

Code: Select all

grep -r timeperiod_name /usr/local/nagios/etc/
This will identify where it is defined.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Error applying time period configuration

Post by BanditBBS »

So you:
made the time period active again. Do not "Apply Config"
Went to tools - Write Config Files
Pressed the Write button(and waitied for it to finish)
Pressed the Verify button. When you did this, did it come back blue or red? If red, copy-n-paste the error here

and definitely do what Box293 said...that will get you to find where it is defined static.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
luniversity
Posts: 56
Joined: Mon Dec 10, 2012 9:39 am

Re: Error applying time period configuration

Post by luniversity »

See that's what happens when I don't follow directions. I didn't hit the "Write" button first. Still didn't work though.

This time I did exactly as you instructed. When I click on verify I get this error message:
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 643.

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 642)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 643.
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.
I ran grep against timeperiod_name and found that I do indeed have a another entry with the same name under the ../static/ directory:
[root@nagios01r6v static]# grep -r timeperiod_name /usr/local/nagios/etc/ | grep xi_timeperiod_24x7
/usr/local/nagios/etc/static/xiobjects.cfg: timeperiod_name xi_timeperiod_24x7
/usr/local/nagios/etc/timeperiods.cfg: timeperiod_name xi_timeperiod_24x7
Mike Westmoreland
Lamar University
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Error applying time period configuration

Post by BanditBBS »

Hmm, not sure why that is in that static file, you aren't supposed to modify those. My XI objects file only has xi_default_contact in it. Maybe someone else can speak up as to why it would be in that file before we say to go ahead and remove it.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
luniversity
Posts: 56
Joined: Mon Dec 10, 2012 9:39 am

Re: Error applying time period configuration

Post by luniversity »

Yeah I took this over from another guys who is gone now. I tried to delete the one in /usr/local/nagios/etc through the CCM but it's got about 800 dependent relationships on it. I'm gonna quit on it for the day. I'll check back in tomorrow. Thanks fella's.
Mike Westmoreland
Lamar University
Locked