Timeperiod problem

Rainer Krienke krienke at uni-koblenz.de
Wed Jul 6 11:04:25 CEST 2005


Hello,

I am running nagios 1.2 on a SUSE 9.2 system. Basically this works fine. 
However I have a problem with timeperiods I do not understand.  

What I want is to have nagios check a servive (load on a linux system) only in 
the time or 00:00 -> 22:00 because I know that at about 23:00 (11:00pm) there 
will be a load peak on the system checked that would lead to a nagios warning 
or error fpr this service. 

So i thought to define a timeperiod that excludes this period of time and then 
in the services.cfg to used this limited timeperiod definition for the 
check_period statement. According to the documentation this should keep 
nagios from checking this service if the current time is not valid. The 
configuration is given below.

Allthough I thought this should work, it doesn't. The service is still checkek 
in the time of 22:00->00:00 and I get an nagios error for this service at 
23:10. But why? 

Next I tried to write a undefined timeperiod in the servicedefinition below. 
Simply a name like xyz instead of 2allbut22__00". Nagios restarted without 
any problems which I consider even more strabge. Next I move the 
timeperiod.cfg file away from /etc/nagios and restarted nagios again. This 
time it complained that it is unable to open the timeperiods.cfg file. 

Does anyone have an idea whats going wrong?

Thanks a lot 
Rainer

------------
The config:
------------
-- timeperiod.cfg:
define timeperiod {
timeperiod_name                allbut22__00
alias                          All time but 22:00-24:00
sunday                         00:00-22:00
monday                         00:00-22:00
tuesday                        00:00-22:00
wednesday                      00:00-22:00
thursday                       00:00-22:00
friday                         00:00-22:00
saturday                       00:00-22:00
}

--service.cfg:
define service {
   host_name                      myhostname
   service_description            Load of myhostname
   name                           myhostname
   max_check_attempts             3
   normal_check_interval          5
   retry_check_interval           2
   check_period                   allbut22__00
   notification_interval          240
   notification_period            24x7
   notification_options           c,r
   contact_groups                 linux-admins
   check_command                  "/usr/bin/nagios-stat -w 5 -c 10 load 
myhostname.uni-koblenz.de"
}


-- 
---------------------------------------------------------------------------
Rainer Krienke, Universitaet Koblenz, Rechenzentrum, Raum A022
Universitaetsstrasse 1, 56070 Koblenz, Tel: +49 261287 -1312, Fax: -1001312
Mail: krienke at uni-koblenz.de, Web: http://www.uni-koblenz.de/~krienke
Get my public PGP key: http://www.uni-koblenz.de/~krienke/mypgp.html
---------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050706/35f61fc0/attachment.sig>


More information about the Users mailing list