From 6a220208b4839b668ebe1b3b2561d61d9bbdf125 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 12 Apr 2021 19:16:39 +0200 Subject: [PATCH 01/13] reviewing correlated alerts --- pandora_console/include/styles/alert.css | 90 ++++++++++++------------ 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 9a068cba34..9af7559eaf 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -1,12 +1,44 @@ +.rules div { + display: inline-block; +} + li#li-buttons-alert-list > div { margin-left: 10px; } +ul.sample li { + padding-bottom: 1em; +} +ul.sample li:last-child { + padding-bottom: 0; +} + #rule-builder .rule-builder-actions li { display: inline; width: auto; } +li#li-filters_show_action_alerts > label, +li#li-buttons-alert-list > label, +li#li-filters-alert-list > label { + width: initial; +} + +form#advanced_filters_alert ul li label, +form#general_filters_alert ul li label { + width: 150px; +} + +#rules.flex-row label { + flex: 1 1 70px; +} + +li#li-from-to-threshold > label:not(:first-child), +li#li-time-from-to > label:not(:first-child) { + width: initial; + margin-right: 15px; +} + #rule-builder .rule-builder-actions li label { width: 0; } @@ -21,10 +53,6 @@ ul.sample { flex: 1 1 300px; } -#rules.flex-row label { - flex: 1 1 70px; -} - #rules.flex-row div { flex: 10 1 200px; } @@ -39,17 +67,6 @@ span.rule-title { width: 100%; } -li#li-filters_show_action_alerts > label, -li#li-buttons-alert-list > label, -li#li-filters-alert-list > label { - width: initial; -} - -form#advanced_filters_alert ul li label, -form#general_filters_alert ul li label { - width: 150px; -} - form#conditions_filters_alert ul li label:first-child { width: 300px; } @@ -62,17 +79,14 @@ li#li-description textarea { flex: 1 1 auto; } -li#li-from-to-threshold > label:not(:first-child), -li#li-time-from-to > label:not(:first-child) { - width: initial; - margin-right: 15px; -} - li#li-from-to-threshold > input, li#li-time-from-to > input { margin-right: 15px; } - +.mode_table_firing table.info_table thead tr th img { + padding: 10px; + vertical-align: middle; +} form#advanced_filters_alert textarea { flex: 1 1 auto; height: 5em; @@ -107,12 +121,7 @@ ul.sample { flex-grow: 1; justify-content: space-between; } -ul.sample li { - padding-bottom: 1em; -} -ul.sample li:last-child { - padding-bottom: 0; -} + div.target { flex-grow: 1; flex-basis: auto; @@ -140,28 +149,28 @@ div.target.flex { position: relative; top: 25%; display: block; - left: 37%; + margin: 0 auto; font-size: 3em; color: #aaa; overflow: hidden; - width: 6em; background: #fff; text-align: center; - z-index: 2; } -div#rules.show::after { +div#rules::after { + content: "Drop Here"; position: relative; - top: 25%; display: block; - left: 37%; + margin: 2em auto; font-size: 3em; color: #aaa; overflow: hidden; - width: 6em; background: #fff; text-align: center; - z-index: 2; } +div#rules.cleanup::after { + content: none; +} + div#rules.show { box-shadow: 0 0 15px -5px #424242; border: 1px solid #ddd; @@ -209,10 +218,6 @@ div#rules.show { background-color: #424242; } -.rules div { - display: inline-block; -} - .inEdit { background-color: #888; } @@ -253,11 +258,6 @@ div#rules.show { font-weight: bolder; } -.mode_table_firing table.info_table thead tr th img { - padding: 10px; - vertical-align: middle; -} - #rules select.click-list-elements { border-radius: 0px; background-color: #424242; From 1b4251cf4961891278982ebcb59a93074729f0b7 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 12 Apr 2021 20:10:58 +0200 Subject: [PATCH 02/13] minor improvement, disabledElements --- pandora_console/include/styles/alert.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 9af7559eaf..9679e9483c 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -120,6 +120,7 @@ ul.sample { max-width: 50%; flex-grow: 1; justify-content: space-between; + min-width: 300px; } div.target { @@ -194,7 +195,10 @@ div#rules.show { opacity: 0.2; cursor: not-allowed; } - +.field.disabledElements { + opacity: 0.2; + cursor: not-allowed; +} .log { background-color: #638460; } From a80e50b7301858ff5e98a3a5c5e705a30731a8a8 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 14 Apr 2021 21:39:58 +0200 Subject: [PATCH 03/13] Update tevent_rule schema --- 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, From 2b05cde214c4cd3ebbdf4192aea0358f1a0d6528 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 14 Apr 2021 21:42:19 +0200 Subject: [PATCH 04/13] Revert "Update tevent_rule schema" This reverts commit a80e50b7301858ff5e98a3a5c5e705a30731a8a8. 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 deletions(-) diff --git a/pandora_console/extras/mr/46.sql b/pandora_console/extras/mr/46.sql index ae957a0b47..717b459590 100644 --- a/pandora_console/extras/mr/46.sql +++ b/pandora_console/extras/mr/46.sql @@ -4,8 +4,6 @@ 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 afea0ea995..c124721019 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,7 +627,6 @@ 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 a43b9cdde1..2733dd80a1 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2922,7 +2922,6 @@ 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, From 114f23f474a1060be535b366ccd3a85c6a7e9626 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 14 Apr 2021 22:36:56 +0200 Subject: [PATCH 05/13] Added event_server_cache_ttl --- pandora_server/conf/pandora_server.conf.new | 3 +++ pandora_server/lib/PandoraFMS/Config.pm | 4 ++++ pandora_server/lib/PandoraFMS/DB.pm | 15 +++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 538fb1bdef..f3a44a1bfe 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -470,6 +470,9 @@ log_window 3600 # Pre-load windows on start with available information. (PANDORA FMS ENTERPRISE ONLY). #preload_windows 0 +# Correlated Alerts, group cache ttl (in seconds). Set to 0 to disable. (PANDORA FMS ENTERPRISE ONLY). +#event_server_cache_ttl 10 + # If set to 1, an alert will not be fired if the last event it generated is in 'in-process' status. event_inhibit_alerts 0 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 7788686d08..ca5dd2705a 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -302,6 +302,7 @@ sub pandora_load_config { $pa_config->{"eventserver"} = 1; # 4.0 $pa_config->{"event_window"} = 3600; # 4.0 $pa_config->{"log_window"} = 3600; # 7.741 + $pa_config->{"event_server_cache_ttl"} = 10; # 7.754 $pa_config->{"preload_windows"} = 0; # 7.741 $pa_config->{"icmpserver"} = 0; # 4.0 $pa_config->{"icmp_threads"} = 3; # 4.0 @@ -1001,6 +1002,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^preload_windows\s+([0-9]*)/i) { $pa_config->{'preload_windows'}= clean_blank($1); } + elsif ($parametro =~ m/^event_server_cache_ttl\s+([0-9]*)/i) { + $pa_config->{"event_server_cache_ttl"} = clean_blank($1); + } elsif ($parametro =~ m/^snmp_threads\s+([0-9]*)/i) { $pa_config->{'snmp_threads'}= clean_blank($1); } diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm index 045e84f1e2..1148984d18 100644 --- a/pandora_server/lib/PandoraFMS/DB.pm +++ b/pandora_server/lib/PandoraFMS/DB.pm @@ -92,6 +92,7 @@ our @EXPORT = qw( get_priority_name get_server_id get_tag_id + get_tag_name get_group_name get_template_id get_template_module_id @@ -276,6 +277,20 @@ sub get_tag_id ($$) { return defined ($rc) ? $rc : -1; } +######################################################################## +## Return the name of a tag given its id. +######################################################################## +sub get_tag_name ($$) { + my ($dbh, $id) = @_; + + my $rc = get_db_value( + $dbh, "SELECT name FROM ttag + WHERE id_tag = ?", + safe_input($id) + ); + return $rc; +} + ######################################################################## ## Return the first enabled server name found. ######################################################################## From 21d72f41f9d07da464dbd819a7dc1976ca80ab87 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 15 Apr 2021 00:20:42 +0200 Subject: [PATCH 06/13] 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, From 2e45e0bde404dc939b14d649be45dd96ea277765 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 15 Apr 2021 10:35:21 +0200 Subject: [PATCH 07/13] Fixes in table tevent_rule definition --- pandora_console/extras/mr/46.sql | 16 +++++++++++- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 17 ++++++++++++- pandora_console/pandoradb.sql | 25 +++++++++---------- 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/pandora_console/extras/mr/46.sql b/pandora_console/extras/mr/46.sql index ae957a0b47..2d0c2a8a84 100644 --- a/pandora_console/extras/mr/46.sql +++ b/pandora_console/extras/mr/46.sql @@ -4,7 +4,21 @@ 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"; +ALTER TABLE `tevent_rule` MODIFY COLUMN `agent` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_usuario` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `evento` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `module` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `alert` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `user_comment` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_tag` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `name` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `group_recursion` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `log_content` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `log_source` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `log_agent` TEXT; 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"; 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 afea0ea995..b0d6a00048 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,7 +627,22 @@ 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`; + +ALTER TABLE `tevent_rule` MODIFY COLUMN `agent` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_usuario` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `evento` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `module` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `alert` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `user_comment` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_tag` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `name` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `group_recursion` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `log_content` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `log_source` TEXT; +ALTER TABLE `tevent_rule` MODIFY COLUMN `log_agent` TEXT; 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 a43b9cdde1..df81d3094b 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2912,19 +2912,18 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` ( `order` int(10) unsigned default '0', `window` int(10) NOT NULL default '0', `count` int(4) NOT NULL default '1', - `agent` text default '', - `id_usuario` varchar(100) NOT NULL default '', - `id_grupo` mediumint(4) default NULL, - `evento` text NOT NULL default '', - `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 '', - `module` text default '', - `alert` text default '', - `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, + `agent` text, + `id_usuario` text, + `id_grupo` text, + `evento` text, + `event_type` text, + `module` text, + `alert` text, + `criticity` text, + `user_comment` text, + `id_tag` text, + `name` text, + `group_recursion` text, `log_content` text, `log_source` text, `log_agent` text, From ada6bccfd6568800c1a6e386463412adf4533406 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Thu, 15 Apr 2021 12:12:06 +0200 Subject: [PATCH 08/13] changed request protocol --- pandora_console/godmode/setup/setup_integria.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/setup/setup_integria.php b/pandora_console/godmode/setup/setup_integria.php index 7cec5eccd1..9e63fb3639 100644 --- a/pandora_console/godmode/setup/setup_integria.php +++ b/pandora_console/godmode/setup/setup_integria.php @@ -834,7 +834,7 @@ echo ''; // AJAX call to check API connection. $.ajax({ - type: "GET", + type: "POST", url: url, dataType: "json", data: data From 3ff361977c4fa846d6b473dc0b044584f6553bda Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Fri, 16 Apr 2021 10:02:34 +0200 Subject: [PATCH 09/13] check page load protocol on integria setup --- pandora_console/include/functions_config.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index d2bed417b4..b4c946f666 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1645,7 +1645,11 @@ function config_update_config() $integria_hostname = (string) get_parameter('integria_hostname', $config['integria_hostname']); if (parse_url($integria_hostname, PHP_URL_SCHEME) === null) { - $integria_hostname = 'http://'.$integria_hostname; + if (empty($_SERVER['HTTPS']) === false) { + $integria_hostname = 'https://'.$integria_hostname; + } else { + $integria_hostname = 'http://'.$integria_hostname; + } } if (!config_update_value('integria_hostname', $integria_hostname)) { From 6ebb6f6843edc89368568722bde92c4673ba6e5f Mon Sep 17 00:00:00 2001 From: marcos Date: Mon, 19 Apr 2021 12:59:52 +0200 Subject: [PATCH 10/13] fixeed visual error vc legacy mode --- pandora_console/include/functions_html.php | 7 +- .../include/functions_visual_map_editor.php | 80 +++++++++++++++++-- pandora_console/include/styles/pandora.css | 2 +- 3 files changed, 79 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index c5a16434f8..1e9c406919 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -718,7 +718,8 @@ function html_print_select( $select_all=false, $simple_multiple_options=false, $required=false, - $truncate_size=false + $truncate_size=false, + $select2_enable=true ) { $output = "\n"; @@ -890,7 +891,7 @@ function html_print_select( $select2 = 'select2_dark.min'; } - if ($multiple === false) { + if ($multiple === false && $select2_enable === true) { if (is_ajax()) { $output .= '