From 593d197016db7af214658c42a945256c9ff85454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Sun, 4 Jun 2023 16:12:29 -0600 Subject: [PATCH] Remove reference to tnetwork_matrix --- index.pot | 5 --- pandora_console/godmode/setup/performance.php | 15 ------- .../include/class/ConsoleSupervisor.php | 1 - pandora_console/include/functions_config.php | 12 ------ pandora_console/include/languages/ca.po | 4 -- pandora_console/include/languages/en_GB.po | 5 --- pandora_console/include/languages/es.po | 4 -- pandora_console/include/languages/fr.po | 4 -- pandora_console/include/languages/index.pot | 5 --- pandora_console/include/languages/ja.po | 4 -- pandora_console/include/languages/ru.po | 4 -- pandora_console/include/languages/zh_CN.po | 4 -- pandora_console/pandoradb.sql | 14 ------- pandora_server/lib/PandoraFMS/DataServer.pm | 41 ------------------- pandora_server/util/pandora_db.pl | 10 ----- 15 files changed, 132 deletions(-) diff --git a/index.pot b/index.pot index 634835f0a4..c499bf1548 100644 --- a/index.pot +++ b/index.pot @@ -35817,11 +35817,6 @@ msgstr "" msgid "Max. days before delete old messages" msgstr "" -#: ../../include/functions_config.php:864 -#: ../../godmode/setup/performance.php:485 -msgid "Max. days before delete old network matrix data" -msgstr "" - #: ../../include/functions_config.php:868 #: ../../godmode/setup/performance.php:599 msgid "Graph container - Max. Items" diff --git a/pandora_console/godmode/setup/performance.php b/pandora_console/godmode/setup/performance.php index e367a2c54b..4f698a7b39 100644 --- a/pandora_console/godmode/setup/performance.php +++ b/pandora_console/godmode/setup/performance.php @@ -545,21 +545,6 @@ $table->data[6][0] = html_print_label_input_block( ) ); -$table->data[6][1] = html_print_label_input_block( - __('Max. days before delete old network matrix data'), - html_print_input( - [ - 'type' => 'number', - 'size' => 5, - 'max' => $performance_variables_control['delete_old_network_matrix']->max, - 'name' => 'delete_old_network_matrix', - 'value' => $config['delete_old_network_matrix'], - 'return' => true, - 'min' => $performance_variables_control['delete_old_network_matrix']->min, - ] - ) -); - if (enterprise_installed()) { $table->data[7][0] = html_print_label_input_block( __('Max. days before delete inventory data'), diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 4dc665fb26..08530bb38b 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -583,7 +583,6 @@ class ConsoleSupervisor 'days_delete_unknown' => 'Max. days before unknown modules are deleted', 'days_delete_not_initialized' => 'Max. days before delete not initialized modules', 'days_autodisable_deletion' => 'Max. days before autodisabled agents are deleted', - 'delete_old_network_matrix' => 'Max. days before delete old network matrix data', 'report_limit' => 'Item limit for real-time reports', 'event_view_hr' => 'Default hours for event view', 'big_operation_step_datos_purge' => 'Big Operation Step to purge old data', diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 468c228733..c0f05980aa 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -940,10 +940,6 @@ function config_update_config() $error_update[] = __('Max. days before delete old messages'); } - if (config_update_value('delete_old_network_matrix', get_parameter('delete_old_network_matrix'), true) === false) { - $error_update[] = __('Max. days before delete old network matrix data'); - } - if (config_update_value('max_graph_container', get_parameter('max_graph_container'), true) === false) { $error_update[] = __('Graph container - Max. Items'); } @@ -2197,10 +2193,6 @@ function config_process_config() config_update_value('delete_old_messages', 21); } - if (!isset($config['delete_old_network_matrix'])) { - config_update_value('delete_old_network_matrix', 10); - } - if (!isset($config['max_graph_container'])) { config_update_value('max_graph_container', 10); } @@ -2460,10 +2452,6 @@ function config_process_config() 'max' => 90, 'min' => 0, ], - 'delete_old_network_matrix' => [ - 'max' => 30, - 'min' => 1, - ], 'report_limit' => [ 'max' => 500, 'min' => 1, diff --git a/pandora_console/include/languages/ca.po b/pandora_console/include/languages/ca.po index 6c13fcd431..faaf7534ea 100644 --- a/pandora_console/include/languages/ca.po +++ b/pandora_console/include/languages/ca.po @@ -36556,10 +36556,6 @@ msgstr "Màxim de dies abans de suprimir les dades de l'inventari" msgid "Max. days before delete old messages" msgstr "Màxims dies abans de suprimir missatges antics" -#: ../../include/functions_config.php:864 ../../godmode/setup/performance.php:485 -msgid "Max. days before delete old network matrix data" -msgstr "Màxim de dies abans de suprimir les dades antigues de la matriu de xarxa" - #: ../../include/functions_config.php:868 ../../godmode/setup/performance.php:599 msgid "Graph container - Max. Items" msgstr "Contenidor de gràfics - Màxims. Elements" diff --git a/pandora_console/include/languages/en_GB.po b/pandora_console/include/languages/en_GB.po index 40d6e98259..b035aee2bb 100644 --- a/pandora_console/include/languages/en_GB.po +++ b/pandora_console/include/languages/en_GB.po @@ -33677,11 +33677,6 @@ msgstr "Compact interpolation in hours (1 = fine / 20 = bad)" msgid "Max. days before delete old messages" msgstr "" -#: ../../godmode/setup/performance.php:511 -#: ../../include/functions_config.php:829 -msgid "Max. days before delete old network matrix data" -msgstr "" - #: ../../godmode/setup/performance.php:531 msgid "Item limit for realtime reports" msgstr "Item limit for real-time reports" diff --git a/pandora_console/include/languages/es.po b/pandora_console/include/languages/es.po index 7e6b0bb062..db6008c4ba 100644 --- a/pandora_console/include/languages/es.po +++ b/pandora_console/include/languages/es.po @@ -40018,10 +40018,6 @@ msgstr "Interpolación de la compactación en horas (1 bueno - 20 malo)" msgid "Max. days before delete old messages" msgstr "Núm. máx. de días antes de borrar mensajes antiguos" -#: ../../godmode/setup/performance.php:549 ../../include/functions_config.php:932 -msgid "Max. days before delete old network matrix data" -msgstr "Núm. máx. de días antes de borrar datos de matriz antiguos" - #: ../../godmode/setup/performance.php:565 ../../include/functions_config.php:923 msgid "Max. days before delete inventory data" msgstr "Nº de días máximo antes del borrado de datos de inventario" diff --git a/pandora_console/include/languages/fr.po b/pandora_console/include/languages/fr.po index ba53cc15bb..39e52f1ed1 100644 --- a/pandora_console/include/languages/fr.po +++ b/pandora_console/include/languages/fr.po @@ -40145,10 +40145,6 @@ msgstr "Interpolation de compression en heures (1 Optimale-20 Mauvaise)" msgid "Max. days before delete old messages" msgstr "Max. jours avant de supprimer les anciens messages" -#: ../../godmode/setup/performance.php:549 ../../include/functions_config.php:932 -msgid "Max. days before delete old network matrix data" -msgstr "Max. jours avant de supprimer les anciennes données de la matrice réseau" - #: ../../godmode/setup/performance.php:565 ../../include/functions_config.php:923 msgid "Max. days before delete inventory data" msgstr "Nombre de jours maximum avant la suppression de données d'inventaire" diff --git a/pandora_console/include/languages/index.pot b/pandora_console/include/languages/index.pot index bd3f78dca8..d136661cd6 100644 --- a/pandora_console/include/languages/index.pot +++ b/pandora_console/include/languages/index.pot @@ -39282,11 +39282,6 @@ msgstr "" msgid "Max. days before delete old messages" msgstr "" -#: ../../godmode/setup/performance.php:549 -#: ../../include/functions_config.php:932 -msgid "Max. days before delete old network matrix data" -msgstr "" - #: ../../godmode/setup/performance.php:565 #: ../../include/functions_config.php:923 msgid "Max. days before delete inventory data" diff --git a/pandora_console/include/languages/ja.po b/pandora_console/include/languages/ja.po index b1211fe6cd..e5ea42a62f 100644 --- a/pandora_console/include/languages/ja.po +++ b/pandora_console/include/languages/ja.po @@ -39389,10 +39389,6 @@ msgstr "データ縮小時の丸め込み単位時間 (1〜20)" msgid "Max. days before delete old messages" msgstr "古いメッセージの保持日数" -#: ../../godmode/setup/performance.php:549 ../../include/functions_config.php:932 -msgid "Max. days before delete old network matrix data" -msgstr "ネットワークマトリックスデータ保持日数" - #: ../../godmode/setup/performance.php:565 ../../include/functions_config.php:923 msgid "Max. days before delete inventory data" msgstr "インベントリデータの保持日数" diff --git a/pandora_console/include/languages/ru.po b/pandora_console/include/languages/ru.po index 7be56f241a..c5dc408ae6 100644 --- a/pandora_console/include/languages/ru.po +++ b/pandora_console/include/languages/ru.po @@ -36535,10 +36535,6 @@ msgstr "Максимальное количество дней до удален msgid "Max. days before delete old messages" msgstr "Максимальное количество дней до удаления старых сообщений" -#: ../../include/functions_config.php:864 ../../godmode/setup/performance.php:485 -msgid "Max. days before delete old network matrix data" -msgstr "Максимальное количество дней до удаления старых данных сетевой матрицы" - #: ../../include/functions_config.php:868 ../../godmode/setup/performance.php:599 msgid "Graph container - Max. Items" msgstr "Графический контейнер - Макс. Элементы" diff --git a/pandora_console/include/languages/zh_CN.po b/pandora_console/include/languages/zh_CN.po index 77d697f8a8..8ef2bfca2b 100644 --- a/pandora_console/include/languages/zh_CN.po +++ b/pandora_console/include/languages/zh_CN.po @@ -35863,10 +35863,6 @@ msgstr "删除库存数据前的最大日期" msgid "Max. days before delete old messages" msgstr "删除旧邮件前的最大日期" -#: ../../include/functions_config.php:864 ../../godmode/setup/performance.php:485 -msgid "Max. days before delete old network matrix data" -msgstr "删除旧网络矩阵数据前的最大日期" - #: ../../include/functions_config.php:868 ../../godmode/setup/performance.php:599 msgid "Graph container - Max. Items" msgstr "图形容器 - 最大项目" diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 8d1ef299df..e840a68ca1 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3742,20 +3742,6 @@ CREATE TABLE IF NOT EXISTS `tagent_custom_fields_filter` ( PRIMARY KEY(`id`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; --- ----------------------------------------------------- --- Table `tnetwork_matrix` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `tnetwork_matrix` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `source` VARCHAR(60) DEFAULT '', - `destination` VARCHAR(60) DEFAULT '', - `utimestamp` BIGINT DEFAULT 0, - `bytes` INT UNSIGNED DEFAULT 0, - `pkts` INT UNSIGNED DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE (`source`, `destination`, `utimestamp`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4 ; - -- --------------------------------------------------------------------- -- Table `user_task` -- --------------------------------------------------------------------- diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index ac4364dca1..c70b8f98e1 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -313,8 +313,6 @@ sub data_consumer ($$) { enterprise_hook('process_xml_connections', [$self->getConfig (), $file_name, $xml_data, $self->getDBH ()]); } elsif (defined($xml_data->{'ipam_source'})) { enterprise_hook('process_xml_ipam', [$self->getConfig (), $file_name, $xml_data, $self->getDBH ()]); - } elsif (defined($xml_data->{'network_matrix'})){ - process_xml_matrix_network( $self->getConfig(), $xml_data, $self->getDBH()); } else { process_xml_data ($self->getConfig (), $file_name, $xml_data, $self->getServerID (), $self->getDBH ()); } @@ -1130,45 +1128,6 @@ sub process_events_dataserver { return; } - -########################################################################## -# Process events in the XML. -########################################################################## -sub process_xml_matrix_network { - my ($pa_config, $data, $dbh) = @_; - - my $utimestamp = $data->{'network_matrix'}->[0]->{'utimestamp'}; - my $content = $data->{'network_matrix'}->[0]->{'content'}; - return unless defined($utimestamp) && defined($content); - - # Try to decode the base64 inside - my $matrix_info; - eval { - $matrix_info = decode_json(decode_base64($content)); - }; - - if ($@) { - logger($pa_config, "Error processing base64 matrix data '$content'.", 5); - return; - } - foreach my $source (keys %$matrix_info) { - foreach my $destination (keys %{$matrix_info->{$source}}) { - my $matrix_single_data = $matrix_info->{$source}->{$destination}; - $matrix_single_data->{'source'} = $source; - $matrix_single_data->{'destination'} = $destination; - $matrix_single_data->{'utimestamp'} = $utimestamp; - eval { - db_process_insert($dbh, 'id', 'tnetwork_matrix', $matrix_single_data); - }; - if ($@) { - logger($pa_config, "Error inserted matrix data. Source: $source, destination: $destination, utimestamp: $utimestamp.", 5); - } - } - } - - return; -} - ########################################################################## # Get a lock on the given agent. Return 1 on success, 0 otherwise. ########################################################################## diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 3c3f11f025..caed4d2706 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -408,14 +408,6 @@ sub pandora_purgedb ($$$) { log_message ('PURGE', 'Deleting old tgraph_source data.'); db_do ($dbh,"DELETE FROM tgraph_source WHERE id_graph NOT IN (SELECT id_graph FROM tgraph)"); - - # Delete network traffic old data. - log_message ('PURGE', 'Deleting old network matrix data.'); - if ($conf->{'_delete_old_network_matrix'} > 0) { - my $matrix_limit = time() - 86400 * $conf->{'_delete_old_network_matrix'}; - db_do ($dbh, "DELETE FROM tnetwork_matrix WHERE utimestamp < ?", $matrix_limit); - } - # Delete old messages log_message ('PURGE', "Deleting old messages."); if ($conf->{'_delete_old_messages'} > 0) { @@ -599,7 +591,6 @@ sub pandoradb_load_history_conf($) { $options{'_days_autodisable_deletion'} = 0 unless defined ($options{'_days_autodisable_deletion'}); $options{'_num_past_special_days'} = 0 unless defined($options{'_num_past_special_days'}); - $options{'_delete_old_network_matrix'} = 0 unless defined($options{'_delete_old_network_matrix'}); $options{'_delete_old_messages'} = 0 unless defined($options{'_delete_old_messages'}); $options{'_netflow_max_lifetime'} = 0 unless defined($options{'_netflow_max_lifetime'}); $options{'claim_back_snmp_modules'} = 0 unless defined($options{'claim_back_snmp_modules'}); @@ -695,7 +686,6 @@ sub pandora_load_config_pdb ($) { $conf->{'_delete_notinit'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'delete_notinit'"); $conf->{'_inventory_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'inventory_purge'"); $conf->{'_delete_old_messages'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'delete_old_messages'"); - $conf->{'_delete_old_network_matrix'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'delete_old_network_matrix'"); $conf->{'_enterprise_installed'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'enterprise_installed'"); $conf->{'_metaconsole'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'metaconsole'"); $conf->{'_netflow_max_lifetime'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'netflow_max_lifetime'");