Page 1 of 1

time periods and exclusions.

Posted: Wed May 30, 2012 11:49 am
by benhank
what in the world am I doing wrong here?.
I want the device to poll 24x 7 except 1100am to 1200pm,(11:00-12:00 ) 11pm to 1259 pm( 23:00-23:59) 1200am to 1 am (00:00-01:00).
I set this up using the core config wizard, with the timeperiod tool.



===================================
device config:
###############################################################################
#
# Host configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2012-05-30 12:47:31
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define host {
host_name 380 SPB
use xiwizard_genericnetdevice_host
alias 380 SPB
address x.x.x.x
hostgroups Storage Devices
initial_state u
max_check_attempts 5
check_interval 5
retry_interval 1
active_checks_enabled 1
check_period 380 SPB
check_freshness 1
contacts nagiosadmin
contact_groups xxxxxxx
notification_interval 60
notification_period 24x7
icon_image emc1.png
statusmap_image emc1.png
register 1
}

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################

===================================

Code: Select all

define timeperiod {
	timeperiod_name            exception 1
	alias                         		1100 1200
	name                                 exclusion 1100 1200
	tuesday                       		11:00-12:00
	thursday                      		11:00-12:00
	sunday                        		11:00-12:00
	saturday                      		11:00-12:00
	monday                        		11:00-12:00
	friday                        		11:00-12:00
	wednesday                     		11:40-12:00
	}	

define timeperiod {
	timeperiod_name              exclusion 2
	alias                         		2300 2359
	name                          	 exclusion 23:00-23:59
	tuesday                       		23:00-23:59
	thursday                      		23:00-23:59
	sunday                        		23:00-23:59
	saturday                      		23:00-23:59
	monday                        		23:00-23:59
	friday                        		23:00-23:59
	wednesday                     		13:00-13:59
	}	

define timeperiod {
	timeperiod_name               		exclusion 3
	alias                         		0000 0100
	name                          	  exclusion 0000 0100
	tuesday                       		00:00-01:00
	thursday                      		00:00-01:00
	sunday                        		00:00-01:00
	saturday                      		00:00-01:00
	monday                        	00:00-01:00
	friday                        		00:00-01:00
	wednesday                     		00:00-01:00
	}	

define timeperiod {
	timeperiod_name           380 SPB
	alias                         		do not poll during backups
	exclude                       		exception 1, SPA B exclusion 2,exclusion 3
	tuesday                       		00:00-24:00
	thursday                      		00:00-24:00
	sunday                        		00:00-24:00
	saturday                      		00:00-24:00
	monday                                 00:00-24:00
	friday                        		  00:00-24:00
	wednesday                     	 00:00-24:00
	}	

Re: time periods and exclusions.

Posted: Wed May 30, 2012 1:25 pm
by lmiltchev
I believe you should have something like this:

Code: Select all

define timeperiod {
	timeperiod_name               		exclude-evening
	alias                         		Exclude evening hours
	name                          		exclude-evening
	wednesday                     		23:00-23:59
	tuesday                       		23:00-23:59
	thursday                      		23:00-23:59
	sunday                        		23:00-23:59
	saturday                      		23:00-23:59
	monday                        		23:00-23:59
	friday                        		23:00-23:59
	}	

define timeperiod {
	timeperiod_name               		exclude-morning
	alias                         		Exclude morning hours
	name                          		exclude-morning
	tuesday                       		11:00-12:00
	wednesday                     		11:00-12:00
	thursday                      		11:00-12:00
	sunday                        		11:00-12:00
	saturday                      		11:00-12:00
	monday                        		11:00-12:00
	friday                        		11:00-12:00
	}	

define timeperiod {
	timeperiod_name               		test
	alias                         		test
	exclude                       		exclude-evening,exclude-morning
	tuesday                       		00:00-24:00
	thursday                      		00:00-24:00
	sunday                        		00:00-24:00
	saturday                      		00:00-24:00
	monday                        		00:00-24:00
	friday                        		00:00-24:00
	wednesday                     		00:00-24:00
	}	
This is done through the Core Config Manager. I created the "exclude-morning" and "exclude-evening" as "templates" under the "Time Period Management". Then I excluded these two timeperiods from the "test" time period.

Note: If you don't create these as "template", they don't show up in the "Exclude" window.

Hope this helps.

Re: time periods and exclusions.

Posted: Wed May 30, 2012 2:19 pm
by benhank
I should clarify.
I did set up the three exceptions as templates. I added the three exceptions to the excluded list on the time period that runs 24x7.

however, nagios ignored the exceptions. did a check at 1138, then displayed that its next check was at 00:00. I'll try it like you said tho.
Can you tell me what is wrong with my setup? I don't want to make this mistake again with other setups.

Re: time periods and exclusions.

Posted: Thu May 31, 2012 7:45 am
by scottwilkerson
1130 was a valid time to run yesterday...
define timeperiod {
timeperiod_name exception 1
alias 1100 1200
name exclusion 1100 1200
tuesday 11:00-12:00
thursday 11:00-12:00
sunday 11:00-12:00
saturday 11:00-12:00
monday 11:00-12:00
friday 11:00-12:00
wednesday 11:40-12:00
}