Title: [opsview] [5285] Moved notificationmethods definition into initial_opsview.sql
Revision
5285
Author
charendra
Date
2010-11-02 19:26:57 +0000 (Tue, 02 Nov 2010)

Log Message

Moved notificationmethods definition into initial_opsview.sql

Modified Paths


Modified: trunk/opsview-core/bin/db_opsview
===================================================================
--- trunk/opsview-core/bin/db_opsview	2010-11-02 16:20:47 UTC (rev 5284)
+++ trunk/opsview-core/bin/db_opsview	2010-11-02 19:26:57 UTC (rev 5285)
@@ -45,7 +45,6 @@
 function db_export_initial {
     # Clear out the uuid first and opsview_server_name
     echo "UPDATE systempreferences SET uuid='', opsview_server_name=''" | eval mysql $user_parms $db
-	# Ignore notificationmethods for the moment
 	echo "SET FOREIGN_KEY_CHECKS=0;"
 	# Need to truncate because otherwise ids from a populatedb below will clash
 	echo "TRUNCATE servicegroups;"
@@ -54,6 +53,7 @@
 timeperiods 
 hostcheckcommands 
 monitoringservers 
+notificationmethods
 notificationprofiles
 notificationprofile_hostgroups
 notificationprofile_servicegroups
@@ -1105,16 +1105,6 @@
 # Configuration items should be held in a separate import db
 populate_db() {
 	eval mysql $user_parms $db <<-EOF || die "Cannot populate"
-	# We do notificationmethods, but this should be moved to db_export_initial when this is more generalised
-	INSERT INTO notificationmethods (id, namespace, name, active, master, command, priority, contact_variables) 
-        VALUES (1, "com.opsview.notificationmethods.aql", "AQL", 1, 0, "submit_sms_aql", 2, "PAGER");
-	INSERT INTO notificationmethods (id, namespace, name, active, master, command, priority, contact_variables) 
-        VALUES (2, "com.opsview.notificationmethods.smsgateway", "SMS Notification Module", 0, 0, "submit_sms_script", 2, "PAGER");
-	INSERT INTO notificationmethods (id, namespace, name, active, master, command, priority, contact_variables) 
-        VALUES (3, "com.opsview.notificationmethods.email", "Email", 1, 0, "notify_by_email", 1, "EMAIL");
-	INSERT INTO notificationmethods (id, namespace, name, active, master, command, priority, contact_variables) 
-        VALUES (4, "com.opsview.notificationmethods.rss", "RSS", 1, 0, "notify_by_rss", 1, "RSS_MAXIMUM_ITEMS,RSS_MAXIMUM_AGE,RSS_COLLAPSED");
-
 	# These are all the access points available in Opsview. More to come
 	# These are fixed access too, so these are the only ones available
     # Not in initial_opsview.sql because this is a code specification

Modified: trunk/opsview-core/import/initial_opsview.sql
===================================================================
--- trunk/opsview-core/import/initial_opsview.sql	2010-11-02 16:20:47 UTC (rev 5284)
+++ trunk/opsview-core/import/initial_opsview.sql	2010-11-02 19:26:57 UTC (rev 5285)
@@ -65,6 +65,16 @@
 UNLOCK TABLES;
 
 
+LOCK TABLES `notificationmethods` WRITE;
+/*!40000 ALTER TABLE `notificationmethods` DISABLE KEYS */;
+INSERT INTO `notificationmethods` (`id`, `active`, `name`, `namespace`, `master`, `command`, `priority`, `uncommitted`, `contact_variables`) VALUES (1,1,'AQL','com.opsview.notificationmethods.aql',0,'submit_sms_aql',2,0,'PAGER');
+INSERT INTO `notificationmethods` (`id`, `active`, `name`, `namespace`, `master`, `command`, `priority`, `uncommitted`, `contact_variables`) VALUES (2,0,'SMS Notification Module','com.opsview.notificationmethods.smsgateway',0,'submit_sms_script',2,0,'PAGER');
+INSERT INTO `notificationmethods` (`id`, `active`, `name`, `namespace`, `master`, `command`, `priority`, `uncommitted`, `contact_variables`) VALUES (3,1,'Email','com.opsview.notificationmethods.email',0,'notify_by_email',1,0,'EMAIL');
+INSERT INTO `notificationmethods` (`id`, `active`, `name`, `namespace`, `master`, `command`, `priority`, `uncommitted`, `contact_variables`) VALUES (4,1,'RSS','com.opsview.notificationmethods.rss',0,'notify_by_rss',1,0,'RSS_MAXIMUM_ITEMS,RSS_MAXIMUM_AGE,RSS_COLLAPSED');
+/*!40000 ALTER TABLE `notificationmethods` ENABLE KEYS */;
+UNLOCK TABLES;
+
+
 LOCK TABLES `notificationprofiles` WRITE;
 /*!40000 ALTER TABLE `notificationprofiles` DISABLE KEYS */;
 INSERT INTO `notificationprofiles` (`id`, `name`, `contactid`, `host_notification_options`, `service_notification_options`, `notification_period`, `all_hostgroups`, `all_servicegroups`, `notification_level`, `priority`, `uncommitted`) VALUES (1,'Default',1,NULL,NULL,1,1,1,1,1,0);

_______________________________________________
Opsview-checkins mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to