From 4238272fd2de49133d71fc44f07575273b98eec3 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 4 Nov 2014 16:39:32 +0100 Subject: [PATCH] Started the DB migration files to 6.0 --- .../pandoradb_migrate_5.0.x_to_5.1.mysql.sql | 270 ------------------ .../pandoradb_migrate_5.0.x_to_5.1.oracle.sql | 239 ---------------- ...doradb_migrate_5.0.x_to_5.1.postgreSQL.sql | 209 -------------- .../pandoradb_migrate_5.1_to_6.0.mysql.sql | 0 .../pandoradb_migrate_5.1_to_6.0.oracle.sql | 0 ...andoradb_migrate_5.1_to_6.0.postgreSQL.sql | 0 6 files changed, 718 deletions(-) delete mode 100644 pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql delete mode 100644 pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql delete mode 100644 pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql create mode 100644 pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql create mode 100644 pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql create mode 100644 pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql deleted file mode 100644 index c6fe3d359b..0000000000 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql +++ /dev/null @@ -1,270 +0,0 @@ --- --------------------------------------------------------------------- --- Table `talert_templates` --- --------------------------------------------------------------------- -ALTER TABLE `talert_templates` ADD COLUMN `field1_recovery` text NOT NULL; - --- --------------------------------------------------------------------- --- Table `talert_actions` --- --------------------------------------------------------------------- -ALTER TABLE `talert_actions` ADD COLUMN `field1_recovery` text NOT NULL; -ALTER TABLE `talert_actions` ADD COLUMN `field2_recovery` text NOT NULL; -ALTER TABLE `talert_actions` ADD COLUMN `field3_recovery` text NOT NULL; -ALTER TABLE `talert_actions` ADD COLUMN `field4_recovery` text NOT NULL; -ALTER TABLE `talert_actions` ADD COLUMN `field5_recovery` text NOT NULL; -ALTER TABLE `talert_actions` ADD COLUMN `field6_recovery` text NOT NULL; -ALTER TABLE `talert_actions` ADD COLUMN `field7_recovery` text NOT NULL; -ALTER TABLE `talert_actions` ADD COLUMN `field8_recovery` text NOT NULL; -ALTER TABLE `talert_actions` ADD COLUMN `field9_recovery` text NOT NULL; -ALTER TABLE `talert_actions` ADD COLUMN `field10_recovery` text NOT NULL; - --- --------------------------------------------------------------------- --- Table `tconfig` --- --------------------------------------------------------------------- -INSERT INTO `tconfig` (`token`, `value`) VALUES -('graph_color4', '#FF66CC'), -('graph_color5', '#CC0000'), -('graph_color6', '#0033FF'), -('graph_color7', '#99FF99'), -('graph_color8', '#330066'), -('graph_color9', '#66FFFF'), -('graph_color10', '#6666FF'); - -UPDATE tconfig SET `value`='#FFFF00' WHERE `token`='graph_color2'; -UPDATE tconfig SET `value`='#FF6600' WHERE `token`='graph_color3'; - --- --------------------------------------------------------------------- --- Table `tconfig` --- --------------------------------------------------------------------- -ALTER TABLE tgraph_source MODIFY COLUMN `weight` float(8,3) NOT NULL DEFAULT 0; - --- --------------------------------------------------------------------- --- Table `tconfig_os` --- --------------------------------------------------------------------- -INSERT INTO `tconfig_os` (`name`, `description`, `icon_name`) VALUES ('Router', 'Generic router', 'so_router.png'); -INSERT INTO `tconfig_os` (`name`, `description`, `icon_name`) VALUES ('Switch', 'Generic switch', 'so_switch.png'); -INSERT INTO `tconfig_os` (`name`, `description`, `icon_name`) VALUES ('Satellite', 'Satellite agent', 'satellite.png'); - - --- --------------------------------------------------------------------- --- Table `tagente_modulo` --- --------------------------------------------------------------------- -ALTER TABLE `tagente_modulo` ADD COLUMN `min_ff_event_normal` int(4) unsigned default '0'; -ALTER TABLE `tagente_modulo` ADD COLUMN `min_ff_event_warning` int(4) unsigned default '0'; -ALTER TABLE `tagente_modulo` ADD COLUMN `min_ff_event_critical` int(4) unsigned default '0'; -ALTER TABLE `tagente_modulo` ADD COLUMN `each_ff` tinyint(1) unsigned default '0'; -/* 2014/05/31 */ -ALTER TABLE `tagente_modulo` ADD COLUMN `ff_timeout` int(4) unsigned default '0'; - -/* 2014/03/18 */ --- --------------------------------------------------------------------- --- Table `tmodule_relationship` --- --------------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `tmodule_relationship` ( - `id` int(10) unsigned NOT NULL auto_increment, - `module_a` int(10) unsigned NOT NULL, - `module_b` int(10) unsigned NOT NULL, - `disable_update` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`id`), - FOREIGN KEY (`module_a`) REFERENCES tagente_modulo(`id_agente_modulo`) ON DELETE CASCADE, - FOREIGN KEY (`module_b`) REFERENCES tagente_modulo(`id_agente_modulo`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --------------------------------------------------------------------- --- Table `talert_snmp` --- --------------------------------------------------------------------- -ALTER TABLE `talert_snmp` ADD COLUMN `id_group` int(10) unsigned NOT NULL default '0'; - -/* 2014/03/19 */ --- --------------------------------------------------------------------- --- Table `talert_snmp` --- --------------------------------------------------------------------- -ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f11_` text; -ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f12_` text; -ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f13_` text; -ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f14_` text; -ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f15_` text; -ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f16_` text; -ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f17_` text; -ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f18_` text; -ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f19_` text; -ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f20_` text; - -ALTER TABLE `tnetwork_map` ADD COLUMN `l2_network` tinyint(1) unsigned NOT NULL default '0'; - --- --------------------------------------------------------------------- --- Table `tlayout_data` --- --------------------------------------------------------------------- -ALTER TABLE `tlayout_data` ADD COLUMN `id_group` INTEGER UNSIGNED NOT NULL default 0; -ALTER TABLE `tlayout_data` ADD COLUMN `id_custom_graph` INTEGER UNSIGNED NOT NULL default 0; - --- --------------------------------------------------------------------- --- Table `talert_snmp` --- --------------------------------------------------------------------- -ALTER TABLE `talert_snmp` ADD COLUMN `order_1` int(10) unsigned NOT NULL default 1; -ALTER TABLE `talert_snmp` ADD COLUMN `order_2` int(10) unsigned NOT NULL default 2; -ALTER TABLE `talert_snmp` ADD COLUMN `order_3` int(10) unsigned NOT NULL default 3; -ALTER TABLE `talert_snmp` ADD COLUMN `order_4` int(10) unsigned NOT NULL default 4; -ALTER TABLE `talert_snmp` ADD COLUMN `order_5` int(10) unsigned NOT NULL default 5; -ALTER TABLE `talert_snmp` ADD COLUMN `order_6` int(10) unsigned NOT NULL default 6; -ALTER TABLE `talert_snmp` ADD COLUMN `order_7` int(10) unsigned NOT NULL default 7; -ALTER TABLE `talert_snmp` ADD COLUMN `order_8` int(10) unsigned NOT NULL default 8; -ALTER TABLE `talert_snmp` ADD COLUMN `order_9` int(10) unsigned NOT NULL default 9; -ALTER TABLE `talert_snmp` ADD COLUMN `order_10` int(10) unsigned NOT NULL default 10; -ALTER TABLE `talert_snmp` ADD COLUMN `order_11` int(10) unsigned NOT NULL default 11; -ALTER TABLE `talert_snmp` ADD COLUMN `order_12` int(10) unsigned NOT NULL default 12; -ALTER TABLE `talert_snmp` ADD COLUMN `order_13` int(10) unsigned NOT NULL default 13; -ALTER TABLE `talert_snmp` ADD COLUMN `order_14` int(10) unsigned NOT NULL default 14; -ALTER TABLE `talert_snmp` ADD COLUMN `order_15` int(10) unsigned NOT NULL default 15; -ALTER TABLE `talert_snmp` ADD COLUMN `order_16` int(10) unsigned NOT NULL default 16; -ALTER TABLE `talert_snmp` ADD COLUMN `order_17` int(10) unsigned NOT NULL default 17; -ALTER TABLE `talert_snmp` ADD COLUMN `order_18` int(10) unsigned NOT NULL default 18; -ALTER TABLE `talert_snmp` ADD COLUMN `order_19` int(10) unsigned NOT NULL default 19; -ALTER TABLE `talert_snmp` ADD COLUMN `order_20` int(10) unsigned NOT NULL default 20; - --- --------------------------------------------------------------------- --- Table `talert_snmp_action` --- --------------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `talert_snmp_action` ( - `id` int(10) unsigned NOT NULL auto_increment, - `id_alert_snmp` int(10) unsigned NOT NULL default '0', - `alert_type` int(2) unsigned NOT NULL default '0', - `al_field1` text NOT NULL, - `al_field2` text NOT NULL, - `al_field3` text NOT NULL, - `al_field4` text NOT NULL, - `al_field5` text NOT NULL, - `al_field6` text NOT NULL, - `al_field7` text NOT NULL, - `al_field8` text NOT NULL, - `al_field9` text NOT NULL, - `al_field10` text NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --------------------------------------------------------------------- --- Table `treport` --- --------------------------------------------------------------------- -ALTER TABLE `treport` ADD COLUMN `non_interactive` tinyint(1) UNSIGNED NOT NULL default 0; - -/* 2014/04/11 */ --- --------------------------------------------------------------------- --- Table `trecon_script` and `trecon_task` --- --------------------------------------------------------------------- -ALTER TABLE `trecon_script` ADD COLUMN `macros` TEXT; -ALTER TABLE `trecon_task` ADD COLUMN `macros` TEXT; - --- --------------------------------------------------------------------- --- Table `trecon_script` --- --------------------------------------------------------------------- -INSERT INTO `trecon_script` (`name`, `description`, `script`, `macros`) VALUES ('SNMP L2 Recon','Pandora FMS SNMP Recon Plugin for level 2 network topology discovery. (c) Artica ST 2014 <info@artica.es> Usage: ./snmp-recon.pl <task_id> <group_id> <create_incident> <custom_field1> <custom_field2> [custom_field3] [custom_field4] * custom_field1 = comma separated list of networks (i.e.: 192.168.1.0/24,192.168.2.0/24) * custom_field2 = comma separated list of snmp communities to try. * custom_field3 = a router in the network. Optional but recommended. * custom_field4 = set to -a to add all network interfaces (by default only interfaces that are up are added). Additional information: When the script is called from a recon task the task_id, group_id and create_incident parameters are automatically filled by the Pandora FMS Server.','/usr/share/pandora_server/util/recon_scripts/snmp-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"Comma separated list of networks (i.e.: 192.168.1.0/24,192.168.2.0/24)\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Community\",\"help\":\"Comma separated list of snmp communities to try.\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Router\",\"help\":\"A router in the network. Optional but recommended.\",\"value\":\"\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Optional parameter\",\"help\":\"Set to -a to add all network interfaces (by default only interfaces that are up are added).\",\"value\":\"\",\"hide\":\"\"}}'); - -INSERT INTO `trecon_script` (`name`, `description`, `script`, `macros`) VALUES ('WMI Recon Script','This script is used to automatically gather host information via WMI. Available parameters: * Network = network to scan (e.g. 192.168.100.0/24). * WMI auth = comma separated list of WMI authentication tokens in the format username%password (e.g. Administrador%pass). See the documentation for more information.','/usr/share/pandora_server/util/recon_scripts/wmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"WMI auth\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"}}'); - -/* 2014/04/10 */ -ALTER TABLE `treport_content` ADD COLUMN `name` varchar(150) NULL; - -/* 2014/05/05 */ --- --------------------------------------------------------------------- --- Table `tlink` --- --------------------------------------------------------------------- -UPDATE `tlink` SET `link`='http://wiki.pandorafms.com/?title=Pandora' WHERE `name`='Pandora FMS Manual'; - -/* 2014/05/07 */ --- --------------------------------------------------------------------- --- Table `tconfig` --- --------------------------------------------------------------------- -INSERT INTO `tconfig` (`token`, `value`) VALUES -('custom_report_front', 0), -('custom_report_front_font', 'FreeSans.ttf'), -('custom_report_front_logo', 'images/pandora_logo_white.jpg'), -('custom_report_front_header', ''), -('custom_report_front_footer', ''); - -/* 2014/05/19 */ --- --------------------------------------------------------------------- --- Table `tnetwork_profile` --- --------------------------------------------------------------------- -DELETE FROM `tnetwork_profile` WHERE `id_np`=1; -DELETE FROM `tnetwork_profile` WHERE `id_np`=4; -DELETE FROM `tnetwork_profile` WHERE `id_np`=5; -DELETE FROM `tnetwork_profile` WHERE `id_np`=6; - -/* 2014/05/19 */ --- --------------------------------------------------------------------- --- Table `tnetwork_profile_component` --- --------------------------------------------------------------------- -DELETE FROM `tnetwork_profile_component` WHERE `id_np`=1; -DELETE FROM `tnetwork_profile_component` WHERE `id_np`=4; -DELETE FROM `tnetwork_profile_component` WHERE `id_np`=5; -DELETE FROM `tnetwork_profile_component` WHERE `id_np`=6; -DELETE FROM `tnetwork_profile_component` WHERE `id_nc`=24 AND `id_np`=3; - -/* 2014/05/25 */ --- --------------------------------------------------------------------- --- Table `tnetwork_component` --- --------------------------------------------------------------------- -ALTER TABLE `tnetwork_component` ADD COLUMN `min_ff_event_normal` int(4) unsigned default '0'; -ALTER TABLE `tnetwork_component` ADD COLUMN `min_ff_event_warning` int(4) unsigned default '0'; -ALTER TABLE `tnetwork_component` ADD COLUMN `min_ff_event_critical` int(4) unsigned default '0'; -ALTER TABLE `tnetwork_component` ADD COLUMN `each_ff` tinyint(1) unsigned default '0'; - -/* 2014/05/30 */ --- --------------------------------------------------------------------- --- Table `tnews` --- --------------------------------------------------------------------- -ALTER TABLE `tnews` ADD COLUMN `id_group` int(10) NOT NULL default 0; -ALTER TABLE `tnews` ADD COLUMN `modal` tinyint(1) DEFAULT 0; -ALTER TABLE `tnews` ADD COLUMN `expire` tinyint(1) DEFAULT 0; -ALTER TABLE `tnews` ADD COLUMN `expire_timestamp` DATETIME NOT NULL DEFAULT 0; - -/* 2014/05/31 */ --- --------------------------------------------------------------------- --- Table `tagente_estado` --- --------------------------------------------------------------------- -ALTER TABLE `tagente_estado` ADD COLUMN `ff_start_utimestamp` bigint(20) default 0; - -/* 2014/06/24 */ --- --------------------------------------------------------------------- --- Table `trecon_script` --- --------------------------------------------------------------------- -DELETE FROM `trecon_script` WHERE id_recon_script=1; - -/* 2014/08/07 */ --- --------------------------------------------------------------------- --- Table `tagente_modulo` --- --------------------------------------------------------------------- -ALTER TABLE tagente_modulo MODIFY COLUMN `post_process` double(24,15) default 0; - -/* 2014/08/18 */ --- --------------------------------------------------------------------- --- Table `talert_commands` --- --------------------------------------------------------------------- -INSERT INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES ('Integria IMS Ticket','Internal type','This alert create a ticket into your Integria IMS.',1,'[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Ticket description\"]','[\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\"]'); - --- --------------------------------------------------------------------- --- Table `talert_actions` --- --------------------------------------------------------------------- -SET @command_id = (SELECT id FROM talert_commands WHERE name='Integria IMS Ticket'); -INSERT INTO `talert_actions` (`name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`) VALUES ('Create a ticket in Integria IMS',@command_id,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0); - --- --------------------------------------------------------------------- --- Table `tconfig` --- --------------------------------------------------------------------- -DELETE FROM `tconfig` WHERE `token`='sla_period'; - --- --------------------------------------------------------------------- --- Table `network_component` --- --------------------------------------------------------------------- -UPDATE `tnetwork_component` SET `module_interval`= 3600 WHERE `id_nc`=53; -UPDATE `tnetwork_component` SET `post_process`= 0.000000115740741 WHERE `id_nc`=53; -UPDATE `tnetwork_component` SET `unit`= 'day' WHERE `id_nc`=53; - --- --------------------------------------------------------------------- --- Table `tnetwork_component` --- --------------------------------------------------------------------- -ALTER TABLE `tnetwork_component` MODIFY COLUMN `post_process` DOUBLE(24,15) DEFAULT 0; - --- --------------------------------------------------------------------- --- Table `tagente_modulo` --- --------------------------------------------------------------------- -ALTER TABLE `tagente_modulo` MODIFY COLUMN `post_process` DOUBLE(24,15) DEFAULT 0; diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql deleted file mode 100644 index 7cc6f7733b..0000000000 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql +++ /dev/null @@ -1,239 +0,0 @@ --- --------------------------------------------------------------------- --- Table `talert_templates` --- --------------------------------------------------------------------- -ALTER TABLE talert_templates ADD (field1_recovery CLOB default '' NULL); - --- --------------------------------------------------------------------- --- Table `talert_actions` --- --------------------------------------------------------------------- -ALTER TABLE talert_actions ADD (field1_recovery CLOB default '' NULL); -ALTER TABLE talert_actions ADD (field2_recovery CLOB default '' NULL); -ALTER TABLE talert_actions ADD (field3_recovery CLOB default '' NULL); -ALTER TABLE talert_actions ADD (field4_recovery CLOB default '' NULL); -ALTER TABLE talert_actions ADD (field5_recovery CLOB default '' NULL); -ALTER TABLE talert_actions ADD (field6_recovery CLOB default '' NULL); -ALTER TABLE talert_actions ADD (field7_recovery CLOB default '' NULL); -ALTER TABLE talert_actions ADD (field8_recovery CLOB default '' NULL); -ALTER TABLE talert_actions ADD (field9_recovery CLOB default '' NULL); -ALTER TABLE talert_actions ADD (field10_recovery CLOB default '' NULL); - --- --------------------------------------------------------------------- --- Table `tconfig` --- --------------------------------------------------------------------- -INSERT INTO tconfig (token, value) VALUES ('graph_color4', '#FF66CC'); -INSERT INTO tconfig (token, value) VALUES ('graph_color5', '#CC0000'); -INSERT INTO tconfig (token, value) VALUES ('graph_color6', '#0033FF'); -INSERT INTO tconfig (token, value) VALUES ('graph_color7', '#99FF99'); -INSERT INTO tconfig (token, value) VALUES ('graph_color8', '#330066'); -INSERT INTO tconfig (token, value) VALUES ('graph_color9', '#66FFFF'); -INSERT INTO tconfig (token, value) VALUES ('graph_color10', '#6666FF'); - -UPDATE tconfig SET value='#FFFF00' WHERE token='graph_color2'; -UPDATE tconfig SET value='#FF6600' WHERE token='graph_color3'; - --- --------------------------------------------------------------------- --- Table `tconfig_os` --- --------------------------------------------------------------------- -INSERT INTO tconfig_os VALUES (17, 'Router', 'Generic router', 'so_router.png'); -INSERT INTO tconfig_os VALUES (18, 'Switch', 'Generic switch', 'so_switch.png'); -INSERT INTO tconfig_os VALUES (19, 'Satellite', 'Satellite agent', 'satellite.png'); - --- --------------------------------------------------------------------- --- Table `tagente_modulo` --- --------------------------------------------------------------------- -/* 2014/05/21 */ -ALTER TABLE tagente_modulo ADD COLUMN min_ff_event_normal INTEGER default 0; -ALTER TABLE tagente_modulo ADD COLUMN min_ff_event_warning INTEGER default 0; -ALTER TABLE tagente_modulo ADD COLUMN min_ff_event_critical INTEGER default 0; -ALTER TABLE tagente_modulo ADD COLUMN each_ff NUMBER(1, 0) default 0; -/* 2014/05/31 */ -ALTER TABLE tagente_modulo ADD COLUMN ff_timeout INTEGER unsigned default 0; - -/* 2014/03/18 */ --- ---------------------------------------------------------------------- --- Table `tmodule_relationship` --- ---------------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS tmodule_relationship ( - id NUMBER(10, 0) NOT NULL PRIMARY KEY, - module_a NUMBER(10, 0) NOT NULL REFERENCES tagente_modulo(id_agente_modulo) - ON DELETE CASCADE, - module_b NUMBER(10, 0) NOT NULL REFERENCES tagente_modulo(id_agente_modulo) - ON DELETE CASCADE, - disable_update NUMBER(1, 0) default 0 NOT NULL -); - -CREATE SEQUENCE tmodule_relationship_s INCREMENT BY 1 START WITH 1; - -CREATE OR REPLACE TRIGGER tmodule_relationship_inc BEFORE INSERT ON tmodule_relationship REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tmodule_relationship_s.nextval INTO :NEW.ID FROM dual; END;; - --- --------------------------------------------------------------------- --- Table `talert_snmp` --- --------------------------------------------------------------------- -ALTER TABLE talert_snmp ADD (id_group NUMBER(10, 0) default 0 NOT NULL); - -/* 2014/03/19 */ --- --------------------------------------------------------------------- --- Table `talert_snmp` --- --------------------------------------------------------------------- -ALTER TABLE talert_snmp ADD (_snmp_f11_ CLOB default ''); -ALTER TABLE talert_snmp ADD (_snmp_f12_ CLOB default ''); -ALTER TABLE talert_snmp ADD (_snmp_f13_ CLOB default ''); -ALTER TABLE talert_snmp ADD (_snmp_f14_ CLOB default ''); -ALTER TABLE talert_snmp ADD (_snmp_f15_ CLOB default ''); -ALTER TABLE talert_snmp ADD (_snmp_f16_ CLOB default ''); -ALTER TABLE talert_snmp ADD (_snmp_f17_ CLOB default ''); -ALTER TABLE talert_snmp ADD (_snmp_f18_ CLOB default ''); -ALTER TABLE talert_snmp ADD (_snmp_f19_ CLOB default ''); -ALTER TABLE talert_snmp ADD (_snmp_f20_ CLOB default ''); - -ALTER TABLE tnetwork_map ADD (l2_network NUMBER(1, 0) default 0 NOT NULL); - --- --------------------------------------------------------------------- --- Table `tlayout_data` --- --------------------------------------------------------------------- -ALTER TABLE `tlayout_data` ADD COLUMN id_group NUMBER(10, 0) default 0 NOT NULL; -ALTER TABLE `tlayout_data` ADD COLUMN id_custom_graph NUMBER(10, 0) default 0 NOT NULL; - --- --------------------------------------------------------------------- --- Table `talert_snmp` --- --------------------------------------------------------------------- -ALTER TABLE talert_snmp ADD (order_1 NUMBER(10, 0) default 1 NOT NULL); -ALTER TABLE talert_snmp ADD (order_2 NUMBER(10, 0) default 2 NOT NULL); -ALTER TABLE talert_snmp ADD (order_3 NUMBER(10, 0) default 3 NOT NULL); -ALTER TABLE talert_snmp ADD (order_4 NUMBER(10, 0) default 4 NOT NULL); -ALTER TABLE talert_snmp ADD (order_5 NUMBER(10, 0) default 5 NOT NULL); -ALTER TABLE talert_snmp ADD (order_6 NUMBER(10, 0) default 6 NOT NULL); -ALTER TABLE talert_snmp ADD (order_7 NUMBER(10, 0) default 7 NOT NULL); -ALTER TABLE talert_snmp ADD (order_8 NUMBER(10, 0) default 8 NOT NULL); -ALTER TABLE talert_snmp ADD (order_9 NUMBER(10, 0) default 9 NOT NULL); -ALTER TABLE talert_snmp ADD (order_10 NUMBER(10, 0) default 10 NOT NULL); -ALTER TABLE talert_snmp ADD (order_11 NUMBER(10, 0) default 11 NOT NULL); -ALTER TABLE talert_snmp ADD (order_12 NUMBER(10, 0) default 12 NOT NULL); -ALTER TABLE talert_snmp ADD (order_13 NUMBER(10, 0) default 13 NOT NULL); -ALTER TABLE talert_snmp ADD (order_14 NUMBER(10, 0) default 14 NOT NULL); -ALTER TABLE talert_snmp ADD (order_15 NUMBER(10, 0) default 15 NOT NULL); -ALTER TABLE talert_snmp ADD (order_16 NUMBER(10, 0) default 16 NOT NULL); -ALTER TABLE talert_snmp ADD (order_17 NUMBER(10, 0) default 17 NOT NULL); -ALTER TABLE talert_snmp ADD (order_18 NUMBER(10, 0) default 18 NOT NULL); -ALTER TABLE talert_snmp ADD (order_19 NUMBER(10, 0) default 19 NOT NULL); -ALTER TABLE talert_snmp ADD (order_20 NUMBER(10, 0) default 20 NOT NULL); - --- --------------------------------------------------------------------- --- Table talert_snmp_action --- --------------------------------------------------------------------- -CREATE TABLE talert_snmp_action ( - id NUMBER(10, 0) NOT NULL PRIMARY KEY, - id_alert_snmp NUMBER(10, 0) NOT NULL default 0, - alert_type NUMBER(2, 0) NOT NULL default 0, - al_field1 CLOB default '' NOT NULL, - al_field2 CLOB default '' NOT NULL, - al_field3 CLOB default '' NOT NULL, - al_field4 CLOB default '' NOT NULL, - al_field5 CLOB default '' NOT NULL, - al_field6 CLOB default '' NOT NULL, - al_field7 CLOB default '' NOT NULL, - al_field8 CLOB default '' NOT NULL, - al_field9 CLOB default '' NOT NULL, - al_field10 CLOB default '' NOT NULL -); - --- --------------------------------------------------------------------- --- Table treport --- --------------------------------------------------------------------- -ALTER TABLE treport ADD (non_interactive NUMBER(5, 0) default 0 NOT NULL); - -/* 2014/04/10 */ -ALTER TABLE treport_content ADD (name VARCHAR2(150) default NULL); - -/* 2014/04/11 */ --- --------------------------------------------------------------------- --- Table `trecon_script` and `trecon_task` --- --------------------------------------------------------------------- -ALTER TABLE trecon_script ADD (macros CLOB default '' NOT NULL); -ALTER TABLE trecon_task ADD (macros CLOB default '' NOT NULL); - -/* 2014/05/05 */ --- --------------------------------------------------------------------- --- Table tlink --- --------------------------------------------------------------------- -UPDATE tlink SET link='http://wiki.pandorafms.com/?title=Pandora' WHERE name='Pandora FMS Manual'; - -/* 2014/05/07 */ --- --------------------------------------------------------------------- --- Table `tconfig` --- --------------------------------------------------------------------- -INSERT INTO tconfig (token, value) VALUES ('custom_report_front', 0); -INSERT INTO tconfig (token, value) VALUES ('custom_report_front_font', 'FreeSans.ttf'); -INSERT INTO tconfig (token, value) VALUES ('custom_report_front_logo', 'images/pandora_logo_white.jpg'); -INSERT INTO tconfig (token, value) VALUES ('custom_report_front_header', ''); -INSERT INTO tconfig (token, value) VALUES ('custom_report_front_footer', ''); - -/* 2014/05/19 */ --- --------------------------------------------------------------------- --- Table `tnetwork_profile` --- --------------------------------------------------------------------- -DELETE FROM tnetwork_profile WHERE id_np=1; -DELETE FROM tnetwork_profile WHERE id_np=4; -DELETE FROM tnetwork_profile WHERE id_np=5; -DELETE FROM tnetwork_profile WHERE id_np=6; - -/* 2014/05/19 */ --- --------------------------------------------------------------------- --- Table `tnetwork_profile_component` --- --------------------------------------------------------------------- -DELETE FROM tnetwork_profile_component WHERE id_np=1; -DELETE FROM tnetwork_profile_component WHERE id_np=4; -DELETE FROM tnetwork_profile_component WHERE id_np=5; -DELETE FROM tnetwork_profile_component WHERE id_np=6; -DELETE FROM tnetwork_profile_component WHERE id_nc=24 AND id_np=3; - -/* 2014/05/25 */ --- --------------------------------------------------------------------- --- Table `tnetwork_component` --- --------------------------------------------------------------------- -ALTER TABLE tnetwork_component ADD COLUMN min_ff_event_normal INTEGER default 0; -ALTER TABLE tnetwork_component ADD COLUMN min_ff_event_warning INTEGER default 0; -ALTER TABLE tnetwork_component ADD COLUMN min_ff_event_critical INTEGER default 0; -ALTER TABLE tnetwork_component ADD COLUMN each_ff NUMBER(1, 0) default 0; - -/* 2014/05/30 */ --- --------------------------------------------------------------------- --- Table `tnews` --- --------------------------------------------------------------------- -ALTER TABLE tnews ADD COLUMN id_group NUMBER(10, 0) default 0 NOT NULL; -ALTER TABLE tnews ADD COLUMN modal NUMBER(5, 0) default 0 NOT NULL; -ALTER TABLE tnews ADD COLUMN expire NUMBER(5, 0) default 0 NOT NULL; -ALTER TABLE tnews ADD COLUMN expire_timestamp TIMESTAMP default NULL; - -/* 2014/05/31 */ --- --------------------------------------------------------------------- --- Table `tagente_estado` --- --------------------------------------------------------------------- -ALTER TABLE tagente_estado ADD COLUMN ff_start_utimestamp NUMBER(10, 0) default 0; - -/* 2014/06/24 */ --- --------------------------------------------------------------------- --- Table trecon_script --- --------------------------------------------------------------------- -DELETE FROM trecon_script WHERE id_recon_script=1; - -/* 2014/08/07 */ --- --------------------------------------------------------------------- --- Table `tagente_modulo` --- --------------------------------------------------------------------- -ALTER TABLE tagente_modulo MODIFY COLUMN post_process NUMBER(18,15) default 0; - -/* 2014/08/18 */ --- --------------------------------------------------------------------- --- Table `talert_commands` --- --------------------------------------------------------------------- -INSERT INTO talert_commands (name, command, description, internal, fields_descriptions, fields_values) VALUES ('Integria IMS Ticket','Internal type','This alert create a ticket into your Integria IMS.',1,'[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Ticket description\"]','[\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\"]'); - --- --------------------------------------------------------------------- --- Table `talert_actions` --- --------------------------------------------------------------------- -INSERT INTO talert_actions (name, id_alert_command, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, id_group, action_threshold) VALUES ('Create a ticket in Integria IMS',13,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0); --- --------------------------------------------------------------------- --- Table `tconfig` --- --------------------------------------------------------------------- -DELETE FROM tconfig WHERE token='sla_period'; diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql deleted file mode 100644 index 844fb2cde3..0000000000 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql +++ /dev/null @@ -1,209 +0,0 @@ --- --------------------------------------------------------------------- --- Table "talert_templates" --- --------------------------------------------------------------------- -ALTER TABLE "talert_templates" ADD COLUMN "field1_recovery" text NULL default ''; - --- --------------------------------------------------------------------- --- Table "talert_actions" --- --------------------------------------------------------------------- -ALTER TABLE "talert_actions" ADD COLUMN "field1_recovery" text NULL default ''; -ALTER TABLE "talert_actions" ADD COLUMN "field2_recovery" text NULL default ''; -ALTER TABLE "talert_actions" ADD COLUMN "field3_recovery" text NULL default ''; -ALTER TABLE "talert_actions" ADD COLUMN "field4_recovery" text NULL default ''; -ALTER TABLE "talert_actions" ADD COLUMN "field5_recovery" text NULL default ''; -ALTER TABLE "talert_actions" ADD COLUMN "field6_recovery" text NULL default ''; -ALTER TABLE "talert_actions" ADD COLUMN "field7_recovery" text NULL default ''; -ALTER TABLE "talert_actions" ADD COLUMN "field8_recovery" text NULL default ''; -ALTER TABLE "talert_actions" ADD COLUMN "field9_recovery" text NULL default ''; -ALTER TABLE "talert_actions" ADD COLUMN "field10_recovery" text NULL default ''; - --- --------------------------------------------------------------------- --- Table "tconfig" --- --------------------------------------------------------------------- -INSERT INTO "tconfig" ("token", "value") VALUES -('graph_color4', '#FF66CC'), -('graph_color5', '#CC0000'), -('graph_color6', '#0033FF'), -('graph_color7', '#99FF99'), -('graph_color8', '#330066'), -('graph_color9', '#66FFFF'), -('graph_color10', '#6666FF'); - -UPDATE "tconfig" SET "value"='#FFFF00' WHERE "token"='graph_color2'; -UPDATE "tconfig" SET "value"='#FF6600' WHERE "token"='graph_color3'; - --- --------------------------------------------------------------------- --- Table "tconfig_os" --- --------------------------------------------------------------------- -INSERT INTO "tconfig_os" VALUES (17, 'Router', 'Generic router', 'so_router.png'); -INSERT INTO "tconfig_os" VALUES (18, 'Switch', 'Generic switch', 'so_switch.png'); -INSERT INTO "tconfig_os" VALUES (19, 'Satellite', 'Satellite agent', 'satellite.png'); - --- --------------------------------------------------------------------- --- Table `tagente_modulo` --- --------------------------------------------------------------------- -/* 2014/05/21 */ -ALTER TABLE "tagente_modulo" ADD COLUMN "min_ff_event_normal" INTEGER default 0; -ALTER TABLE "tagente_modulo" ADD COLUMN "min_ff_event_warning" INTEGER default 0; -ALTER TABLE "tagente_modulo" ADD COLUMN "min_ff_event_critical" INTEGER default 0; -ALTER TABLE "tagente_modulo" ADD COLUMN "each_ff" SMALLINT default 0; -/* 2014/05/31 */ -ALTER TABLE "tagente_modulo" ADD COLUMN "ff_timeout" INTEGER unsigned default 0; - -/* 2014/03/18 */ --- ---------------------------------------------------------------------- --- Table `tmodule_relationship` --- ---------------------------------------------------------------------- -CREATE TABLE "tmodule_relationship" ( - "id" SERIAL NOT NULL PRIMARY KEY, - "module_a" INTEGER NOT NULL REFERENCES tagente_modulo("id_agente_modulo") - ON DELETE CASCADE, - "module_b" INTEGER NOT NULL REFERENCES tagente_modulo("id_agente_modulo") - ON DELETE CASCADE, - "disable_update" SMALLINT NOT NULL default 0 -); - --- --------------------------------------------------------------------- --- Table "talert_snmp" --- --------------------------------------------------------------------- -ALTER TABLE "talert_snmp" ADD COLUMN "id_group" INTEGER NOT NULL default 0; - -/* 2014/03/19 */ --- --------------------------------------------------------------------- --- Table "talert_snmp" --- --------------------------------------------------------------------- -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f11_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f12_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f13_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f14_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f15_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f16_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f17_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f18_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f19_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f20_" text DEFAULT ''; - -ALTER TABLE "tnetwork_map" ADD COLUMN "l2_network" SMALLINT NOT NULL default 0; - --- --------------------------------------------------------------------- --- Table `tlayout_data` --- --------------------------------------------------------------------- -ALTER TABLE "tlayout_data" ADD COLUMN "id_group" INTEGER NOT NULL default 0; -ALTER TABLE "tlayout_data" ADD COLUMN "id_custom_graph" INTEGER NOT NULL default 0; - --- --------------------------------------------------------------------- --- Table talert_snmp_action --- --------------------------------------------------------------------- -CREATE TABLE "talert_snmp_action" ( - "id" SERIAL NOT NULL PRIMARY KEY, - "id_alert_snmp" INTEGER default 0, - "alert_type" INTEGER default 0, - "al_field1" TEXT default '', - "al_field2" TEXT default '', - "al_field3" TEXT default '', - "al_field4" TEXT default '', - "al_field5" TEXT default '', - "al_field6" TEXT default '', - "al_field7" TEXT default '', - "al_field8" TEXT default '', - "al_field9" TEXT default '', - "al_field10" TEXT default '' -); - --- --------------------------------------------------------------------- --- Table treport --- --------------------------------------------------------------------- -ALTER TABLE "treport" ADD COLUMN "non_interactive" SMALLINT DEFAULT 0; - -/* 2014/04/10 */ -ALTER TABLE "treport_content" ADD COLUMN "name" varchar(150) NULL; - -/* 2014/04/11 */ --- --------------------------------------------------------------------- --- Table `trecon_script` and `trecon_task` --- --------------------------------------------------------------------- -ALTER TABLE "trecon_script" ADD COLUMN "macros" TEXT default ''; -ALTER TABLE "trecon_task" ADD COLUMN "macros" TEXT default ''; - -/* 2014/05/05 */ --- --------------------------------------------------------------------- --- Table tlink --- --------------------------------------------------------------------- -UPDATE "tlink" SET "link"='http://wiki.pandorafms.com/?title=Pandora' WHERE "name"='Pandora FMS Manual'; - -/* 2014/05/07 */ --- --------------------------------------------------------------------- --- Table `tconfig` --- --------------------------------------------------------------------- -INSERT INTO "tconfig" ("token", "value") VALUES -('custom_report_front', 0), -('custom_report_front_font', 'FreeSans.ttf'), -('custom_report_front_logo', 'images/pandora_logo_white.jpg'), -('custom_report_front_header', ''), -('custom_report_front_footer', ''); - -/* 2014/05/19 */ --- --------------------------------------------------------------------- --- Table `tnetwork_profile` --- --------------------------------------------------------------------- -DELETE FROM "tnetwork_profile" WHERE "id_np"=1; -DELETE FROM "tnetwork_profile" WHERE "id_np"=4; -DELETE FROM "tnetwork_profile" WHERE "id_np"=5; -DELETE FROM "tnetwork_profile" WHERE "id_np"=6; - -/* 2014/05/19 */ --- --------------------------------------------------------------------- --- Table `tnetwork_profile_component` --- --------------------------------------------------------------------- -DELETE FROM "tnetwork_profile_component" WHERE "id_np"=1; -DELETE FROM "tnetwork_profile_component" WHERE "id_np"=4; -DELETE FROM "tnetwork_profile_component" WHERE "id_np"=5; -DELETE FROM "tnetwork_profile_component" WHERE "id_np"=6; -DELETE FROM "tnetwork_profile_component" WHERE "id_nc"=24 AND "id_np"=3; - -/* 2014/05/25 */ --- --------------------------------------------------------------------- --- Table `tnetwork_component` --- --------------------------------------------------------------------- -ALTER TABLE "tnetwork_component" ADD COLUMN "min_ff_event_normal" INTEGER default 0; -ALTER TABLE "tnetwork_component" ADD COLUMN "min_ff_event_warning" INTEGER default 0; -ALTER TABLE "tnetwork_component" ADD COLUMN "min_ff_event_critical" INTEGER default 0; -ALTER TABLE "tnetwork_component" ADD COLUMN "each_ff" SMALLINT default 0; - -/* 2014/05/30 */ --- --------------------------------------------------------------------- --- Table `tnews` --- --------------------------------------------------------------------- -ALTER TABLE "tnews" ADD COLUMN "id_group" INTEGER NOT NULL default 0; -ALTER TABLE "tnews" ADD COLUMN "modal" SMALLINT DEFAULT 0; -ALTER TABLE "tnews" ADD COLUMN "expire" SMALLINT DEFAULT 0; -ALTER TABLE "tnews" ADD COLUMN "expire_timestamp" TIMESTAMP without time zone default '1970-01-01 00:00:00'; - -/* 2014/05/31 */ --- --------------------------------------------------------------------- --- Table `tagente_estado` --- --------------------------------------------------------------------- -ALTER TABLE "tagente_estado" ADD COLUMN "ff_start_utimestamp" BIGINT default 0; - -/* 2014/06/24 */ --- --------------------------------------------------------------------- --- Table trecon_script --- --------------------------------------------------------------------- -DELETE FROM "trecon_script" WHERE "id_recon_script"=1; - -/* 2014/08/07 */ --- --------------------------------------------------------------------- --- Table `tagente_modulo` --- --------------------------------------------------------------------- -ALTER TABLE "tagente_modulo" MODIFY COLUMN "post_process" NUMERIC(18,15) default 0; - -/* 2014/08/18 */ --- --------------------------------------------------------------------- --- Table `talert_commands` --- --------------------------------------------------------------------- -INSERT INTO "talert_commands" ("name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES ('Integria IMS Ticket','Internal type','This alert create a ticket into your Integria IMS.',1,'[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Ticket description\"]','[\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\"]'); - --- --------------------------------------------------------------------- --- Table `talert_actions` --- --------------------------------------------------------------------- -INSERT INTO "talert_actions" ("name", "id_alert_command", "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9", "field10", "id_group", "action_threshold") VALUES ('Create a ticket in Integria IMS',13,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0); \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql new file mode 100644 index 0000000000..e69de29bb2