timeperiod exclude 2nd 4th nth day of week

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vnc786
Posts: 68
Joined: Thu Aug 29, 2013 8:45 am

timeperiod exclude 2nd 4th nth day of week

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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
   }
vnc786
Posts: 68
Joined: Thu Aug 29, 2013 8:45 am

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

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
vnc786
Posts: 68
Joined: Thu Aug 29, 2013 8:45 am

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

Post by vnc786 »

saturday 2 00:00-24:00
saturday 4 00:00-24:00
this worked
Please mark solved
Locked