Lock Notification Times Errors

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
isadmin
Posts: 151
Joined: Thu Nov 08, 2012 10:49 am

Lock Notification Times Errors

Post by isadmin »

I opened a topic for Locking Notification Times and it seemed Simple http://support.nagios.com/forum/viewtop ... ock#p37970
but I am receiving errors when attempting to apply it...

Username does not have a valid timeperiod for deployment. The timeperiod will have to be configured from the Core Config Manager.
Username does not have the XI notification handlers defined. Update the 'Notification Commands' for this contact in the Core Config Manager for new settings to be used.

I change these settings in the core config manage under contacts>> Alert Settings ...but it errors...
>>Error: Name or alias for timeperiod is NULL
Error: Could not register timeperiod (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 27)
Error processing object config files!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Lock Notification Times Errors

Post by scottwilkerson »

Can you go to Configure -> CCM -> Time Periods and click the disk icon next to one of the (they all load the same file), then attach that file here.

Thanks
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
isadmin
Posts: 151
Joined: Thu Nov 08, 2012 10:49 am

Re: Lock Notification Times Errors

Post by isadmin »

Whats appears to have happen is I ran the NotificationMangement Wizard an it corrupted the user settings/failed to update them.
We want users locked to 24x7 notifications but only for Down, Unknown, Critical.
When I run the wizard and it throws time period errors and sets all the users selected to the opposite setting....r,f,s,n,w, under host and service notification options..
I have to go back and manually clean up everything....
I finally got the Config to apply but here is the Time Periods File...I also had to create a new 24x7 time period...and use it for applying... but it looks oddly strange in the PHP file

the xi_24x7 was causing failure.
If I mark it active I receive this error

Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 277)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 278.
Error processing object config files!
IF I deactivate it the config applies successfully.


Heres is Timeperiods PHP file

Code: Select all

###############################################################################
#
# Timeperiod configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date:	      2012-11-13 21:54:51
# 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 timeperiod {
	timeperiod_name               		24x7
	alias                         		24x7
	name                          		24x7
	}	

define timeperiod {
	timeperiod_name               		24x7_sans_holidays
	alias                         		24x7 Sans Holidays
	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
	use                           		us-holidays
	saturday                      		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		user3_notification_times
	alias                         		Notification Times for user3
	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
	monday                        		00:00-24:00
	sunday                        		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		user2_notification_times
	alias                         		user2_notification_times
	}	

define timeperiod {
	timeperiod_name               		user1_notification_times
	alias                         		Notification Times for user1
	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
	monday                        		00:00-24:00
	sunday                        		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		lnxdbBackup
	alias                         		lnxdb Backup Hours
	sunday                        		07:00-20:00
	monday                        		07:00-20:00
	tuesday                       		07:00-20:00
	wednesday                     		07:00-20:00
	thursday                      		07:00-20:00
	friday                        		07:00-20:00
	saturday                      		07:00-20:00
	}	

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               		nagiostestadmin_notification_times
	alias                         		Notification Times for nagiostestadmin
	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               		nagiostestuser_notification_times
	alias                         		Notification Times for nagiostestuser
	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               		none
	alias                         		No Time Is A Good Time
	}	

define timeperiod {
	timeperiod_name               		non_support_hours
	alias                         		Non-Support Hours
	sunday                        		00:00-06:00,16:00-24:00
	monday                        		00:00-06:00,20:00-24:00
	tuesday                       		00:00-06:00,20:00-24:00
	wednesday                     		00:00-06:00,20:00-24:00
	thursday                      		00:00-06:00,20:00-24:00
	friday                        		00:00-06:00,20:00-24:00
	saturday                      		00:00-06:00,16:00-24:00
	}	

define timeperiod {
	timeperiod_name               		router_support
	alias                         		r_support
	sunday                        		06:15-20:00
	monday                        		06:15-20:00
	tuesday                       		06:15-20:00
	wednesday                     		06:15-20:00
	thursday                      		06:15-20:00
	friday                        		06:15-20:00
	saturday                      		06:15-20:00
	}	

define timeperiod {
	timeperiod_name               		sai_support_hours
	alias                         		App Support Hours
	sunday                        		06:15-16:00
	monday                        		06:15-20:00
	tuesday                       		06:15-20:00
	wednesday                     		06:15-20:00
	thursday                      		06:15-20:00
	friday                        		06:15-20:00
	saturday                      		06:15-16:00
	}	

define timeperiod {
	timeperiod_name               		support_hours
	alias                         		Support Hours
	monday                        		07:00-18:00
	tuesday                       		07:00-18:00
	wednesday                     		07:00-18:00
	thursday                      		07:00-18:00
	friday                        		07:00-18:00
	saturday                      		07:00-12:00
	}	

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               		weekday_hours
	alias                         		weekday_hours
	monday                        		06:00-18:00
	tuesday                       		06:00-18:00
	wednesday                     		06:00-18:00
	thursday                      		06:00-18:00
	friday                        		06:00-18: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
	}	

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

User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Lock Notification Times Errors

Post by lmiltchev »

Run the following command in terminal:

Code: Select all

curl -s http://assets.nagios.com/downloads/nagiosxi/scripts/fix_static_import| mysql -pnagiosxi nagiosql
...then Apply Configuration.

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
cccbbb
Posts: 23
Joined: Mon Aug 20, 2012 10:18 am

Re: Lock Notification Times Errors

Post by cccbbb »

Thanks still receiving errors on applying Notifications management lockdown
does not have a valid timeperiod for deployment. The timeperiod will have to be configured from the Core Config Manager.
does not have the XI notification handlers defined. Update the 'Notification Commands' for this contact in the Core Config Manager for new settings to be used.
This occurs for every user selected to be locked down
cccbbb
Posts: 23
Joined: Mon Aug 20, 2012 10:18 am

Re: Lock Notification Times Errors

Post by cccbbb »

OK so figured out the time periods for lock down only work with the user_specific notification timeperiod and I set that....so one error gone
still receiving

testUser does not have the XI notification handlers defined. Update the 'Notification Commands' for this contact in the Core Config Manager for new settings to be used.
but I do have the xi_host_notification_handler under the host settings for the user and the xi_service_notification_handler under the service setting...
isadmin
Posts: 151
Joined: Thu Nov 08, 2012 10:49 am

Re: Lock Notification Times Errors

Post by isadmin »

tested on a second user and all succeeds? With the exact same settings?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Lock Notification Times Errors

Post by scottwilkerson »

The xi_host_notification_handler & xi_service_notification_handler are not host/service handlers


They need to be set in the CONTACT's
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
isadmin
Posts: 151
Joined: Thu Nov 08, 2012 10:49 am

Re: Lock Notification Times Errors

Post by isadmin »

I must have been missing something. Everything is working now.
Thanks Scott!
Locked