Page 1 of 1

timeperiod exclude 2nd 4th nth day of week

Posted: Tue Sep 15, 2015 7:47 am
by vnc786
hi,
just need to verify whether this will work. Below is timeperiod which i am trying to use. Since i cannot practically test.

Code: Select all

define timeperiod {
	timeperiod_name               		Custom_time
	alias                         		Notification Times for test
	exclude                       		Custom_time_Exclude
	tuesday                       		00:00-24:00
	wednesday                     		00:00-24:00
	monday                        		00:00-24:00
	thursday                      		00:00-24:00
	friday                        		00:00-24:00
	saturday                      		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		Custom_time_Exclude
	alias                         		Notification Times for test
	saturday 2,4                   		00:00-24:00
	}
https://assets.nagios.com/downloads/nag ... timeperiod

Re: timeperiod exclude 2nd 4th nth day of week

Posted: Tue Sep 15, 2015 3:58 pm
by ssax
What version of XI are you using? You can grab it from the bottom left hand side of the web interface.

I think there is a bug in the latest versions that makes excludes not work and I want to verify on the version you are using.

Though the proper definition would be:

Code: Select all

define timeperiod {
   timeperiod_name                     Custom_time
   alias                               Notification Times for test
   exclude                             Custom_time_Exclude
   tuesday                             00:00-24:00
   wednesday                           00:00-24:00
   monday                              00:00-24:00
   thursday                            00:00-24:00
   friday                              00:00-24:00
   saturday                            00:00-24:00
   }   

define timeperiod {
   timeperiod_name                     Custom_time_Exclude
   alias                               Notification Times for test
   saturday 2                         00:00-24:00
   saturday 4                         00:00-24:00
   }

Re: timeperiod exclude 2nd 4th nth day of week

Posted: Wed Sep 16, 2015 12:25 am
by vnc786
hi,

nagiosXi Version
Nagios XI 2014R2.7
Nagios Core 4.0.8

i will try what you have mention on my UAT server. I will be changing system date to check the effect of timeperiod exclusion.

Re: timeperiod exclude 2nd 4th nth day of week

Posted: Wed Sep 16, 2015 10:05 am
by scottwilkerson
What ssax mentioned should work. One thing to keep in mind is that in order for an exclude to work, it has to have a GREATER Precedence than the time-period you are overriding

See: Precedence in Time Periods
https://assets.nagios.com/downloads/nag ... riods.html

Re: timeperiod exclude 2nd 4th nth day of week

Posted: Sun Sep 20, 2015 12:41 am
by vnc786
saturday 2 00:00-24:00
saturday 4 00:00-24:00
this worked
Please mark solved