From 21d72f41f9d07da464dbd819a7dc1976ca80ab87 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 15 Apr 2021 00:20:42 +0200 Subject: [PATCH] Revert "Revert "Update tevent_rule schema"" This reverts commit 2b05cde214c4cd3ebbdf4192aea0358f1a0d6528. Changes to be committed: modified: pandora_console/extras/mr/46.sql modified: pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql modified: pandora_console/pandoradb.sql --- pandora_console/extras/mr/46.sql | 2 ++ pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 1 + pandora_console/pandoradb.sql | 1 + 3 files changed, 4 insertions(+) diff --git a/pandora_console/extras/mr/46.sql b/pandora_console/extras/mr/46.sql index 717b459590..ae957a0b47 100644 --- a/pandora_console/extras/mr/46.sql +++ b/pandora_console/extras/mr/46.sql @@ -4,6 +4,8 @@ ALTER TABLE `tagent_custom_fields` MODIFY COLUMN `combo_values` TEXT NOT NULL DE ALTER TABLE `treport_content` MODIFY `external_source` MEDIUMTEXT; ALTER TABLE `treport_content_template` MODIFY `external_source` MEDIUMTEXT; +ALTER TABLE `tevent_rule` ADD COLUMN `tag_name` TEXT AFTER `id_tag` COMMENT "Aux value to improve alerts performance"; + UPDATE `talert_commands` SET `fields_descriptions` = '[\"Event name\",\"Event type\",\"Source\",\"Agent name or _agent_\",\"Event severity\",\"ID extra\",\"Tags separated by commas\",\"Comments\",\"\",\"\"]' WHERE `name` = "Monitoring Event"; UPDATE `tskin` SET `name` = 'Default theme' , `relative_path` = 'pandora.css' WHERE `id` = 1; 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 c124721019..afea0ea995 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 @@ -627,6 +627,7 @@ ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator ALTER TABLE `tevent_rule` MODIFY COLUMN `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') default ''; ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL; ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL; +ALTER TABLE `tevent_rule` ADD COLUMN `tag_name` TEXT COMMENT "Aux value to improve correlated alerts performance" AFTER `id_tag`; UPDATE `tevent_rule` SET `operator_agent` = "REGEX" WHERE `agent` != ''; UPDATE `tevent_rule` SET `operator_id_usuario` = "REGEX" WHERE `id_usuario` != ''; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 2733dd80a1..a43b9cdde1 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2922,6 +2922,7 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` ( `criticity` int(4) unsigned default NULL, `user_comment` text NOT NULL, `id_tag` integer(10) unsigned NOT NULL default '0', + `tag_name` text COMMENT 'Aux value to improve alerts performance', `name` text default '', `group_recursion` INT(1) unsigned default 0, `log_content` text,