diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 020e1465c5..70545a78b6 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.752-210324 +Version: 7.0NG.752-210325 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index a04d1c2a99..dafeaaa35a 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.752-210324" +pandora_version="7.0NG.752-210325" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index f1f355a5e9..d62aaf51ea 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1016,7 +1016,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.752'; -use constant AGENT_BUILD => '210324'; +use constant AGENT_BUILD => '210325'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 107b92c137..65ebf1591e 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.752 -%define release 210324 +%define release 210325 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 349e7f6a3b..c889ffe5e7 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.752 -%define release 210324 +%define release 210325 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 8cfcbc3443..c9a12cf59f 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.752" -PI_BUILD="210324" +PI_BUILD="210325" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index cca7dab021..ea1d398fc7 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210324} +{210325} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f5f623f7f5..50ea94d212 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.752(Build 210324)") +#define PANDORA_VERSION ("7.0NG.752(Build 210325)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 0ad208138e..031cae79e1 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.752(Build 210324))" + VALUE "ProductVersion", "(7.0NG.752(Build 210325))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d96fee194d..fa0c953087 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.752-210324 +Version: 7.0NG.752-210325 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 49240cef58..9b876c3b61 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.752-210324" +pandora_version="7.0NG.752-210325" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt index 680e931a4e..7e9650d18c 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -76,4 +76,5 @@ enterprise/extensions/visual_console_manager.php pandora_console/extensions/net_tools.php include/lib/WSManager.php include/lib/WebSocketServer.php -include/lib/WebSocketUser.php \ No newline at end of file +include/lib/WebSocketUser.php +operation/network/network_explorer.php diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 0a6c53d766..135c915b76 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -770,12 +770,6 @@ switch ($action) { // Max values. break; - case 'nt_top_n': - $period = $item['period']; - $description = $item['description']; - $top_n_value = $item['top_n_value']; - break; - case 'permissions_report': $description = $item['description']; $es = json_decode($item['external_source'], true); @@ -818,7 +812,6 @@ switch ($action) { case 'simple_baseline_graph': case 'event_report_log': case 'increment': - case 'nt_top_n': $label = (isset($style['label'])) ? $style['label'] : ''; break; @@ -5908,12 +5901,6 @@ function chooseType() { $("#row_historical_db_check").hide(); break; - case 'nt_top_n': - $("#row_description").show(); - $("#row_period").show(); - $("#row_quantity").show(); - break; - case 'permissions_report': $("#row_description").show(); $("#row_users").show(); diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 7b38abef62..d4967be810 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1718,14 +1718,6 @@ switch ($action) { $good_format = true; break; - case 'nt_top_n': - $values['period'] = get_parameter('period'); - $values['top_n_value'] = get_parameter( - 'quantity' - ); - $good_format = true; - break; - default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter( @@ -2093,7 +2085,6 @@ switch ($action) { case 'projection_graph': case 'prediction_date': case 'simple_baseline_graph': - case 'nt_top_n': if ($label != '') { $style['label'] = $label; } else { @@ -2379,14 +2370,6 @@ switch ($action) { $good_format = true; break; - case 'nt_top_n': - $values['top_n_value'] = get_parameter( - 'quantity' - ); - $values['period'] = get_parameter('period'); - $good_format = true; - break; - default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter( @@ -2727,7 +2710,6 @@ switch ($action) { case 'projection_graph': case 'prediction_date': case 'simple_baseline_graph': - case 'nt_top_n': if ($label != '') { $style['label'] = $label; } else { diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 6401cd2949..fbd33b8a90 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -242,14 +242,6 @@ $table->data[$i++][1] = html_print_checkbox_switch_extended( true ); -$table->data[$i][0] = __('Enable Network Traffic Analyzer'); -$table->data[$i++][1] = html_print_switch( - [ - 'name' => 'activate_nta', - 'value' => $config['activate_nta'], - ] -); - $zone_name = [ 'Africa' => __('Africa'), diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index caf28ec849..f38b4c5ec9 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC210324'; +$build_version = 'PC210325'; $pandora_version = 'v7.0NG.752'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 4f965c25b2..322e630485 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -232,10 +232,6 @@ function config_update_config() $error_update[] = __('Enable Netflow'); } - if (!config_update_value('activate_nta', (bool) get_parameter_switch('activate_nta'))) { - $error_update[] = __('Enable Network Traffic Analyzer'); - } - $timezone = (string) get_parameter('timezone'); if ($timezone != '') { if (!config_update_value('timezone', $timezone)) { @@ -2459,10 +2455,6 @@ function config_process_config() config_update_value('activate_netflow', 0); } - if (!isset($config['activate_nta'])) { - config_update_value('activate_nta', 0); - } - if (!isset($config['netflow_path'])) { if ($is_windows) { $default = 'C:\PandoraFMS\Pandora_Server\data_in\netflow'; diff --git a/pandora_console/include/functions_network.php b/pandora_console/include/functions_network.php index 9d81bf8bdc..9df4f8dbc4 100644 --- a/pandora_console/include/functions_network.php +++ b/pandora_console/include/functions_network.php @@ -21,70 +21,6 @@ // Write here requires and definitions. -/** - * Get the tnetwok_matrix summatory data. - * - * @param integer $top Number of hosts to show. - * @param boolean $talker Talker (true) or listetener (false). - * @param integer $start Utimestamp of start time. - * @param integer $end Utimestamp of end time. - * @param string $ip_filter Ip to filter. - * @param boolean $order_by_bytes True by top by bytes. False by packets. - * @param array $host_filter Host filter array. - * - * @return array With requested data. - */ -function network_matrix_get_top( - $top, - $talker, - $start, - $end, - $ip_filter='', - $order_by_bytes=true, - $host_filter=[] -) { - $field_to_group = ($talker === true) ? 'source' : 'destination'; - $field_to_order = ($order_by_bytes === true) ? 'sum_bytes' : 'sum_pkts'; - $filter_sql = ''; - if (!empty($ip_filter)) { - $filter_field = ($talker === true) ? 'destination' : 'source'; - $filter_sql = sprintf('AND %s="%s"', $filter_field, $ip_filter); - } - - $host_filter_sql = ''; - if (!empty($host_filter)) { - $host_filter_sql = sprintf( - ' AND %s IN ("%s")', - $field_to_group, - implode('","', $host_filter) - ); - } - - $sql = sprintf( - 'SELECT SUM(bytes) sum_bytes, SUM(pkts) sum_pkts, %s host - FROM tnetwork_matrix - WHERE utimestamp > %d AND utimestamp < %d - %s - %s - GROUP BY %s - ORDER BY %s DESC - LIMIT %d', - $field_to_group, - $start, - $end, - $filter_sql, - $host_filter_sql, - $field_to_group, - $field_to_order, - $top - ); - - $data = db_get_all_rows_sql($sql); - - return ($data !== false) ? $data : []; -} - - /** * Get the possible actions on networking. * @@ -169,84 +105,6 @@ function network_format_bytes($value) } -/** - * Build netflow data structure to network map. - * - * @param integer $start Time in timestamp format. - * @param integer $end Time in timestamp format. - * @param integer $top Max data to show. - * @param boolean $talker True to get top tolkers. False for listeners. - * - * @return array With map structure. - */ -function network_build_map_data($start, $end, $top, $talker) -{ - $data = network_matrix_get_top($top, $talker, $start, $end); - - $hosts = array_map( - function ($elem) { - return $elem['host']; - }, - $data - ); - $inverse_hosts = array_flip($hosts); - - $nodes = array_map( - function ($elem) { - return network_init_node_map($elem); - }, - $hosts - ); - - $relations = []; - $orphan_relations = []; - foreach ($hosts as $host) { - $host_top = network_matrix_get_top( - $top, - !$talker, - $start, - $end, - $host, - true, - $hosts - ); - foreach ($host_top as $sd) { - $src_index = $inverse_hosts[$host]; - $dst_index = $inverse_hosts[$sd['host']]; - if (isset($src_index) === false || isset($dst_index) === false) { - continue; - } - - network_init_relation_map( - $relations, - $src_index, - $dst_index, - network_format_bytes($sd['sum_bytes']) - ); - } - - // Put the orphans on Other node. - if (empty($host_top)) { - $other_id = (end($inverse_hosts) + 1); - // TODOS: Add the data. - network_init_relation_map( - $orphan_relations, - $other_id, - $inverse_hosts[$host] - ); - } - } - - // Put the Others node and their relations. - if (empty($orphan_relations) === false) { - $nodes[] = network_init_node_map(__('Others')); - $relations = array_merge($relations, $orphan_relations); - } - - return network_general_map_configuration($nodes, $relations); -} - - /** * Return the array to pass to constructor to NetworkMap. * diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 8e0aafe5fb..aab903a361 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -851,14 +851,6 @@ function reporting_make_reporting_data( ); break; - case 'nt_top_n': - $report['contents'][] = reporting_nt_top_n_report( - $report, - $content, - $pdf - ); - break; - default: // Default. break; @@ -13580,43 +13572,6 @@ function reporting_header_table_for_pdf($title='', $description='') } -/** - * Build the required data to build network traffic top N report - * - * @param int Period (time window). - * @param array Information about the item of report. - * @param bool Pdf or not - * - * @return array With report presentation info and report data. - */ -function reporting_nt_top_n_report($period, $content, $pdf) -{ - $return = []; - $return['type'] = 'nt_top_n'; - $return['title'] = $content['name']; - $return['landscape'] = $content['landscape']; - $return['pagebreak'] = $content['pagebreak']; - $return['description'] = $content['description']; - - // Get the data sent and received - $return['data'] = []; - $start_time = ($period['datetime'] - (int) $content['period']); - $return['data']['send'] = network_matrix_get_top( - $content['top_n_value'], - true, - $start_time, - $period['datetime'] - ); - $return['data']['recv'] = network_matrix_get_top( - $content['top_n_value'], - false, - $start_time, - $period['datetime'] - ); - return $return; -} - - /** * Will display an hourly analysis of the selected period. * diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 0733a8a06d..9877842e0a 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -403,10 +403,6 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) reporting_enterprise_html_SLA_monthly($table, $item, $mini); break; - case 'nt_top_n': - reporting_html_nt_top_n($table, $item, $mini); - break; - case 'SLA_weekly': reporting_enterprise_html_SLA_weekly($table, $item, $mini); break; @@ -5591,65 +5587,6 @@ function reporting_get_event_histogram_meta($width) } -/** - * Print network traffic data into top n tables - * (one for received data and another for sent) - * - * @param stdClass Table class to paint the report - * @param array Associative array with info about - * @param bool Unused - */ -function reporting_html_nt_top_n($table, $item, $mini) -{ - // Prepare the table - $table_top = new stdClass(); - $table_top->cellpadding = 0; - $table_top->cellspacing = 0; - $table_top->width = '100%'; - $table_top->class = 'databox data'; - $table_top->cellpadding = 0; - $table_top->cellspacing = 0; - $table_top->width = '100%'; - $table_top->class = 'databox data'; - $table_top->head['host'] = __('Agent'); - $table_top->head['bytes'] = __('Kilobytes'); - $table_top->head['pkts'] = __('Packages'); - - // Build the table for sent packages - if (empty($item['data']['send'])) { - $table->data['send_title'] = '