From 049c3c24761461c674c54055546c60e341991f37 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 28 Oct 2019 13:46:37 +0100 Subject: [PATCH 1/4] fix migrate missing content --- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 173 +++++++++++++++--- 1 file changed, 152 insertions(+), 21 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 6476e79e2b..c2becce397 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -60,6 +60,10 @@ ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_next` bigint(20) NOT NULL def ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; +ALTER TABLE `tlocal_component` MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0', + MODIFY COLUMN `dynamic_next` bigint(20) NOT NULL DEFAULT '0', + MODIFY COLUMN `dynamic_two_tailed` tinyint(1) unsigned NULL DEFAULT '0'; + -- ----------------------------------------------------- -- Table `tpolicy_modules` -- ----------------------------------------------------- @@ -138,6 +142,10 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0'; ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; +ALTER TABLE `tpolicy_modules` MODIFY COLUMN `ip_target` varchar(100) NULL DEFAULT '', + MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0', + MODIFY COLUMN `dynamic_next` bigint(20) NOT NULL DEFAULT '0', + MODIFY COLUMN `dynamic_two_tailed` tinyint(1) unsigned NULL DEFAULT '0'; -- --------------------------------------------------------------------- -- Table `tpolicies` @@ -187,6 +195,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_agents` ( ALTER TABLE `tpolicy_agents` ADD COLUMN `id_node` int(10) NOT NULL DEFAULT '0'; ALTER TABLE `tpolicy_agents` ADD UNIQUE(`id_policy`, `id_agent`, `id_node`); +ALTER TABLE `tpolicy_agents` DROP INDEX `id_policy`, ADD UNIQUE INDEX `id_policy` (`id_policy`, `id_agent`, `id_node`), DROP INDEX `id_policy_2`; -- ----------------------------------------------------- -- Table `tpolicy_groups` @@ -377,6 +386,12 @@ ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbhost` text; ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbport` text; ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbname` text; +ALTER TABLE `tmetaconsole_setup` MODIFY COLUMN `meta_dbuser` text NULL, + MODIFY COLUMN `meta_dbpass` text NULL, + MODIFY COLUMN `meta_dbhost` text NULL, + MODIFY COLUMN `meta_dbport` text NULL, + MODIFY COLUMN `meta_dbname` text NULL; + -- --------------------------------------------------------------------- -- Table `tprofile_view` -- --------------------------------------------------------------------- @@ -764,23 +779,6 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` ( PRIMARY KEY(`id_rc`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; --- ---------------------------------------------------------------------- --- Table `tnews` --- ---------------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `tnews` ( - `id_news` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `author` varchar(255) NOT NULL DEFAULT '', - `subject` varchar(255) NOT NULL DEFAULT '', - `text` TEXT NOT NULL, - `timestamp` DATETIME NOT NULL DEFAULT 0, - `id_group` int(10) NOT NULL default 0, - `modal` tinyint(1) DEFAULT 0, - `expire` tinyint(1) DEFAULT 0, - `expire_timestamp` DATETIME NOT NULL DEFAULT 0, - PRIMARY KEY(`id_news`) -) ENGINE = InnoDB DEFAULT CHARSET=utf8; - - ALTER TABLE treport_content_template ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0'; ALTER TABLE treport_content_template ADD COLUMN `lapse_calc` tinyint(1) default '0'; ALTER TABLE treport_content_template ADD COLUMN `lapse` int(11) default '300'; @@ -802,6 +800,26 @@ ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEF ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1'; ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1'; ALTER TABLE `treport_content_template` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0'; +ALTER TABLE `treport_content_template` MODIFY COLUMN `historical_db` tinyint(1) unsigned NOT NULL DEFAULT '0', + MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0', + MODIFY COLUMN `lapse` int(11) unsigned NOT NULL DEFAULT '300', + MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0'; + +-- ---------------------------------------------------------------------- +-- Table `tnews` +-- ---------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tnews` ( + `id_news` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `author` varchar(255) NOT NULL DEFAULT '', + `subject` varchar(255) NOT NULL DEFAULT '', + `text` TEXT NOT NULL, + `timestamp` DATETIME NOT NULL DEFAULT 0, + `id_group` int(10) NOT NULL default 0, + `modal` tinyint(1) DEFAULT 0, + `expire` tinyint(1) DEFAULT 0, + `expire_timestamp` DATETIME NOT NULL DEFAULT 0, + PRIMARY KEY(`id_news`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- -- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template) @@ -1048,6 +1066,14 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` ( FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `tmetaconsole_agent` ADD COLUMN `remote` tinyint(1) NOT NULL DEFAULT '0', + ADD COLUMN `cascade_protection_module` int(10) unsigned NULL DEFAULT '0', + ADD COLUMN `transactional_agent` tinyint(1) NOT NULL DEFAULT '0', + ADD COLUMN `alias` varchar(600) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + MODIFY COLUMN `update_secondary_groups` tinyint(1) NOT NULL DEFAULT '0', + MODIFY COLUMN `alias_as_name` tinyint(2) NOT NULL DEFAULT '0', + ADD INDEX `id_tagente_idx` (`id_tagente`); + -- --------------------------------------------------------------------- -- Table `ttransaction` -- --------------------------------------------------------------------- @@ -1103,6 +1129,8 @@ CREATE TABLE IF NOT EXISTS `titem` ( PRIMARY KEY(`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `titem` MODIFY COLUMN `source_data` varchar(250) NULL DEFAULT ''; + -- --------------------------------------------------------------------- -- Table `tmap` -- --------------------------------------------------------------------- @@ -1129,6 +1157,7 @@ CREATE TABLE IF NOT EXISTS `tmap` ( PRIMARY KEY(`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT ''; -- --------------------------------------------------------------------- -- Table `trel_item` @@ -1147,6 +1176,10 @@ CREATE TABLE IF NOT EXISTS `trel_item` ( PRIMARY KEY(`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `trel_item` MODIFY COLUMN `id_map` int(10) unsigned NOT NULL DEFAULT '0', + MODIFY COLUMN `id_parent_source_data` int(10) unsigned NOT NULL DEFAULT '0', + MODIFY COLUMN `id_child_source_data` int(10) unsigned NOT NULL DEFAULT '0'; + -- --------------------------------------------------------------------- -- Table `talert_templates` -- --------------------------------------------------------------------- @@ -1170,6 +1203,11 @@ ALTER TABLE talert_snmp ADD COLUMN `al_field12` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp ADD COLUMN `al_field13` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp ADD COLUMN `al_field14` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` MODIFY COLUMN `al_field11` text NOT NULL, + MODIFY COLUMN `al_field12` text NOT NULL, + MODIFY COLUMN `al_field13` text NOT NULL, + MODIFY COLUMN `al_field14` text NOT NULL, + MODIFY COLUMN `al_field15` text NOT NULL; -- --------------------------------------------------------------------- -- Table `talert_snmp_action` @@ -1184,6 +1222,7 @@ ALTER TABLE talert_snmp_action ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT ""; -- Table `tserver` -- ---------------------------------------------------------------------- ALTER TABLE tserver ADD COLUMN `server_keepalive` int(11) DEFAULT 0; +ALTER TABLE `tserver` MODIFY COLUMN `server_keepalive` int(11) NOT NULL DEFAULT '0'; -- ---------------------------------------------------------------------- -- Table `tagente_estado` @@ -1195,6 +1234,11 @@ ALTER TABLE tagente_estado ADD COLUMN last_unknown_update bigint(20) NOT NULL de ALTER TABLE `tagente_estado` ADD COLUMN `ff_normal` int(4) unsigned default '0'; ALTER TABLE `tagente_estado` ADD COLUMN `ff_warning` int(4) unsigned default '0'; ALTER TABLE `tagente_estado` ADD COLUMN `ff_critical` int(4) unsigned default '0'; +ALTER TABLE `tagente_estado` MODIFY COLUMN `datos` mediumtext NOT NULL, + MODIFY COLUMN `known_status` tinyint(4) NULL DEFAULT '0', + MODIFY COLUMN `last_known_status` tinyint(4) NULL DEFAULT '0', + MODIFY COLUMN `last_dynamic_update` bigint(20) NOT NULL DEFAULT '0', + MODIFY COLUMN `last_unknown_update` bigint(20) NOT NULL DEFAULT '0'; -- --------------------------------------------------------------------- -- Table `talert_actions` @@ -1218,6 +1262,11 @@ ALTER TABLE talert_actions ADD COLUMN `field12_recovery` TEXT NOT NULL DEFAULT " ALTER TABLE talert_actions ADD COLUMN `field13_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_actions ADD COLUMN `field14_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_actions` MODIFY COLUMN `field11` text NOT NULL, + MODIFY COLUMN `field12` text NOT NULL, + MODIFY COLUMN `field13` text NOT NULL, + MODIFY COLUMN `field14` text NOT NULL, + MODIFY COLUMN `field15` text NOT NULL; -- --------------------------------------------------------------------- -- Table `talert_commands` @@ -1231,6 +1280,8 @@ UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/ht DELETE FROM `talert_commands` WHERE `id` = 11; +ALTER TABLE `talert_commands` MODIFY COLUMN `id_group` mediumint(8) unsigned NULL DEFAULT '0'; + -- --------------------------------------------------------------------- -- Table `tmap` -- --------------------------------------------------------------------- @@ -1314,6 +1365,8 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL; ALTER TABLE tevent_filter ADD COLUMN `user_comment` text NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL; +ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL; + -- --------------------------------------------------------------------- -- Table `tusuario` -- --------------------------------------------------------------------- @@ -1328,7 +1381,11 @@ ALTER TABLE `tusuario` ADD COLUMN `default_custom_view` int(10) unsigned NULL de ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_user` VARCHAR(60); ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_pass` VARCHAR(45); ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_enabled` TINYINT(1); - +ALTER TABLE `tusuario` MODIFY COLUMN `default_event_filter` int(10) unsigned NOT NULL DEFAULT '0', + ADD INDEX `fk_filter_id` (`id_filter`), + ADD CONSTRAINT `fk_filter_id` FOREIGN KEY `fk_filter_id` (`id_filter`) REFERENCES `tevent_filter` (`id_filter`) ON DELETE SET NULL ON UPDATE RESTRICT, + DROP FOREIGN KEY `fk_id_filter`, + DROP INDEX `fk_id_filter`; -- --------------------------------------------------------------------- @@ -1342,11 +1399,23 @@ ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0 ALTER TABLE `tagente_modulo` ADD COLUMN `ff_normal` int(4) unsigned default '0'; ALTER TABLE `tagente_modulo` ADD COLUMN `ff_warning` int(4) unsigned default '0'; ALTER TABLE `tagente_modulo` ADD COLUMN `ff_critical` int(4) unsigned default '0'; +ALTER TABLE `tagente_modulo` DROP COLUMN `ff_normal`, + DROP COLUMN `ff_warning`, + DROP COLUMN `ff_critical`, + MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0', + MODIFY COLUMN `dynamic_next` bigint(20) NOT NULL DEFAULT '0', + MODIFY COLUMN `dynamic_two_tailed` tinyint(1) unsigned NULL DEFAULT '0'; -- --------------------------------------------------------------------- -- Table `tagente_datos` -- --------------------------------------------------------------------- ALTER TABLE tagente_datos MODIFY `datos` double(22,5); +ALTER TABLE `tagente_datos` DROP INDEX `data_index1`, ADD INDEX `data_index1` (`id_agente_modulo`, `utimestamp`); + +-- --------------------------------------------------------------------- +-- Table `tagente_datos_string` +-- --------------------------------------------------------------------- +ALTER TABLE `tagente_datos_string` MODIFY COLUMN `datos` mediumtext NOT NULL, DROP INDEX `data_string_index_1`, ADD INDEX `data_string_index_1` (`id_agente_modulo`, `utimestamp`); -- --------------------------------------------------------------------- -- Table `tagente_datos_inc` @@ -1362,6 +1431,7 @@ ALTER TABLE tnetwork_component ADD COLUMN `dynamic_min` int(4) default '0'; ALTER TABLE tnetwork_component ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0'; ALTER TABLE tnetwork_component ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; +ALTER TABLE `tnetwork_component` MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0'; -- --------------------------------------------------------------------- -- Table `tagente` @@ -1376,6 +1446,12 @@ ALTER TABLE `tagente` ADD COLUMN `cps` int NOT NULL default 0; UPDATE tagente SET tagente.alias = tagente.nombre; +ALTER TABLE `tagente` MODIFY COLUMN `remote` tinyint(1) NOT NULL DEFAULT '0', + MODIFY COLUMN `cascade_protection_module` int(10) unsigned NOT NULL DEFAULT '0', + MODIFY COLUMN `update_secondary_groups` tinyint(1) NOT NULL DEFAULT '0', + MODIFY COLUMN `alias` varchar(600) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + MODIFY COLUMN `alias_as_name` tinyint(2) NOT NULL DEFAULT '0'; + -- --------------------------------------------------------------------- -- Table `tservice` -- --------------------------------------------------------------------- @@ -1395,6 +1471,8 @@ ALTER TABLE tlayout MODIFY `name` varchar(600) NOT NULL; UPDATE tlayout SET is_favourite = 1 WHERE name REGEXP '^(' OR name REGEXP '^\\['; +ALTER TABLE `tlayout` MODIFY COLUMN `is_favourite` int(10) unsigned NOT NULL DEFAULT '0'; + -- --------------------------------------------------------------------- -- Table `tlayout_data` -- --------------------------------------------------------------------- @@ -1413,6 +1491,13 @@ ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_as_service_warning` ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0; ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_node_id` INT(10) NOT NULL default 0; ALTER TABLE `tlayout_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `tlayout_data` MODIFY COLUMN `type_graph` varchar(50) NOT NULL DEFAULT 'area', + MODIFY COLUMN `label_position` varchar(50) NOT NULL DEFAULT 'down', + MODIFY COLUMN `linked_layout_node_id` int(10) NOT NULL DEFAULT '0', + MODIFY COLUMN `linked_layout_status_type` enum('default','weight','service') NULL DEFAULT 'default', + MODIFY COLUMN `element_group` int(10) NOT NULL DEFAULT '0', + MODIFY COLUMN `linked_layout_status_as_service_warning` float(20,3) NOT NULL DEFAULT '0.000', + MODIFY COLUMN `linked_layout_status_as_service_critical` float(20,3) NOT NULL DEFAULT '0.000'; -- --------------------------------------------------------------------- -- Table `tagent_custom_fields` @@ -1434,6 +1519,7 @@ ALTER TABLE tgraph ADD COLUMN `summatory_series` tinyint(1) UNSIGNED NOT NULL de ALTER TABLE tgraph ADD COLUMN `average_series` tinyint(1) UNSIGNED NOT NULL default '0'; ALTER TABLE tgraph ADD COLUMN `modules_series` tinyint(1) UNSIGNED NOT NULL default '0'; ALTER TABLE tgraph ADD COLUMN `fullscale` tinyint(1) UNSIGNED NOT NULL default '0'; +ALTER TABLE `tgraph` MODIFY COLUMN `percentil` tinyint(1) unsigned NOT NULL DEFAULT '0'; -- --------------------------------------------------------------------- -- Table `tnetflow_filter` @@ -1479,12 +1565,19 @@ ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0'; ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0'; ALTER table `treport_content` MODIFY COLUMN `name` varchar(300) NULL; ALTER TABLE `treport_content` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0'; +ALTER TABLE `treport_content` MODIFY COLUMN `historical_db` tinyint(1) unsigned NOT NULL DEFAULT '0', + MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0', + MODIFY COLUMN `lapse` int(11) unsigned NOT NULL DEFAULT '300', + MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0', + MODIFY COLUMN `failover_mode` tinyint(1) NULL DEFAULT '1', + MODIFY COLUMN `failover_type` tinyint(1) NULL DEFAULT '1'; -- --------------------------------------------------------------------- -- Table `tmodule_relationship` -- --------------------------------------------------------------------- ALTER TABLE tmodule_relationship ADD COLUMN `id_server` varchar(100) NOT NULL DEFAULT ''; ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct'; +ALTER TABLE `tmodule_relationship` MODIFY COLUMN `id_server` varchar(100) NOT NULL DEFAULT ''; -- --------------------------------------------------------------------- -- Table `tpolicy_module` @@ -1515,6 +1608,14 @@ ALTER TABLE trecon_task ADD `wmi_enabled` tinyint(1) unsigned DEFAULT '0'; ALTER TABLE trecon_task ADD `auth_strings` text; ALTER TABLE trecon_task ADD `autoconfiguration_enabled` tinyint(1) unsigned default '0'; ALTER TABLE trecon_task ADD `summary` text; +ALTER TABLE `trecon_task` ADD COLUMN `type` int(11) NOT NULL DEFAULT '0', + MODIFY COLUMN `alias_as_name` tinyint(2) NOT NULL DEFAULT '0', + MODIFY COLUMN `snmp_enabled` tinyint(1) unsigned NULL DEFAULT '0', + MODIFY COLUMN `vlan_enabled` tinyint(1) unsigned NULL DEFAULT '0', + MODIFY COLUMN `wmi_enabled` tinyint(1) unsigned NULL DEFAULT '0', + MODIFY COLUMN `auth_strings` text NULL, + MODIFY COLUMN `autoconfiguration_enabled` tinyint(1) unsigned NULL DEFAULT '0', + MODIFY COLUMN `summary` text NULL; -- --------------------------------------------------------------------- -- Table `twidget` AND Table `twidget_dashboard` @@ -1627,12 +1728,14 @@ ALTER TABLE tserver_export MODIFY `name` varchar(600) BINARY NOT NULL default '' ALTER TABLE tgraph_source ADD COLUMN id_server int(11) UNSIGNED NOT NULL default 0; ALTER TABLE tgraph_source ADD COLUMN `field_order` int(10) NOT NULL default 0; +ALTER TABLE `tgraph_source` MODIFY COLUMN `id_server` int(11) NOT NULL DEFAULT '0', + MODIFY COLUMN `field_order` int(10) NULL DEFAULT '0'; -- --------------------------------------------------------------------- -- Table `tserver_export_data` -- --------------------------------------------------------------------- -ALTER TABLE tserver_export_data MODIFY `module_name` varchar(600) BINARY NOT NULL default ''; +ALTER TABLE tserver_export_data MODIFY `module_name` varchar(600) NOT NULL default ''; -- --------------------------------------------------------------------- -- Table `tserver` @@ -1911,6 +2014,11 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `tlayout_template_data` MODIFY COLUMN `linked_layout_node_id` int(10) NOT NULL DEFAULT '0', + MODIFY COLUMN `linked_layout_status_type` enum('default','weight','service') NULL DEFAULT 'default', + MODIFY COLUMN `linked_layout_status_as_service_warning` float(20,3) NOT NULL DEFAULT '0.000', + MODIFY COLUMN `linked_layout_status_as_service_critical` float(20,3) NOT NULL DEFAULT '0.000'; + -- --------------------------------------------------------------------- -- Table `tlog_graph_models` -- --------------------------------------------------------------------- @@ -1956,6 +2064,7 @@ INSERT INTO tlog_graph_models VALUES (7, 'Users login', ALTER TABLE `treport` ADD COLUMN `hidden` tinyint(1) NOT NULL DEFAULT 0; ALTER TABLE `treport` ADD COLUMN `orientation` varchar(25) NOT NULL default 'vertical'; +ALTER TABLE `treport` MODIFY COLUMN `hidden` tinyint(1) NULL DEFAULT '0' AFTER `non_interactive`; ALTER TABLE `trecon_task` ADD COLUMN `snmp_version` varchar(5) NOT NULL default '1'; ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_user` varchar(255) NOT NULL default ''; @@ -2092,7 +2201,8 @@ ALTER TABLE `tmensajes` ADD COLUMN `citicity` INT(10) UNSIGNED DEFAULT '0'; ALTER TABLE `tmensajes` ADD COLUMN `id_source` BIGINT(20) UNSIGNED NOT NULL; ALTER TABLE `tmensajes` ADD COLUMN `subtype` VARCHAR(255) DEFAULT ''; ALTER TABLE `tmensajes` ADD CONSTRAINT `tsource_fk` FOREIGN KEY (`id_source`) REFERENCES `tnotification_source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; - +ALTER TABLE `tmensajes` DROP COLUMN `id_usuario_destino`, + ADD UNIQUE INDEX `id_mensaje` (`id_mensaje`); -- ---------------------------------------------------------------------- -- Table `tnotification_user` @@ -2194,7 +2304,7 @@ ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT -- Add column in table `tnetflow_filter` -- ---------------------------------------------------------------------- ALTER TABLE `tnetflow_filter` DROP COLUMN `output`; - +ALTER TABLE `tnetflow_filter` MODIFY COLUMN `router_ip` text NOT NULL; -- ---------------------------------------------------------------------- -- Update table `tuser_task` @@ -2213,6 +2323,17 @@ INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal'); +ALTER TABLE `talert_templates` MODIFY COLUMN `field11` text NOT NULL, + MODIFY COLUMN `field12` text NOT NULL, + MODIFY COLUMN `field13` text NOT NULL, + MODIFY COLUMN `field14` text NOT NULL, + MODIFY COLUMN `field15` text NOT NULL, + MODIFY COLUMN `field11_recovery` text NOT NULL, + MODIFY COLUMN `field12_recovery` text NOT NULL, + MODIFY COLUMN `field13_recovery` text NOT NULL, + MODIFY COLUMN `field14_recovery` text NOT NULL, + MODIFY COLUMN `field15_recovery` text NOT NULL; + -- --------------------------------------------------------------------- -- Table `tvisual_console_items_cache` -- --------------------------------------------------------------------- @@ -2293,3 +2414,13 @@ CREATE TABLE `tdeployment_hosts` ( FOREIGN KEY (`target_agent_version_id`) REFERENCES `tagent_repository`(`id`) ON UPDATE CASCADE ON DELETE SET NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `trecon_script` +-- --------------------------------------------------------------------- +ALTER TABLE `trecon_script` ADD COLUMN `type` int(11) NOT NULL DEFAULT '0'; + +-- --------------------------------------------------------------------- +-- Table `tusuario_perfil` +-- --------------------------------------------------------------------- +ALTER TABLE `tusuario_perfil` MODIFY COLUMN `no_hierarchy` tinyint(1) NOT NULL DEFAULT '0'; \ No newline at end of file From 33b11af3c112a843a07425f8c5d0970428efbb49 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Wed, 20 Nov 2019 11:26:28 +0100 Subject: [PATCH 2/4] fix missing line in migrate --- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 36d19424c8..c5172fbc61 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1157,8 +1157,6 @@ CREATE TABLE IF NOT EXISTS `tmap` ( PRIMARY KEY(`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT ''; - -- --------------------------------------------------------------------- -- Table `trel_item` -- --------------------------------------------------------------------- @@ -1285,7 +1283,7 @@ ALTER TABLE `talert_commands` MODIFY COLUMN `id_group` mediumint(8) unsigned NUL -- --------------------------------------------------------------------- -- Table `tmap` -- --------------------------------------------------------------------- -ALTER TABLE tmap MODIFY `id_user` varchar(128); +ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT ''; -- --------------------------------------------------------------------- -- Table `titem` From 446d6c35079946e7bfd53cac423bbe2fa20a82e7 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 20 Nov 2019 12:35:55 +0100 Subject: [PATCH 3/4] Fix windows commands --- pandora_console/extras/mr/33.sql | 4 ++-- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 4 ++-- pandora_console/pandoradb_data.sql | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index e80a69e8d7..755ec5f9c4 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -8,8 +8,8 @@ INSERT INTO `ttipo_modulo` VALUES (36,'remote_cmd_string', 10, 'Remote execution, alphanumeric data', 'mod_remote_cmd_string.png'), (37,'remote_cmd_inc', 10, 'Remote execution, incremental data', 'mod_remote_cmd_inc.png'); -INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('N. total processes','Number of running processes in a Windows system.',11,34,0,0,300,0,'tasklist /NH | findstr /c /v ""','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Free space in C:','Free space available in C:',11,34,0,0,300,0,'powershell $obj=(Get-WmiObject -class "Win32_LogicalDisk" -namespace "root\CIMV2") ; $obj.FreeSpace * 100 /$obj.Size','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('N. total processes','Number of running processes in a Windows system.',11,34,0,0,300,0,'tasklist /NH | find /c /v ""','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Free space in C:','Free space available in C:',11,34,0,0,300,0,'powershell $obj=(Get-WmiObject -class "Win32_LogicalDisk" -namespace "root\CIMV2") ; $obj.FreeSpace[0] * 100 /$obj.Size[0]','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux uptime','System uptime',43,36,0,0,300,0,'uptime |sed s/us\.*$//g | sed s/,\.*$//g','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux processes','Running processes',43,34,0,0,300,0,'ps elf | wc -l','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux system load','Current load (5 min)',43,34,0,0,300,0,'uptime | awk '{print $(NF-1)}' | tr -d ','','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index acbc1a0d70..ac13e76c95 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -2301,8 +2301,8 @@ CREATE TABLE `tdeployment_hosts` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Extra tnetwork_component -INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('N. total processes','Number of running processes in a Windows system.',11,34,0,0,300,0,'tasklist /NH | findstr /c /v ""','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Free space in C:','Free space available in C:',11,34,0,0,300,0,'powershell $obj=(Get-WmiObject -class "Win32_LogicalDisk" -namespace "root\CIMV2") ; $obj.FreeSpace * 100 /$obj.Size','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('N. total processes','Number of running processes in a Windows system.',11,34,0,0,300,0,'tasklist /NH | find /c /v ""','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Free space in C:','Free space available in C:',11,34,0,0,300,0,'powershell $obj=(Get-WmiObject -class "Win32_LogicalDisk" -namespace "root\CIMV2") ; $obj.FreeSpace[0] * 100 /$obj.Size[0]','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux uptime','System uptime',43,36,0,0,300,0,'uptime |sed s/us\.*$//g | sed s/,\.*$//g','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux processes','Running processes',43,34,0,0,300,0,'ps elf | wc -l','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux system load','Current load (5 min)',43,34,0,0,300,0,'uptime | awk '{print $(NF-1)}' | tr -d ','','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 432522e4ac..a041f4afab 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -986,8 +986,8 @@ INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `t INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (783,'Check Informix Port','',19,9,0,0,300,1526,'','','public','',2,2,0,'','','',0,1,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (784,'Check port DB2','',49,9,0,0,300,50000,'','','public','',2,2,0,'','','',0,1,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`) VALUES (785,'Packet Loss','Measure packet loss in the network, using a flood ping (50 ping in 8 secons) and counting back missing packets. It should be zero on most cases. ',10,1,0,0,300,0,'','','','',2,4,9,'','','',0,0,1,10.00,0.00,'',30.00,0.00,'',0,'','','',0,0,0.00000,'%','nowizard','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Test time\",\"help\":\"\",\"value\":\"8\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Target IP\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"}}','You should check manually the packet loss of the network with a flood ping on targeted host (ping -c 100 -f xxxx). Aditionally, and due the major packet loss, probably you can see a simple ping failing here. Check your network equipment.','You should check manually the packet loss of the network with a flood ping on targeted host (ping -c 100 -f xxxx)','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0); -INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES (786,'N. total processes','Number of running processes in a Windows system.',11,34,0,0,300,0,'tasklist /NH | findstr /c /v ""','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES (787,'Free space in C:','Free space available in C:',11,34,0,0,300,0,'powershell $obj=(Get-WmiObject -class "Win32_LogicalDisk" -namespace "root\CIMV2") ; $obj.FreeSpace * 100 /$obj.Size','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES (786,'N. total processes','Number of running processes in a Windows system.',11,34,0,0,300,0,'tasklist /NH | find /c /v ""','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES (787,'Free space in C:','Free space available in C:',11,34,0,0,300,0,'powershell $obj=(Get-WmiObject -class "Win32_LogicalDisk" -namespace "root\CIMV2") ; $obj.FreeSpace[0] * 100 /$obj.Size[0]','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES (788,'Linux uptime','System uptime',43,36,0,0,300,0,'uptime |sed s/us\.*$//g | sed s/,\.*$//g','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES (789,'Linux processes','Running processes',43,34,0,0,300,0,'ps elf | wc -l','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES (790,'Linux system load','Current load (5 min)',43,34,0,0,300,0,'uptime | awk '{print $(NF-1)}' | tr -d ','','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); From 4d332f2bef17fdc6e3c6713405419489ae1deaaa Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Wed, 20 Nov 2019 12:43:08 +0100 Subject: [PATCH 4/4] fix duplicated operation in migrate file --- .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index c5172fbc61..e58102dd51 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1285,11 +1285,6 @@ ALTER TABLE `talert_commands` MODIFY COLUMN `id_group` mediumint(8) unsigned NUL -- --------------------------------------------------------------------- ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT ''; --- --------------------------------------------------------------------- --- Table `titem` --- --------------------------------------------------------------------- -ALTER TABLE titem MODIFY `source_data` int(10) unsigned; - -- --------------------------------------------------------------------- -- Table `tconfig` -- ---------------------------------------------------------------------