Page 1 of 2

Time Period Management

Posted: Mon Oct 31, 2016 10:26 am
by brettmlawrence
I think I've created a Time Period that would not check during 4-5 each day. Can someone take a look at the screen shot and let me know if I am missing something?

Re: Time Period Management

Posted: Mon Oct 31, 2016 11:10 am
by bwallace
That looks correct, is it not working as expected?
If not, try tweaking it to read:
00:00-16:00, 17:00-23:59

You could schedule recurring downtime each day from 16:00-17:00 for the hosts/services in question as well.

Re: Time Period Management

Posted: Mon Oct 31, 2016 11:19 am
by brettmlawrence
Yeah I am still getting alerted during what I would expect to be outside of the the notification / check time. I will try 23:59 now.. I could go with the Recurring downtime but we have other Services we only want to check for 1 day. (Sunday AM for example)

Re: Time Period Management

Posted: Mon Oct 31, 2016 1:30 pm
by rkennedy
Let us know how the testing goes.

Re: Time Period Management

Posted: Tue Nov 01, 2016 6:35 am
by brettmlawrence
So I have 2 sets of services running the same queries, just on separate databases. For one I tried using the recurring downtime and the other I switched the end from 24:00 to 23:59 and I received warnings during both expected down times.

Re: Time Period Management

Posted: Tue Nov 01, 2016 8:59 am
by Envera IT
brettmlawrence wrote:So I have 2 sets of services running the same queries, just on separate databases. For one I tried using the recurring downtime and the other I switched the end from 24:00 to 23:59 and I received warnings during both expected down times.
Are you applying the time period to the check or notification settings on the service? If the custom time period is being applied via a template make sure the service doesn't list a time period as it will override the template's settings.

Re: Time Period Management

Posted: Tue Nov 01, 2016 10:12 am
by rkennedy
Thanks @Ehamby!

@brettmlawrence - could you post the different definitions for the related host/service + contact + time period so we can see how things line up?

Re: Time Period Management

Posted: Thu Nov 03, 2016 8:40 am
by brettmlawrence
Sorry, can you tell me how to find this information? I am kind of working on the fly with this. Not to much background with me or anyone here to help train me.

Re: Time Period Management

Posted: Thu Nov 03, 2016 9:10 am
by bwallace
No worries, we've all been there. Go to Configure > Core Config Manager > Monitoring > Hosts - once you find the host in question, click the floppy disk icon to the right in order to view the text config - save that and post it here. Do the same for the corresponding services for this host as as well: Core Config Manager > Monitoring > Services and while you're at, post text output for all your Time periods: Core Config Manager > Alerting > Time Periods
Thanks!

Re: Time Period Management

Posted: Thu Nov 03, 2016 1:03 pm
by brettmlawrence

Code: Select all

###############################################################################
#
# Host configuration file
#
# Created by: Nagios Core Config Manager 2.6.1
# Date:	      2016-11-03 14:01:13
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define host {
	host_name			UPHSCISTAGESQL
	use				xiwizard_mssqlquery_host
	address				170.166.22.135
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	contacts			blawrence
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	icon_image			mssqlquery.png
	statusmap_image			mssqlquery.png
	_xiwizard			mssqlquery
	register			1
	}	

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

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.1
# Date:	      2016-11-03 14:02:14
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
	host_name			UPHSCISTAGESQL
	service_description		MSSQL Query - HUP.HDMA
	use				xiwizard_mssqlquery_service
	check_command			check_xi_mssql_query!--username SVC_Nagios --password "$USER3$" --database HDMHUP_SHADOW --port 1433 --query "Select+Case+When+%28%09SELECT+COUNT%28%2A%29+%0D%0A%09%09%09%09%09FROM+HDMHUP_SHADOW.DBO.HDMA%29%0D%0A%09%09%09%09%09%3E+0+Then+%27Good%27+else+%27Bad%27%0D%0A%09%09%09%09%09end" --result "Good" --decode --result Good!!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			HUP
	notification_interval		60
	notification_period		HUP
	notification_options		c,u,
	contacts			blawrence,Brent Moore
	_xiwizard			mssqlquery
	register			1
	}	

define service {
	host_name			UPHSCISTAGESQL
	service_description		MSSQL Query - HUP.LuAdmitType
	use				xiwizard_mssqlquery_service
	check_command			check_xi_mssql_query!--username SVC_Nagios --password "$USER3$" --database HDMHUP_SHADOW --port 1433 --query "SELECT+CASE+WHEN+%28SELECT+COUNT%28%2A%29+FROM+HDMHUP_SHADOW.sys.all_objects+WHERE+name+%3D+%27LU_ADMIT_TYPE%27%29+%3D+1+THEN+%27GOOD%27+ELSE+%27BAD%27+END%0D%0A" --result "GOOD" --decode --result GOOD!!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			HUP
	notification_interval		60
	notification_period		HUP
	notification_options		c,u,
	contacts			blawrence,Brent Moore
	_xiwizard			mssqlquery
	register			1
	}	

define service {
	host_name			UPHSCISTAGESQL
	service_description		MSSQL Query - HUP.TransferDate
	use				xiwizard_mssqlquery_service
	check_command			check_xi_mssql_query!--username SVC_Nagios --password "$USER3$" --database HDMHUP_SHADOW --port 1433 --query "Select+Case+When+%28SELECT+MAX%28TRANSFERDATE%29+FROM+HDMHUP_SHADOW.DBO.HDMA%29%0D%0A%09%09%09%09%09%3E%3D+DATEADD%28HOUR%2C-24%2CGETDATE%28%29%29+Then+%27Good%27+else+%27Bad%27%0D%0A%09%09%09%09%09end" --result "Good" --decode --result Good!!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			HUP
	notification_interval		60
	notification_period		HUP
	notification_options		c,u,
	contacts			blawrence,Brent Moore
	_xiwizard			mssqlquery
	register			1
	}	

define service {
	host_name			UPHSCISTAGESQL
	service_description		MSSQL Query - PMC.HDMA
	use				xiwizard_mssqlquery_service
	check_command			check_xi_mssql_query!--username SVC_Nagios --password "$USER3$" --database HDMPMC_SHADOW --port 1433 --query "Select+Case+When+%28%09SELECT+COUNT%28%2A%29+%0D%0A%09%09%09%09%09FROM+HDMPMC_SHADOW.DBO.HDMA%29%0D%0A%09%09%09%09%09%3E+0+Then+%27Good%27+else+%27Bad%27%0D%0A%09%09%09%09%09end%0D%0A" --result "Good" --decode --result Good!!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			PMC
	notification_interval		60
	notification_period		PMC
	notification_options		c,u,
	notifications_enabled		1
	contacts			blawrence,Brent Moore
	_xiwizard			mssqlquery
	register			1
	}	

define service {
	host_name			UPHSCISTAGESQL
	service_description		MSSQL Query - PMC.LuAdmitType
	use				xiwizard_mssqlquery_service
	check_command			check_xi_mssql_query!--username SVC_Nagios --password "$USER3$" --database HDMPMC_SHADOW --port 1433 --query "SELECT+CASE+WHEN+%28SELECT+COUNT%28%2A%29+FROM+HDMPMC_SHADOW.sys.all_objects+WHERE+name+%3D+%27LU_ADMIT_TYPE%27%29+%3D+1+THEN+%27GOOD%27+ELSE+%27BAD%27+END" --result "GOOD" --decode --result GOOD!!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			PMC
	notification_interval		60
	notification_period		PMC
	notification_options		c,u,
	contacts			blawrence,Brent Moore
	_xiwizard			mssqlquery
	register			1
	}	

define service {
	host_name			UPHSCISTAGESQL
	service_description		MSSQL Query - PMC.TransferDate
	use				xiwizard_mssqlquery_service
	check_command			check_xi_mssql_query!--username SVC_Nagios --password "$USER3$" --database HDMPMC_SHADOW --port 1433 --query "Select+Case+When+%28SELECT+MAX%28TRANSFERDATE%29+FROM+HDMPMC_SHADOW.DBO.HDMA%29%0D%0A%09%09%09%09%09%3E%3D+DATEADD%28HOUR%2C-24%2CGETDATE%28%29%29+Then+%27Good%27+else+%27Bad%27%0D%0A%09%09%09%09%09end" --result "Good" --decode --result Good!!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			PMC
	notification_interval		60
	notification_period		PMC
	notification_options		c,u,
	notifications_enabled		1
	contacts			blawrence,Brent Moore
	_xiwizard			mssqlquery
	register			1
	}	

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################

Code: Select all

###############################################################################
#
# Timeperiod configuration file
#
# Created by: Nagios Core Config Manager 2.6.1
# Date:	      2016-11-03 14:03:19
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define timeperiod {
	timeperiod_name               		24x7
	alias                         		24 Hours A Day, 7 Days A Week
	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               		24x7_sans_holidays
	alias                         		24x7 Sans Holidays
	use                           		us-holidays
	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               		blawrence_notification_times
	alias                         		Notification Times for blawrence
	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
	sunday                        		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		Clarity_snapshot
	alias                         		Snapshot monitoring window
	sunday                        		07:05-07:35
	monday                        		07:05-07:35
	tuesday                       		07:05-07:35
	wednesday                     		07:05-07:35
	thursday                      		07:05-07:35
	friday                        		07:05-07:35
	saturday                      		07:05-07:35
	}	

define timeperiod {
	timeperiod_name               		Clarity_Tables
	alias                         		Clarity_Tables
	saturday                      		05:00-07:00
	friday                        		05:00-07:00
	thursday                      		05:00-07:00
	wednesday                     		05:00-07:00
	tuesday                       		05:00-07:00
	monday                        		05:00-07:00
	}	

define timeperiod {
	timeperiod_name               		Clarity_Tables_SAT_ONLY
	alias                         		Clarity_Tables
	saturday                      		05:00-07:00
	}	

define timeperiod {
	timeperiod_name               		HUP
	alias                         		HUP StageSQL downtime
	saturday                      		00:00-21:00,22:00-23:59
	friday                        		00:00-21:00,22:00-23:59
	thursday                      		00:00-21:00,22:00-23:59
	wednesday                     		00:00-21:00,22:00-23:59
	tuesday                       		00:00-21:00,22:00-23:59
	monday                        		00:00-21:00,22:00-23:59
	sunday                        		00:00-21:00,22:00-23:59
	}	

define timeperiod {
	timeperiod_name               		nagiosadmin_notification_times
	alias                         		Notification Times for nagiosadmin
	tuesday                       		00:00-24:00
	monday                        		00:00-24:00
	wednesday                     		00:00-24:00
	thursday                      		00:00-24:00
	saturday                      		00:00-24:00
	sunday                        		00:00-24:00
	friday                        		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		none
	alias                         		No Time Is A Good Time
	}	

define timeperiod {
	timeperiod_name               		PMC
	alias                         		PMC StageSQL downtime
	sunday                        		00:00-16:00,17:00-24:00
	monday                        		00:00-16:00,17:00-24:00
	tuesday                       		00:00-16:00,17:00-24:00
	wednesday                     		00:00-16:00,17:00-24:00
	thursday                      		00:00-16:00,17:00-24:00
	friday                        		00:00-16:00,17:00-24:00
	saturday                      		00:00-16:00,17:00-24:00
	}	

define timeperiod {
	timeperiod_name               		tcole_notification_times
	alias                         		Notification Times for tcole
	saturday                      		02:35-04:30
	friday                        		02:35-04:30
	thursday                      		02:35-04:30
	wednesday                     		02:35-04:30
	tuesday                       		02:35-04:30
	monday                        		02:35-04:30
	}	

define timeperiod {
	timeperiod_name               		us-holidays
	alias                         		U.S. Holidays
	name                          		us-holidays
	january 1                     		00:00-00:00
	monday 1 september            		00:00-00:00
	july 4                        		00:00-00:00
	thursday -1 november          		00:00-00:00
	december 25                   		00:00-00:00
	}	

define timeperiod {
	timeperiod_name               		workhours
	alias                         		Normal Work Hours
	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
	}	

define timeperiod {
	timeperiod_name               		xi_timeperiod_24x7
	alias                         		24x7
	name                          		xi_timeperiod_24x7
	saturday                      		00:00-24:00
	friday                        		00:00-24:00
	thursday                      		00:00-24:00
	wednesday                     		00:00-24:00
	tuesday                       		00:00-24:00
	monday                        		00:00-24:00
	sunday                        		00:00-24:00
	}	

###############################################################################
#
# Timeperiod configuration file
#
# END OF FILE
#
###############################################################################