Timeperiod already been defined

Subhendu Ghosh sghosh at sghosh.org
Wed Apr 16 18:54:01 CEST 2003


nagios reads timeperiods.cfg twice because it is defined twice...

once with a cfg_file and once with a cfg_dir

-remove the cfg_file entery and you should be fine.

-sg

On Wed, 16 Apr 2003, Gotner, James wrote:

> Error message as stated in original post
> 
> Error: Timeperiod 'worktime' has already been defined. 
> Error: Could not register timeperiod (config file
> '/usr/local/nagios/etc/templates/timeperiods.cfg', line 30)
> 
> RELEVANT LINES TAKEN FROM NAGIOS.CFG
> -----------------
> cfg_file=/usr/local/nagios/etc/templates/timeperiods.cfg
> 
> cfg_dir=/usr/local/nagios/etc/templates/
> 
> -----------------------
> 
> These are the only things that relate to **any** timeperiod definitions.  If
> I rename the timeperiod 'worktime', the error changes accordingly.  If I
> delete that definition, then I recieve the exact same error for my other
> timeperiod, '24x7'.  I did a grep on all of my template-based config files
> for worktime, and it only comes up once in timeperiods.cfg.  I can change it
> to 'foobar' and it will still say its already defined.  
> 
> James Gotner
> 
> Security Certified Network Professional
> A+ Hardware/Software, Linux+, Network+, i-Net+ Certified Professional
> Certified Internet Webmaster Associate
> 
> On Tue, 2003-04-15 at 16:46, Gotner, James wrote:
> > List members,
> > 
> >   I am having no luck getting this going.  I have tried removing the
> second
> > entry, only to have nagios -v complain about the first entry already being
> > defined.  I did a grep on all of my config files and the timeperiods only
> > show up in timeperiods.cfg once each.  I have tried changing the
> timeperiod
> > names and I have tried retyping the config file from scratch and still get
> > the same problem...  Could someone look at my config file and tell me if
> > there is anything wrong?  I built my config file according to the
> > documentation, so I wouldnt think that there is a problem.  Is there a
> > problem compiling nagios with gcc that comes with redhat 7.3?  I know
> there
> > have been intermittent problems with gcc 2.96, since it is actually
> redhat's
> > version and not supported by the gcc community, and also has caused
> problems
> > with compiling other programs... Has anyone gotten nagios to work on RH
> 7.3
> > at all?  Has anyone had a problem compiling nagios with gcc v3.2.x, as
> that
> > will probably be my next step?  Can nagios work under cygwin, so I can
> test
> > my config files at least?  Thanks for any help...
> > 
> > James Gotner
> > 
> > Security Certified Network Professional
> > A+ Hardware/Software, Linux+, Network+, i-Net+ Certified Professional
> > Certified Internet Webmaster Associate
> > 
> > 
> > 
> > -----Original Message-----
> > From: Gotner, James 
> > Sent: Thursday, April 10, 2003 2:16 PM
> > To: 'nagios-users at lists.sourceforge.net'
> > Subject: [Nagios-users] Timeperiod already been defined
> > 
> > 
> > OK, solve one problem, get into another... While running nagios -v, I now
> > receive an error stating that **timeperiod 'worktime' has already been
> > defined**. And - **Error: Could not register timeperiod** 'worktime'.
> > Well, I have all timeperiods defined in one file, timeperiods.cfg, and
> > worktime and one other, 24x7, are the only ones defined.  Apparently,
> nagios
> > accepts the 24x7 definition, as I get an error on the second one.  I
> > searched through the archives, and noticed someone with a similar problem.
> > They recompiled the program and their problem was solved... Well, that
> didnt
> > work for me... Any suggestions on what else to check?  Thanks.
> > 
> > Nagios v1.0
> > RedHat Linux 7.3
> > 
> > timeperiods.cfg
> > -----------------
> > 
> > # Time Period Definition
> > # Description: A time period is a list of times during various days that
> are
> > # considered to be "valid" times for notificatins and service checks.  It
> > # consists of one or more time periods for each day of the week that
> > "rotate"
> > # once the week has come to an end.  Exceptions to the weekly time range
> are
> > # not supported.
> > 
> > #define timeperiod{
> > #	timeperiod_name		timeperiod_name		; Short name used to
> > ID the timeperiod
> > #	alias				alias				;
> > Description for timeperiod
> > #	sunday			00:00-24:00			; Time
> > periods to be used, seperate with commas for multiple timeperiods
> > #	monday			00:00-24:00			; If you do
> > not want any notification on a certian day, then do not
> > #	tuesday			00:00-24:00			; include
> > the day in the definition or comment out.
> > #	wednesday			00:00-24:00
> > #	thursday			00:00-24:00
> > #	friday			00:00-24:00
> > #	saturday			00:00-24:00
> > #}
> > 
> > define timeperiod{
> > 	timeperiod_name		24x7
> > 	alias				All the time
> > 	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		worktime
> > 	alias				The Nine to Fiver
> > #	sunday						; Not used
> > 	monday			09:00-17:00
> > 	tuesday			09:00-17:00
> > 	wednesday			09:00-17:00
> > 	thursday			09:00-17:00
> > 	friday			09:00-17:00
> > #	saturday						; Not used
> > }
> > 
> > ---End timeperiods.cfg--------
> > 
> > 
> > James Gotner
> > 
> > Security Certified Network Professional
> > A+ Hardware/Software, Linux+, Network+, i-Net+ Certified Professional
> > Certified Internet Webmaster Associate
> > 
> > 
> > 
> > 
> > 
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Nagios-users mailing list
> > Nagios-users at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/nagios-users
> > ::: Please include Nagios version, plugin version (-v) and OS when
> reporting any issue. 
> > ::: Messages without supporting info will risk being sent to /dev/null
> 

-- 




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list