diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 4e37787851..dd197c7c3f 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ +2012-07-05 Sergio Martin + + * pandoradb.sql + pandoradb.postgreSQL.sql + pandoradb.oracle.sql + extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql + extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql + extras/pandoradb_migrate_v3.1_to_v3.2.sql + extras/pandoradb_migrate_v3.2_to_v4.0.sql + extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Added fields to + wizard access to modules, network components and users tables. + Remove all scripts + 2012-07-05 Sergio Martin * godmode/agentes/module_manager_editor_common.php: Fix diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql index da286668f6..196304ceae 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql @@ -267,3 +267,34 @@ PRIMARY KEY (`id_pass`) -- ----------------------------------------------------- UPDATE tconfig SET `value`='comparation' WHERE `token`= 'prominent_time' + +-- ----------------------------------------------------- +-- Table `tnetwork_component` +-- ----------------------------------------------------- + +ALTER TABLE tnetwork_component ADD `wizard_level` enum('basic','advanced','custom') default 'custom'; +ALTER TABLE tnetwork_component ADD `only_wizard` tinyint(1) unsigned default '0'; +ALTER TABLE tnetwork_component ADD `field1_desc` text; +ALTER TABLE tnetwork_component ADD `field1_help` text; +ALTER TABLE tnetwork_component ADD `field2_desc` text; +ALTER TABLE tnetwork_component ADD `field2_help` text; +ALTER TABLE tnetwork_component ADD `field3_desc` text; +ALTER TABLE tnetwork_component ADD `field3_help` text; +ALTER TABLE tnetwork_component ADD `field4_desc` text; +ALTER TABLE tnetwork_component ADD `field4_help` text; +ALTER TABLE tnetwork_component ADD `field5_desc` text; +ALTER TABLE tnetwork_component ADD `field5_help` text; +ALTER TABLE tnetwork_component ADD `field6_desc` text; +ALTER TABLE tnetwork_component ADD `field6_help` text; + +-- ----------------------------------------------------- +-- Table `tagente_modulo` +-- ----------------------------------------------------- + +ALTER TABLE tagente_modulo ADD `wizard_level` enum('basic','advanced','custom') default 'custom'; + +-- ----------------------------------------------------- +-- Table `tusuario` +-- ----------------------------------------------------- + +ALTER TABLE tusuario ADD `wizard_access` enum('basic','advanced','custom','all','only_console') default 'only_console'; diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql index a1754d1071..d245787ddc 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql @@ -269,3 +269,38 @@ CREATE SEQUENCE tpassword_history_s INCREMENT BY 1 START WITH 1; -- ----------------------------------------------------- UPDATE tconfig SET value='comparation' WHERE token='prominent_time' + +-- ----------------------------------------------------- +-- Table `tnetwork_component` +-- ----------------------------------------------------- + +ALTER TABLE tnetwork_component ADD (wizard_level VARCHAR2(100) default 'custom' NOT NULL); +ALTER TABLE tnetwork_component ADD CONSTRAINT t_network_component_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom')); +ALTER TABLE tnetwork_component ADD (only_wizard NUMBER(5, 0) default 0 NOT NULL); +ALTER TABLE tnetwork_component ADD (field1_desc CLOB default ''); +ALTER TABLE tnetwork_component ADD (field1_help CLOB default ''); +ALTER TABLE tnetwork_component ADD (field2_desc CLOB default ''); +ALTER TABLE tnetwork_component ADD (field2_help CLOB default ''); +ALTER TABLE tnetwork_component ADD (field3_desc CLOB default ''); +ALTER TABLE tnetwork_component ADD (field3_help CLOB default ''); +ALTER TABLE tnetwork_component ADD (field4_desc CLOB default ''); +ALTER TABLE tnetwork_component ADD (field4_help CLOB default ''); +ALTER TABLE tnetwork_component ADD (field5_desc CLOB default ''); +ALTER TABLE tnetwork_component ADD (field5_help CLOB default ''); +ALTER TABLE tnetwork_component ADD (field6_desc CLOB default ''); +ALTER TABLE tnetwork_component ADD (field6_help CLOB default ''); + +-- ----------------------------------------------------- +-- Table `tagente_modulo` +-- ----------------------------------------------------- + +ALTER TABLE tagente_modulo ADD (wizard_level VARCHAR2(100) default 'custom' NOT NULL); +ALTER TABLE tagente_modulo ADD CONSTRAINT t_agente_modulo_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom')); + +-- ----------------------------------------------------- +-- Table `tusuario` +-- ----------------------------------------------------- + +ALTER TABLE tusuario ADD (wizard_access VARCHAR2(100) default 'only_console' NOT NULL); +ALTER TABLE tusuario ADD CONSTRAINT t_usuario_wizard_access_cons CHECK (wizard_access IN ('basic','advanced','custom','all','only_console')); + diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql index 8b7085c86b..4647049171 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql @@ -258,3 +258,37 @@ CREATE TABLE IF NOT EXISTS "tpassword_history" ( -- ----------------------------------------------------- UPDATE TABLE tconfig SET "value"='comparation' WHERE "token"='prominent_time' + +-- ----------------------------------------------------- +-- Table `tnetwork_component` +-- ----------------------------------------------------- + +CREATE TYPE type_tnetwork_component_wizard_level AS ENUM ('basic','advanced','custom'); +ALTER TABLE "tnetwork_component" ADD COLUMN "wizard_level" type_tnetwork_component_wizard_level default 'custom'; +ALTER TABLE "tnetwork_component" ADD COLUMN "only_wizard" INTEGER default '0'; +ALTER TABLE "tnetwork_component" ADD COLUMN "field1_desc" TEXT default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "field1_help" TEXT default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "field2_desc" TEXT default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "field2_help" TEXT default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "field3_desc" TEXT default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "field3_help" TEXT default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "field4_desc" TEXT default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "field4_help" TEXT default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "field5_desc" TEXT default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "field5_help" TEXT default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "field6_desc" TEXT default ''; +ALTER TABLE "tnetwork_component" ADD COLUMN "field6_help" TEXT default ''; + +-- ----------------------------------------------------- +-- Table `tagente_modulo` +-- ----------------------------------------------------- + +CREATE TYPE type_tagente_modulo_wizard_level AS ENUM ('basic','advanced','custom'); +ALTER TABLE "tagente_modulo" ADD COLUMN "wizard_level" type_tagente_modulo_wizard_level default 'custom'; + +-- ----------------------------------------------------- +-- Table `tusuario` +-- ----------------------------------------------------- + +CREATE TYPE type_tusuario_wizard_access AS ENUM ('basic','advanced','custom','all','only_console'); +ALTER TABLE "tusuario" ADD COLUMN "wizard_access" type_tusuario_wizard_access default 'only_console'; diff --git a/pandora_console/extras/pandoradb_migrate_v3.1_to_v3.2.sql b/pandora_console/extras/pandoradb_migrate_v3.1_to_v3.2.sql deleted file mode 100644 index faec3449b9..0000000000 --- a/pandora_console/extras/pandoradb_migrate_v3.1_to_v3.2.sql +++ /dev/null @@ -1,222 +0,0 @@ --- Pandora FMS - the Flexible Monitoring System --- ============================================ --- Copyright (c) 2010 Artica Soluciones Tecnológicas, http://www.artica.es --- Please see http://pandora.sourceforge.net for full contribution list - --- This program is free software; you can redistribute it and/or --- modify it under the terms of the GNU General Public License --- as published by the Free Software Foundation for version 2. --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - --- PLEASE NO NOT USE MULTILINE COMMENTS --- Because Pandora Installer don't understand them --- and fails creating database !!! - --- ----------------------------------------------------- --- Table `tagente` --- ----------------------------------------------------- -ALTER TABLE `tagente` MODIFY `nombre` varchar(600) BINARY NOT NULL default ''; - --- ----------------------------------------------------- --- Table `tgrupo` --- ----------------------------------------------------- -ALTER TABLE `tgrupo` ADD COLUMN `propagate` tinyint(1) unsigned NOT NULL default '0'; - --- ----------------------------------------------------- --- Table `treport_content` --- ----------------------------------------------------- -ALTER TABLE `treport_content` ADD COLUMN `time_from` time default '00:00:00'; -ALTER TABLE `treport_content` ADD COLUMN `time_to` time default '00:00:00'; -ALTER TABLE `treport_content` ADD COLUMN `monday` tinyint(1) default 1; -ALTER TABLE `treport_content` ADD COLUMN `tuesday` tinyint(1) default 1; -ALTER TABLE `treport_content` ADD COLUMN `wednesday` tinyint(1) default 1; -ALTER TABLE `treport_content` ADD COLUMN `thursday` tinyint(1) default 1; -ALTER TABLE `treport_content` ADD COLUMN `friday` tinyint(1) default 1; -ALTER TABLE `treport_content` ADD COLUMN `saturday` tinyint(1) default 1; -ALTER TABLE `treport_content` ADD COLUMN `sunday` tinyint(1) default 1; -ALTER TABLE `treport_content` MODIFY external_source TEXT default NULL; - --- ----------------------------------------------------- --- Table `tnetwork_map` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `tnetwork_map` ( - `id_networkmap` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `id_user` VARCHAR(60) NOT NULL, - `name` VARCHAR(100) NOT NULL, - `type` VARCHAR(20) NOT NULL, - `layout` VARCHAR(20) NOT NULL, - `nooverlap` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - `simple` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - `regenerate` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, - `font_size` INT UNSIGNED NOT NULL DEFAULT 12, - `id_group` INT NOT NULL DEFAULT 0, - `id_module_group` INT NOT NULL DEFAULT 0, - `id_policy` INT NOT NULL DEFAULT 0, - `depth` VARCHAR(20) NOT NULL, - `only_modules_with_alerts` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - `hide_policy_modules` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - `zoom` FLOAT UNSIGNED NOT NULL DEFAULT 1, - `distance_nodes` FLOAT UNSIGNED NOT NULL DEFAULT 2.5, - `center` INT UNSIGNED NOT NULL DEFAULT 0, - `contracted_nodes` TEXT, - PRIMARY KEY (`id_networkmap`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ----------------------------------------------------- --- Table `tagente_modulo` --- ----------------------------------------------------- - -ALTER TABLE `tagente_modulo` ADD COLUMN `id_policy_module` INTEGER UNSIGNED NOT NULL DEFAULT 0 AFTER `nombre`; -ALTER TABLE `tagente_modulo` ADD COLUMN `policy_linked` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `delete_pending`; -ALTER TABLE `tagente_modulo` ADD COLUMN `policy_adopted` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0; - --- ----------------------------------------------------- --- Table `talert_template_modules` --- ----------------------------------------------------- -ALTER TABLE `talert_template_modules` ADD COLUMN `id_policy_alerts` int(10) unsigned NOT NULL default '0'; -ALTER TABLE `talert_template_modules` ADD COLUMN `standby` tinyint(1) default '0'; - --- ----------------------------------------------------- --- Table `tsnmp_filter` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `tsnmp_filter` ( - `id_snmp_filter` int(10) unsigned NOT NULL auto_increment, - `description` varchar(255) default '', - `filter` varchar(255) default '', - PRIMARY KEY (`id_snmp_filter`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ----------------------------------------------------- --- Table `talert_templates` --- ----------------------------------------------------- -ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown'); - -ALTER TABLE trecon_task ADD `snmp_community` varchar(64) NOT NULL default 'public'; - -ALTER TABLE ttrap MODIFY value_custom text default ''; -ALTER TABLE ttrap MODIFY value text default ''; --- ----------------------------------------------------- --- Table `tagent_custom_fields` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `tagent_custom_fields` ( - `id_field` int(10) unsigned NOT NULL auto_increment, - `name` varchar(45) NOT NULL default '', - `display_on_front` tinyint(1) NOT NULL default 0, - PRIMARY KEY (`id_field`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ----------------------------------------------------- --- Table `tagent_custom_data` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `tagent_custom_data` ( - `id_field` int(10) unsigned NOT NULL, - `id_agent` int(10) unsigned NOT NULL, - `description` text default '', - FOREIGN KEY (`id_field`) REFERENCES tagent_custom_fields(`id_field`) - ON UPDATE CASCADE ON DELETE CASCADE, - FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`) - ON UPDATE CASCADE ON DELETE CASCADE, - PRIMARY KEY (`id_field`, `id_agent`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ----------------------------------------------------- --- Table `tagent_custom_data` --- ----------------------------------------------------- - -ALTER TABLE `tevento` MODIFY COLUMN `user_comment` TEXT NOT NULL; - - - - --- ----------------------------------------------------------------------- --- Data insertion -- --- ----------------------------------------------------------------------- - --- ----------------------------------------------------- --- Table `tconfig` --- ----------------------------------------------------- -INSERT INTO tconfig (`token`, `value`) VALUES ('sound_alert', 'include/sounds/air_shock_alarm.wav'); -INSERT INTO tconfig (`token`, `value`) VALUES ('sound_critical', 'include/sounds/Star_Trek_emergency_simulation.wav'); -INSERT INTO tconfig (`token`, `value`) VALUES ('sound_warning', 'include/sounds/negativebeep.wav'); -UPDATE tconfig SET value='3.2RC1' WHERE token = 'db_scheme_version'; -UPDATE tconfig SET value='PD101103' WHERE token = 'db_scheme_build'; - --- ----------------------------------------------------- --- Table `trecon_script` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `trecon_script` ( - `id_recon_script` int(10) NOT NULL auto_increment, - `name` varchar(100) default '', - `description` TEXT default NULL, - `script` varchar(250) default '', - PRIMARY KEY (`id_recon_script`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ----------------------------------------------------- --- Table `trecon_task` --- ----------------------------------------------------- -ALTER TABLE trecon_task ADD COLUMN `id_recon_script` int(10); -ALTER TABLE trecon_task ADD COLUMN `field1` varchar(250) NOT NULL default ''; -ALTER TABLE trecon_task ADD COLUMN `field2` varchar(250) NOT NULL default ''; -ALTER TABLE trecon_task ADD COLUMN `field3` varchar(250) NOT NULL default ''; -ALTER TABLE trecon_task ADD COLUMN `field4` varchar(250) NOT NULL default ''; - -ALTER TABLE tagente_modulo MODIFY `descripcion` TEXT NOT NULL default ''; -ALTER TABLE tagente_modulo MODIFY `tcp_send` TEXT default ''; -ALTER TABLE tagente_modulo MODIFY `tcp_rcv` TEXT default ''; - - --- ----------------------------------------------------- --- Table `tnews` --- ----------------------------------------------------- - -UPDATE tnews SET subject='Welcome to Pandora FMS 3.2!',text='This is the new Pandora FMS Console. A lot of new features have been added since last version. Please read the documentation about it, and feel free to test any option.\r\n\r\nThe Pandora FMS Team.',timestamp=NOW() WHERE id_news = '1'; - --- Bigger fields due the HTML encoding - -alter table talert_templates modify field1 text; -alter table talert_templates modify field2 text; -alter table talert_templates modify field3 text; -alter table talert_templates modify name text; - -alter table talert_templates modify field2_recovery text; -alter table talert_templates modify field3_recovery text; - -alter table talert_actions modify field1 text; -alter table talert_actions modify field2 text; -alter table talert_actions modify field3 text; -alter table talert_actions modify name text; - -alter table tagente_estado modify datos text; -alter table tagente_modulo modify nombre text; -alter table tagente_modulo modify plugin_user text; -alter table tagente_modulo modify plugin_pass text; - -alter table talert_snmp modify al_field1 text; -alter table talert_snmp modify al_field2 text; -alter table talert_snmp modify al_field3 text; - -alter table tevento modify evento text; - -alter table tincidencia modify titulo text; -alter table tincidencia modify descripcion text; - -alter table tnetwork_component modify tcp_send text; -alter table tnetwork_component modify tcp_rcv text; -alter table tnetwork_component modify plugin_user text; -alter table tnetwork_component modify plugin_pass text; - -alter table tsesion modify descripcion text; -alter table ttrap modify oid text; -alter table ttrap modify oid_custom text; - diff --git a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql deleted file mode 100644 index 8e57bba7e2..0000000000 --- a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql +++ /dev/null @@ -1,273 +0,0 @@ --- Pandora FMS - the Flexible Monitoring System --- ============================================ --- Copyright (c) 2011 Artica Soluciones Tecnológicas, http://www.artica.es --- Please see http://pandora.sourceforge.net for full contribution list - --- This program is free software; you can redistribute it and/or --- modify it under the terms of the GNU General Public License --- as published by the Free Software Foundation for version 2. --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - --- PLEASE NO NOT USE MULTILINE COMMENTS --- Because Pandora Installer don't understand them --- and fails creating database !!! - --- ----------------------------------------------------- --- Table `tgrupo` --- ----------------------------------------------------- -ALTER TABLE `tgrupo` MODIFY `nombre` text; -ALTER TABLE `tgrupo` ADD COLUMN `id_skin` int(10) unsigned NOT NULL; - --- ----------------------------------------------------- --- Table `tnetwork_component` --- ----------------------------------------------------- -ALTER TABLE `tnetwork_component` ADD COLUMN `post_process` double(18,13) DEFAULT 0; -ALTER TABLE `tnetwork_component` ADD COLUMN `str_warning` text DEFAULT ''; -ALTER TABLE `tnetwork_component` ADD COLUMN `str_critical` text DEFAULT ''; - --- ----------------------------------------------------- --- Table `treport_content` --- ----------------------------------------------------- -ALTER TABLE `treport_content` ADD COLUMN `only_display_wrong` tinyint(1) unsigned NOT NULL DEFAULT 0; -ALTER TABLE `treport_content` ADD COLUMN `top_n` INT NOT NULL DEFAULT 0; -ALTER TABLE `treport_content` ADD COLUMN `top_n_value` INT NOT NULL DEFAULT 10; -ALTER TABLE `treport_content` ADD COLUMN `exception_condition` INT NOT NULL DEFAULT 0; -ALTER TABLE `treport_content` ADD COLUMN `exception_condition_value` DOUBLE (18,6) NOT NULL DEFAULT 0; -ALTER TABLE `treport_content` ADD COLUMN `show_resume` INT NOT NULL DEFAULT 0; -ALTER TABLE `treport_content` ADD COLUMN `order_uptodown` INT NOT NULL DEFAULT 0; -ALTER TABLE `treport_content` ADD COLUMN `show_graph` INT NOT NULL DEFAULT 0; -ALTER TABLE `treport_content` ADD COLUMN `group_by_agent` INT NOT NULL DEFAULT 0; -ALTER TABLE `treport_content` ADD COLUMN `id_group` int (10) unsigned NOT NULL DEFAULT 0; -ALTER TABLE `treport_content` ADD COLUMN `id_module_group` int (10) unsigned NOT NULL DEFAULT 0; -ALTER TABLE `treport_content` ADD COLUMN `style` TEXT NOT NULL DEFAULT ''; -ALTER TABLE `treport_content` ADD COLUMN `server_name` TEXT DEFAULT ''; - --- ----------------------------------------------------- --- Table `treport_content_item` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `treport_content_item` ( - `id` INTEGER UNSIGNED NOT NULL auto_increment, - `id_report_content` INTEGER UNSIGNED NOT NULL, - `id_agent_module` int(10) unsigned NOT NULL, - `server_name` TEXT DEFAULT '', - PRIMARY KEY(`id`) -) ENGINE = InnoDB DEFAULT CHARSET=utf8; - --- ----------------------------------------------------- --- Table `tusuario` --- ----------------------------------------------------- -ALTER TABLE `tusuario` ADD COLUMN `block_size` int(4) NOT NULL DEFAULT 20; -ALTER TABLE `tusuario` ADD COLUMN `flash_chart` int(4) NOT NULL DEFAULT 1; -ALTER TABLE `tusuario` ADD COLUMN `id_skin` int(10) unsigned NOT NULL; -UPDATE `tusuario` SET `language` = "default" WHERE `language` IS NULL; - --- ----------------------------------------------------- --- Table `talert_actions` --- ----------------------------------------------------- -ALTER TABLE `talert_actions` ADD COLUMN `action_threshold` int(10) NOT NULL DEFAULT '0'; - --- ----------------------------------------------------- --- Table `talert_template_module_actions` --- ----------------------------------------------------- -ALTER TABLE `talert_template_module_actions` ADD COLUMN `module_action_threshold` int(10) NOT NULL DEFAULT '0'; -ALTER TABLE `talert_template_module_actions` ADD COLUMN `last_execution` bigint(20) NOT NULL DEFAULT '0'; - --- ----------------------------------------------------- --- Table `treport_content_sla_combined` --- ----------------------------------------------------- -ALTER TABLE `treport_content_sla_combined` ADD COLUMN `server_name` TEXT DEFAULT ''; -ALTER TABLE `treport_content_sla_combined` DROP FOREIGN KEY treport_content_sla_combined_ibfk_2; - --- ----------------------------------------------------- --- Table `tperfil` --- ----------------------------------------------------- -ALTER TABLE `tperfil` MODIFY `name` TEXT NOT NULL DEFAULT ''; - --- ----------------------------------------------------- --- Table `tsesion` --- ----------------------------------------------------- - -ALTER TABLE `tsesion` CHANGE `ID_sesion` `id_sesion` bigint(20) unsigned NOT NULL auto_increment; -ALTER TABLE `tsesion` CHANGE `ID_usuario` `id_usuario` varchar(60) NOT NULL default '0'; -ALTER TABLE `tsesion` CHANGE `IP_origen` `ip_origen` varchar(100) NOT NULL default ''; - --- ----------------------------------------------------- --- Table `tusuario_perfil` --- ----------------------------------------------------- - -ALTER TABLE tusuario_perfil ADD `id_policy` int(10) unsigned NOT NULL default 0; - --- ----------------------------------------------------- --- Table `tevento` --- ----------------------------------------------------- - -ALTER TABLE `tevento` MODIFY `event_type` enum('unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal', 'configuration_change') default 'unknown'; -ALTER TABLE tevento ADD INDEX criticity (`criticity`); -ALTER TABLE tevento ADD INDEX estado (`estado`); - --- ----------------------------------------------------- --- Change the value "0000-00-00 00:00:00" that Pandora use as zero or null date value --- for the value "01-01-1970 00:00:00". --- ----------------------------------------------------- -UPDATE `tagente` SET `ultimo_contacto` = "01-01-1970 00:00:00" WHERE `ultimo_contacto` = "0000-00-00 00:00:00"; -UPDATE `tagente` SET `ultimo_contacto_remoto` = "01-01-1970 00:00:00" WHERE `ultimo_contacto_remoto` = "0000-00-00 00:00:00"; -UPDATE `tagente_estado` SET `timestamp` = "01-01-1970 00:00:00" WHERE `timestamp` = "0000-00-00 00:00:00"; -UPDATE `tagente_estado` SET `last_try` = "01-01-1970 00:00:00" WHERE `last_try` = "0000-00-00 00:00:00"; -UPDATE `talert_snmp` SET `last_fired` = "01-01-1970 00:00:00" WHERE `last_fired` = "0000-00-00 00:00:00"; -UPDATE `tevento` SET `timestamp` = "01-01-1970 00:00:00" WHERE `timestamp` = "0000-00-00 00:00:00"; -UPDATE `tincidencia` SET `inicio` = "01-01-1970 00:00:00" WHERE `inicio` = "0000-00-00 00:00:00"; -UPDATE `tincidencia` SET `cierre` = "01-01-1970 00:00:00" WHERE `cierre` = "0000-00-00 00:00:00"; -UPDATE `tserver` SET `laststart` = "01-01-1970 00:00:00" WHERE `laststart` = "0000-00-00 00:00:00"; -UPDATE `tserver` SET `keepalive` = "01-01-1970 00:00:00" WHERE `keepalive` = "0000-00-00 00:00:00"; -UPDATE `ttrap` SET `timestamp` = "01-01-1970 00:00:00" WHERE `timestamp` = "0000-00-00 00:00:00"; -UPDATE `tnews` SET `timestamp` = "01-01-1970 00:00:00" WHERE `timestamp` = "0000-00-00 00:00:00"; -UPDATE `tserver_export_data` SET `timestamp` = "01-01-1970 00:00:00" WHERE `timestamp` = "0000-00-00 00:00:00"; - --- ----------------------------------------------------- --- Table `ttag` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `ttag` ( - `id_tag` integer(10) unsigned NOT NULL auto_increment, - `name` varchar(100) NOT NULL default '', - `description` text NOT NULL default '', - `url` mediumtext NOT NULL default '', - PRIMARY KEY (`id_tag`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ----------------------------------------------------- --- Table `ttag_module` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `ttag_module` ( - `id_tag` int(10) NOT NULL, - `id_agente_modulo` int(10) NOT NULL DEFAULT 0, - PRIMARY KEY (id_tag, id_agente_modulo), - KEY `idx_id_agente_modulo` (`id_agente_modulo`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ----------------------------------------------------- --- Table `ttag_policy_module` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `ttag_policy_module` ( - `id_tag` int(10) NOT NULL, - `id_policy_module` int(10) NOT NULL DEFAULT 0, - PRIMARY KEY (id_tag, id_policy_module), - KEY `idx_id_policy_module` (`id_policy_module`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ----------------------------------------------------- --- Table `ttag_event` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `ttag_event` ( - `id_tag` int(10) NOT NULL, - `id_evento` bigint(20) NOT NULL DEFAULT 0, - PRIMARY KEY (id_tag, id_evento), - KEY `idx_id_evento` (`id_evento`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ----------------------------------------------------- --- Table `tagente_modulo` --- ----------------------------------------------------- - -ALTER TABLE `tagente_modulo` ADD COLUMN (`unit` text DEFAULT ''); -ALTER TABLE `tagente_modulo` ADD COLUMN (`str_warning` text DEFAULT ''); -ALTER TABLE `tagente_modulo` ADD COLUMN (`str_critical` text DEFAULT ''); -ALTER TABLE `tagente_modulo` ADD COLUMN (`extended_info` text DEFAULT ''); -ALTER TABLE `tagente_modulo` ADD INDEX module (`id_modulo`); -ALTER TABLE `tagente_modulo` ADD INDEX nombre (`nombre` (255)); -CREATE INDEX `module_group` using btree on tagente_modulo (`id_module_group`); - --- ----------------------------------------------------- --- Table `tevento` --- ----------------------------------------------------- - -ALTER TABLE `tevento` ADD COLUMN (`tags` text NOT NULL); - --- ----------------------------------------------------- --- Table `tnetwork_map` --- ----------------------------------------------------- - -ALTER TABLE `tnetwork_map` ADD COLUMN `show_snmp_modules` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0; - --- ----------------------------------------------------- --- Table `trecon_task` --- ----------------------------------------------------- - -ALTER TABLE `trecon_task` ADD COLUMN `disabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0; -ALTER TABLE `trecon_task` ADD COLUMN `os_detect` tinyint(1) unsigned default '0'; -ALTER TABLE `trecon_task` ADD COLUMN `resolve_names` tinyint(1) unsigned default '0'; -ALTER TABLE `trecon_task` ADD COLUMN `parent_detection` tinyint(1) unsigned default '0'; -ALTER TABLE `trecon_task` ADD COLUMN `parent_recursion` tinyint(1) unsigned default '0'; - --- ----------------------------------------------------- --- Table `tplanned_downtime` --- ----------------------------------------------------- - -ALTER TABLE `tplanned_downtime` ADD COLUMN `only_alerts` TINYINT(1) NOT NULL DEFAULT 0; - --- ----------------------------------------------------- --- Table `talert_templates` --- ----------------------------------------------------- - -ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown', 'always') DEFAULT NULL; - --- ----------------------------------------------------- --- Table `tagente_modulo` to adapt the fields use to new prediction types and future modifications --- ----------------------------------------------------- - -UPDATE tagente_modulo SET prediction_module = 2 WHERE custom_integer_1 <> 0 AND prediction_module <> 0; - -UPDATE tagente_modulo SET custom_integer_1 = prediction_module AND prediction_module = 1 WHERE custom_integer_1 = 0 AND prediction_module <> 0; - --- ----------------------------------------------------- --- Table `tagente_modulo` to set delete_pending name to the delete pending modules to clean possible database errors --- ----------------------------------------------------- - -UPDATE tagente_modulo SET nombre = 'delete_pending' WHERE delete_pending = 1; - --- ----------------------------------------------------- --- Table `talert_template_modules` --- ----------------------------------------------------- -ALTER TABLE talert_template_modules ADD INDEX force_execution (`force_execution`); - --- ----------------------------------------------------- --- Table `tserver_export_data` --- ----------------------------------------------------- -ALTER TABLE tserver_export ADD INDEX id_export_server (`id_export_server`); - --- ----------------------------------------------------- --- Table `ttrap` --- ----------------------------------------------------- -ALTER TABLE ttrap ADD INDEX timestamp (`timestamp`); -ALTER TABLE ttrap ADD INDEX status (`status`); - --- ----------------------------------------------------- --- Table `talert_snmp` --- ----------------------------------------------------- - -ALTER TABLE `talert_snmp` MODIFY COLUMN `custom_oid` text DEFAULT ''; - - --- ----------------------------------------------------- --- Table `tconfig_os` --- ----------------------------------------------------- -INSERT INTO `tconfig_os` (`name`, `description`, `icon_name`) VALUES ('VMware', 'VMware Architecture', 'so_vmware.png'); - -UPDATE tconfig SET value='4.0' WHERE token = 'db_scheme_version'; -UPDATE tconfig SET value='PD110923 (3.2 Migrate)' WHERE token = 'db_scheme_build'; - - --- ----------------------------------------------------- --- Encode empty space entities (Added 17th May 2012) --- ----------------------------------------------------- -UPDATE tnetwork_component SET name = REPLACE(name,' ',' '); -UPDATE tlocal_component SET name = REPLACE(name,' ',' '); diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index 382ef18d96..2a0f8471e0 100644 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -207,7 +207,9 @@ CREATE TABLE tagente_modulo ( custom_string_2 CLOB default '', custom_string_3 CLOB default '', custom_integer_1 NUMBER(10, 0) default 0, - custom_integer_2 NUMBER(10, 0) default 0 + custom_integer_2 NUMBER(10, 0) default 0, + wizard_level VARCHAR2(100) default 'custom' NOT NULL, + CONSTRAINT t_agente_modulo_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom')) ); CREATE INDEX tagente_modulo_id_agente_idx ON tagente_modulo(id_agente); CREATE INDEX tagente_modulo_id_t_mod_idx ON tagente_modulo(id_tipo_modulo); @@ -646,7 +648,22 @@ CREATE TABLE tnetwork_component ( custom_integer_1 INTEGER default 0, custom_integer_2 INTEGER default 0, post_process BINARY_DOUBLE default 0. - unit CLOB default '' + unit CLOB default '', + wizard_level VARCHAR2(100) default 'custom' NOT NULL, + only_wizard NUMBER(5, 0) default 0 NOT NULL, + field1_desc CLOB default '', + field1_help CLOB default '', + field2_desc CLOB default '', + field2_help CLOB default '', + field3_desc CLOB default '', + field3_help CLOB default '', + field4_desc CLOB default '', + field4_help CLOB default '', + field5_desc CLOB default '', + field5_help CLOB default '', + field6_desc CLOB default '', + field6_help CLOB default '', + CONSTRAINT t_network_component_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom')) ); CREATE SEQUENCE tnetwork_component_s INCREMENT BY 1 START WITH 1; @@ -878,7 +895,9 @@ CREATE TABLE tusuario ( last_pass_change TIMESTAMP default 0, last_failed_login TIMESTAMP default 0, failed_attempt NUMBER(5,0) default 0 NOT NULL, - login_blocked NUMBER(5,0) default 0 NOT NULL + login_blocked NUMBER(5,0) default 0 NOT NULL, + wizard_access VARCHAR2(100) default 'only_console' NOT NULL, + CONSTRAINT t_usuario_wizard_access_cons CHECK (wizard_access IN ('basic','advanced','custom','all','only_console')) ); CREATE TABLE tusuario_perfil ( diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index 4f01733c39..5ab470f323 100644 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -139,6 +139,7 @@ CREATE INDEX "tagente_estado_last_execution_try_idx" ON "tagente_estado"("last_e -- 6 - WMI server -- 7 - WEB Server (enteprise) +CREATE TYPE type_tagente_modulo_wizard_level AS ENUM ('basic','advanced','custom'); CREATE TABLE "tagente_modulo" ( "id_agente_modulo" SERIAL NOT NULL PRIMARY KEY, "id_agente" INTEGER NOT NULL default 0, @@ -186,7 +187,8 @@ CREATE TABLE "tagente_modulo" ( "custom_string_2" text default '', "custom_string_3" text default '', "custom_integer_1" INTEGER default 0, - "custom_integer_2" INTEGER default 0 + "custom_integer_2" INTEGER default 0, + "wizard_level" type_tagente_modulo_wizard_level default 'custom' ); CREATE INDEX "tagente_modulo_id_agente_idx" ON "tagente_modulo"("id_agente"); CREATE INDEX "tagente_modulo_id_tipo_modulo_idx" ON "tagente_modulo"("id_tipo_modulo"); @@ -478,6 +480,7 @@ CREATE TABLE "tmodule_group" ( "name" varchar(150) NOT NULL default '' ); +CREATE TYPE type_tlocal_component_wizard_level AS ENUM ('basic','advanced','custom'); CREATE TABLE "tnetwork_component" ( "id_nc" SERIAL NOT NULL PRIMARY KEY, "name" varchar(80) NOT NULL, @@ -513,7 +516,21 @@ CREATE TABLE "tnetwork_component" ( "custom_integer_1" INTEGER default 0, "custom_integer_2" INTEGER default 0, "post_process" DOUBLE PRECISION default 0, - "unit" text default '' + "unit" TEXT default '', + "wizard_level" type_tlocal_component_wizard_level default 'custom', + "only_wizard" INTEGER default '0', + "field1_desc" TEXT default '', + "field1_help" TEXT default '', + "field2_desc" TEXT default '', + "field2_help" TEXT default '', + "field3_desc" TEXT default '', + "field3_help" TEXT default '', + "field4_desc" TEXT default '', + "field4_help" TEXT default '', + "field5_desc" TEXT default '', + "field5_help" TEXT default '', + "field6_desc" TEXT default '', + "field6_help" TEXT default '' ); CREATE TABLE "tnetwork_component_group" ( @@ -681,6 +698,7 @@ CREATE TABLE "ttrap" ( "severity" INTEGER NOT NULL default 2 ); +CREATE TYPE type_tusuario_wizard_access AS ENUM ('basic','advanced','custom','all','only_console'); CREATE TABLE "tusuario" ( "id_user" varchar(60) NOT NULL PRIMARY KEY, "fullname" varchar(255) NOT NULL, @@ -708,7 +726,8 @@ CREATE TABLE "tusuario" ( "last_pass_change" BIGINT NOT NULL default 0, "last_failed_login" BIGINT NOT NULL default 0, "failed_attempt" INTEGER NOT NULL DEFAULT 0, - "login_blocked" SMALLINT NOT NULL default 0 + "login_blocked" SMALLINT NOT NULL default 0, + "wizard_access" type_tusuario_wizard_access default 'only_console' ); CREATE TABLE "tusuario_perfil" ( diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index ba5939d658..e8e19d8481 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -189,6 +189,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( `custom_string_3` text, `custom_integer_1` int(10) default 0, `custom_integer_2` int(10) default 0, + `wizard_level` enum('basic','advanced','custom') default 'custom', PRIMARY KEY (`id_agente_modulo`), KEY `main_idx` (`id_agente_modulo`,`id_agente`), KEY `tam_agente` (`id_agente`), @@ -568,6 +569,20 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `custom_integer_2` int(10) default 0, `post_process` double(18,5) default 0, `unit` text, + `wizard_level` enum('basic','advanced','custom') default 'custom', + `only_wizard` tinyint(1) unsigned default '0', + `field1_desc` text, + `field1_help` text, + `field2_desc` text, + `field2_help` text, + `field3_desc` text, + `field3_help` text, + `field4_desc` text, + `field4_help` text, + `field5_desc` text, + `field5_help` text, + `field6_desc` text, + `field6_help` text, PRIMARY KEY (`id_nc`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -784,6 +799,7 @@ CREATE TABLE IF NOT EXISTS `tusuario` ( `last_failed_login` DATETIME NOT NULL DEFAULT 0, `failed_attempt` int(4) NOT NULL DEFAULT 0, `login_blocked` tinyint(1) unsigned NOT NULL default 0, + `wizard_access` enum('basic','advanced','custom','all','only_console') default 'only_console', UNIQUE KEY `id_user` (`id_user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;