From c26db22fa5f9d2951c39d38d10bac5ed08266fe3 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 13 Apr 2023 11:07:09 +0200 Subject: [PATCH 01/29] #10563 Move menu item Links from Management to Operation. Add button in setup to global disable the Feedback functionality --- pandora_console/general/header.php | 5 +++- pandora_console/godmode/menu.php | 18 ++++++++------- .../godmode/setup/setup_general.php | 13 +++++++++++ pandora_console/include/functions_config.php | 8 +++++++ pandora_console/operation/menu.php | 23 +++++++++++++++++++ 5 files changed, 58 insertions(+), 9 deletions(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index b0cbc0cec5..38f36fe730 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -352,7 +352,10 @@ echo sprintf('
', $menuTypeClass); } // Button for feedback pandora. - if (enterprise_installed()) { + if (enterprise_installed() && ( (!isset($config['activate_feedback']) + || (isset($config['activate_feedback']) + && $config['activate_feedback'] === true )) ) + ) { $header_feedback = '
'; $header_feedback .= ''; $header_feedback .= ''; diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index f6e4aac358..79670bc02b 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -546,21 +546,23 @@ if ($access_console_node === true) { } } - $menu_godmode['links']['text'] = __('Links'); - $menu_godmode['links']['sec2'] = ''; - $menu_godmode['links']['id'] = 'god-links'; + /* + $menu_godmode['links']['text'] = __('Links'); + $menu_godmode['links']['sec2'] = ''; + $menu_godmode['links']['id'] = 'god-links'; - $sub = []; - $rows = db_get_all_rows_in_table('tlink', 'name'); - foreach ($rows as $row) { + $sub = []; + $rows = db_get_all_rows_in_table('tlink', 'name'); + foreach ($rows as $row) { // Audit //meter en extensiones. $sub[$row['link']]['text'] = $row['name']; $sub[$row['link']]['id'] = $row['name']; $sub[$row['link']]['type'] = 'direct'; $sub[$row['link']]['subtype'] = 'new_blank'; - } + } - $menu_godmode['links']['sub'] = $sub; + $menu_godmode['links']['sub'] = $sub; + */ } // Warp Manager. diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index ad7a40aa8b..ce0216ce64 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -429,6 +429,19 @@ $table->data[$i++][] = html_print_label_input_block( ) ); +$table->data[$i++][] = html_print_label_input_block( + __('Enable Feedback'), + html_print_checkbox_switch_extended( + 'activate_feedback', + 1, + $config['activate_feedback'], + false, + '', + '', + true + ) +); + $table->colspan[$i][] = 2; $table->data[$i++][] = html_print_label_input_block( __('Timezone setup'), diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index b94892e7c1..a990c96398 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -264,6 +264,10 @@ function config_update_config() $error_update[] = __('Enable Sflow'); } + if (config_update_value('activate_feedback', (bool) get_parameter('activate_feedback'), true) === false) { + $error_update[] = __('Enable Feedback'); + } + if (config_update_value('general_network_path', get_parameter('general_network_path'), true) === false) { $error_update[] = __('General network path'); } else { @@ -3330,6 +3334,10 @@ function config_process_config() config_update_value('autoupdate', 1); } + if (!isset($config['activate_feedback'])) { + config_update_value('activate_feedback', 1); + } + if (!isset($config['api_password'])) { config_update_value('api_password', ''); } diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 8b6d9f4749..fe381e0449 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -628,6 +628,27 @@ if ($favorite_menu !== false) { } +// Links. +$rows = db_get_all_rows_in_table('tlink', 'name'); +// $rows = []; +if (!empty($rows)) { + $menu_operation['links']['text'] = __('Links'); + $menu_operation['links']['sec2'] = ''; + $menu_operation['links']['id'] = 'god-links'; + + $sub = []; + foreach ($rows as $row) { + // Audit //meter en extensiones. + $sub[$row['link']]['text'] = $row['name']; + $sub[$row['link']]['id'] = $row['name']; + $sub[$row['link']]['type'] = 'direct'; + $sub[$row['link']]['subtype'] = 'new_blank'; + } + + $menu_operation['links']['sub'] = $sub; +} + + // Workspace. @@ -785,6 +806,8 @@ if ($access_console_node === true) { // ~ } } + + // Save operation menu array to use in operation/extensions.php view $operation_menu_array = $menu_operation; From dc41e1c37753c005e8b326d2c9c733eb8c6d6bf8 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 13 Apr 2023 11:36:13 +0200 Subject: [PATCH 02/29] fix if in header and declare correctly a value --- pandora_console/general/header.php | 5 +---- pandora_console/include/functions_config.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 38f36fe730..5609ab46d6 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -352,10 +352,7 @@ echo sprintf('
', $menuTypeClass); } // Button for feedback pandora. - if (enterprise_installed() && ( (!isset($config['activate_feedback']) - || (isset($config['activate_feedback']) - && $config['activate_feedback'] === true )) ) - ) { + if (enterprise_installed() && $config['activate_feedback'] !== false) { $header_feedback = '
'; $header_feedback .= ''; $header_feedback .= ''; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index a990c96398..ba2f1efa89 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -3335,7 +3335,7 @@ function config_process_config() } if (!isset($config['activate_feedback'])) { - config_update_value('activate_feedback', 1); + config_update_value('activate_feedback', true); } if (!isset($config['api_password'])) { From b043717df5d9ba7077116b7fa96f234d19be9659 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 13 Apr 2023 13:49:05 +0200 Subject: [PATCH 03/29] #15263 created filter for modules --- .../godmode/agentes/module_manager.php | 77 ++++++++++++++++++- 1 file changed, 73 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 3cb5ce9787..92bb1f224e 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -47,8 +47,74 @@ if (isset($policy_page) === false) { $policy_page = false; } -$checked = (bool) get_parameter('checked'); +$checked = (bool) get_parameter('status_hierachy_mode'); +$status_hierachy_mode = (bool) get_parameter('status_hierachy_mode'); $sec2 = (string) get_parameter('sec2'); +// Table for filter bar. +$filterTable = new stdClass(); +$filterTable->class = 'filter-table-adv w100p'; +$filterTable->size[0] = '20%'; +$filterTable->size[1] = '20%'; +$filterTable->size[2] = '20%'; +$filterTable->size[3] = '20%'; +$filterTable->size[4] = '20%'; +$filterTable->data = []; +$filterTable->cellstyle[0][0] = 'width:0'; +$filterTable->data[0][0] = __('Search'); +$filterTable->data[1][0] .= html_print_input_text( + 'search_string', + $search_string, + '', + 30, + 255, + true, + false, + false, + '', + '' +); +$filterTable->data[0][0] .= html_print_input_hidden('search', 1, true); + +if ((bool) $policy_page === false) { + $filterTable->data[0][1] = __('Show in hierachy mode'); + $filterTable->data[1][1] = html_print_checkbox_switch( + 'status_hierachy_mode', + ((string) $checked), + ((string) $checked), + true, + false, + 'onChange=change_mod_filter();' + ); +} + +$filterTable->data[1][2] = html_print_submit_button( + __('Filter'), + 'filter', + false, + [ + 'icon' => 'search', + 'class' => 'float-right', + 'mode' => 'secondary mini', + ], + true +); + +// Print filter table. +echo '
'; +ui_toggle( + html_print_table($filterTable, true).'
', + ''.__('Filter').'', + __('Filter'), + 'filter', + true, + false, + '', + 'white-box-content no_border', + 'filter-datatable-main box-flat white_table_graph fixed_filter_bar' +); +echo ''; + + if (isset($id_agente) === false) { return; @@ -1199,14 +1265,17 @@ html_print_div( if (/checked/.test(window.location)) { var url = window.location.toString(); if (checked) { - window.location = url.replace("checked=false", "checked=true"); + //window.location = url.replace("checked=0", "checked=1"); + $("#checkbox-status_hierachy_mode").val('1'); } else { - window.location = url.replace("checked=true", "checked=false"); + //window.location = url.replace("checked=1", "checked=0"); + $("#checkbox-status_hierachy_mode").val('0'); } } else { - window.location = window.location + "&checked=true"; + //window.location = window.location + "&checked=1"; + $("#checkbox-status_hierachy_mode").val('1'); } } From 10c7d4dddb2046752d82a1b0e065dfa68718ac33 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 13 Apr 2023 13:54:11 +0200 Subject: [PATCH 04/29] #15263 created filter for modules --- pandora_console/godmode/agentes/module_manager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 92bb1f224e..f4881c0373 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -73,6 +73,7 @@ $filterTable->data[1][0] .= html_print_input_text( '', '' ); + $filterTable->data[0][0] .= html_print_input_hidden('search', 1, true); if ((bool) $policy_page === false) { From 5cb01d2079d7e616f1e5ce567f6078b6b23010cf Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Wed, 3 May 2023 09:20:40 +0200 Subject: [PATCH 05/29] #10860 Create function get_agent_module_childs --- .../agentes/module_manager_editor_common.php | 17 ++++++++++++++ pandora_console/include/functions_modules.php | 23 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 1f0f3c59c2..41f45ef9ef 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -32,6 +32,7 @@ require_once $config['homedir'].'/include/functions_categories.php'; require_once $config['homedir'].'/include/graphs/functions_d3.php'; use PandoraFMS\Agent; +use Psr\Log\NullLogger; include_javascript_d3(); @@ -944,6 +945,15 @@ $table_advanced->data['tags_module_parent'][0] .= html_print_div( if ((bool) $in_policies_page === false) { // Cannot select the current module to be itself parent. + if ($id_agent_module !== 0) { + $module_parent_filter['tagente_modulo.id_agente_modulo'] = '<>'.$id_agent_module; + $array_parent_module_id = []; + get_agent_module_childs($array_parent_module_id, $id_agent_module, $id_agente); + } else { + $module_parent_filter = []; + $array_parent_module_id = []; + } + $module_parent_filter = ($id_agent_module) ? ['tagente_modulo.id_agente_modulo' => '<>'.$id_agent_module] : []; $table_advanced->data['caption_tags_module_parent'][1] = __('Module parent'); // TODO. Review cause dont know not works. @@ -959,6 +969,13 @@ if ((bool) $in_policies_page === false) { false, $module_parent_filter ); + + if (empty($array_parent_module_id) === false) { + foreach ($array_parent_module_id as $key => $value) { + unset($modules_can_be_parent[$value]); + } + } + // If the user cannot have access to parent module, only print the name. if ((int) $parent_module_id !== 0 && in_array($parent_module_id, array_keys($modules_can_be_parent)) === true diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 385db94ef8..649466a950 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -4655,3 +4655,26 @@ function policies_type_modules_availables(string $sec2): array return $modules; } + + +function get_agent_module_childs( + &$array_parent_module_id=[], + $id_agent_module=false, + $id_agente=false +) { + if ($array_parent_module_id !== false && $id_agent_module !== false && $id_agente !== false) { + $parent['parent_module_id'] = $id_agent_module; + $module_childs_id = agents_get_modules( + $id_agente, + 'parent_module_id', + $parent + ); + + foreach ($module_childs_id as $key => $value) { + if ($value !== 0) { + $array_parent_module_id[] = $key; + get_agent_module_childs($array_parent_module_id, $key, $id_agente); + } + } + } +} From 0e58a9b2fb560976465f5373bd9f5af652d29fe3 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 8 May 2023 14:46:46 +0200 Subject: [PATCH 06/29] #added new type bars in widget and change legend --- .../include/lib/Dashboard/Widgets/top_n.php | 107 +++++++++++++++--- 1 file changed, 92 insertions(+), 15 deletions(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/top_n.php b/pandora_console/include/lib/Dashboard/Widgets/top_n.php index da69efe414..d11718ee43 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/top_n.php +++ b/pandora_console/include/lib/Dashboard/Widgets/top_n.php @@ -201,6 +201,25 @@ class TopNWidget extends Widget $values['period'] = SECONDS_1DAY; } + // Type graph. + $fields = [ + 'bar_vertical' => __('Vertical bars'), + 'bar_horizontal' => __('Horizontal bars'), + 'pie' => __('Pie'), + ]; + + $inputs[] = [ + 'label' => __('Type of graph'), + 'arguments' => [ + 'type' => 'select', + 'fields' => $fields, + 'name' => 'type_graph', + 'selected' => $values['type_graph'], + 'return' => true, + 'sort' => false, + ], + ]; + // Agent. $inputs[] = [ 'label' => __('Agent').ui_print_help_tip( @@ -294,6 +313,25 @@ class TopNWidget extends Widget ], ]; + // Legend. + $fields = [ + 'agent_module' => __('Agent & module'), + 'agent' => __('Agent'), + 'module' => __('Module'), + ]; + + $inputs[] = [ + 'label' => __('Legend'), + 'arguments' => [ + 'type' => 'select', + 'fields' => $fields, + 'name' => 'legend', + 'selected' => $values['legend'], + 'return' => true, + 'sort' => false, + ], + ]; + return $inputs; } @@ -314,6 +352,8 @@ class TopNWidget extends Widget $values['quantity'] = \get_parameter('quantity', 5); $values['order'] = \get_parameter('order', 1); $values['display'] = \get_parameter('display', REPORT_TOP_N_AVG); + $values['type_graph'] = \get_parameter('type_graph', 'bar_horizontal'); + $values['legend'] = \get_parameter('legend', 'agent_module'); return $values; } @@ -476,13 +516,28 @@ class TopNWidget extends Widget foreach ($modules as $module) { $module['aliasAgent'] = ui_print_truncate_text($module['aliasAgent'], 20, false, true, false); - $item_name = $module['aliasAgent'].' - '.$module['nameModule']; + switch ($this->values['legend']) { + case 'agent_module': + $item_name = $module['aliasAgent'].' - '.$module['nameModule']; + break; + + case 'agent': + $item_name = $module['aliasAgent']; + break; + + case 'module': + $item_name = $module['nameModule']; + break; + + default: + $item_name = $module['aliasAgent'].' - '.$module['nameModule']; + break; + } + $labels[] = io_safe_output($item_name); - $data_hbar[] = [ - 'x' => $module[$display], - 'y' => io_safe_output($item_name), - ]; + $data[] = $module[$display]; + // Calculation of max-min values for show in graph. $calc = (ceil((5 * (float) $module[$display]) / 100) + $module[$display]); // Set of max-min values for graph. @@ -502,27 +557,49 @@ class TopNWidget extends Widget $valueMax += 10; } - $height = (count($data_hbar) * 25 + 35); + $height = (count($data) * 25 + 35); $output .= '
'; $options = [ 'height' => $height, - 'axis' => 'y', 'legend' => ['display' => false], - 'scales' => [ + 'labels' => $labels, + ]; + + if ($this->values['type_graph'] !== 'pie') { + $options['scales'] = [ 'x' => [ 'grid' => ['display' => false], ], 'y' => [ 'grid' => ['display' => false], ], - ], - 'labels' => $labels, - ]; + ]; + } + + switch ($this->values['type_graph']) { + case 'bar_horizontal': + $options['axis'] = 'y'; + $output .= vbar_graph( + $data, + $options + ); + break; + + case 'pie': + $output .= pie_graph( + $data, + $options + ); + break; + + default: + $output .= vbar_graph( + $data, + $options + ); + break; + } - $output .= vbar_graph( - $data_hbar, - $options - ); $output .= '
'; return $output; From f8f53a0b62caae6706483f5778d2243788612315 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Tue, 9 May 2023 13:01:42 +0200 Subject: [PATCH 07/29] #9610 Add OS filter and OS version filter in bulk operation --- pandora_console/godmode/groups/group_list.php | 10 ++++++ .../include/functions_massive_operations.php | 33 ++++++++++++++++--- .../javascript/jquery.pandora.controls.js | 11 ++++--- .../include/javascript/massive_operations.js | 19 +++++++++++ 4 files changed, 64 insertions(+), 9 deletions(-) diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 2747b2be2e..66e6173068 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -107,6 +107,8 @@ if (is_ajax() === true) { // Ids of agents to be include in the SQL clause as id_agent IN (). $filter_agents_json = (string) get_parameter('filter_agents_json', ''); $status_agents = (int) get_parameter('status_agents', AGENT_STATUS_ALL); + $os_agent = (int) get_parameter('os_agent', 0); + $os_agent_version = (string) get_parameter('os_agent_version', ''); // Juanma (22/05/2014) Fix: If setted remove void agents from result // (by default and for compatibility show void agents). $show_void_agents = (int) get_parameter('show_void_agents', 1); @@ -152,6 +154,14 @@ if (is_ajax() === true) { $filter['status'] = $status_agents; } + if ($os_agent !== 0) { + $filter['id_os'] = $os_agent; + } + + if ($os_agent_version !== '') { + $filter['os_version'] = $os_agent_version; + } + if ($id_os !== 0) { $filter['id_os'] = $id_os; } diff --git a/pandora_console/include/functions_massive_operations.php b/pandora_console/include/functions_massive_operations.php index 890940b8dd..31132cb048 100644 --- a/pandora_console/include/functions_massive_operations.php +++ b/pandora_console/include/functions_massive_operations.php @@ -214,10 +214,33 @@ function get_table_inputs_masive_agents($params) ); } - $table->data[3][0] = __('Agents'); - $table->data[3][0] .= ''; + $os_list = os_get_os(true); + + $table->data[3][0] = __('OS'); + $table->data[3][1] = html_print_select( + $os_list, + 'os_agent', + 'selected', + '', + __('All'), + '', + true + ); + + $table->data[3][2] = __('OS Version'); + $table->data[3][3] = html_print_input_text( + 'os_agent_version', + '', + __('Select OS version'), + 35, + 255, + true + ); + + $table->data[4][0] = __('Agents'); + $table->data[4][0] .= ''; $agents = []; if (is_metaconsole() === false) { @@ -228,7 +251,7 @@ function get_table_inputs_masive_agents($params) ); } - $table->data[3][1] = html_print_select( + $table->data[4][1] = html_print_select( $agents, 'id_agents[]', 0, diff --git a/pandora_console/include/javascript/jquery.pandora.controls.js b/pandora_console/include/javascript/jquery.pandora.controls.js index 731ce0c761..c42f205b60 100644 --- a/pandora_console/include/javascript/jquery.pandora.controls.js +++ b/pandora_console/include/javascript/jquery.pandora.controls.js @@ -22,7 +22,9 @@ privilege: "", serialized: false, serialized_separator: "", - nodes: [] + nodes: [], + id_os: -1, + os_agent_version: "" }; /* public methods */ @@ -53,7 +55,7 @@ } else { recursion_value = config.recursion; } - + var opts = { page: "godmode/groups/group_list", get_group_agents: 1, @@ -74,7 +76,9 @@ nodes: typeof config.nodes === "function" ? config.nodes() - : config.disabled + : config.disabled, + os_agent: config.os_agent, + os_agent_version: config.os_agent_version }; jQuery.post( @@ -319,7 +323,6 @@ let href = $("a", config.spanPreview).attr("href"); let hrefPosition = href.search("group_id="); let hrefNew = href.slice(0, hrefPosition) + "group_id=" + id_group; - jQuery.post( "ajax.php", { diff --git a/pandora_console/include/javascript/massive_operations.js b/pandora_console/include/javascript/massive_operations.js index 6a372f703e..e5edfe1dce 100644 --- a/pandora_console/include/javascript/massive_operations.js +++ b/pandora_console/include/javascript/massive_operations.js @@ -110,6 +110,18 @@ function form_controls_massive_operations_agents(metaconsole) { $("#id_group").trigger("change"); }); + var os_agent; + $("#os_agent").change(function() { + os_agent = this.value; + $("#id_group").trigger("change"); + }); + + var os_agent_version; + $("#text-os_agent_version").keyup(function() { + os_agent_version = this.value; + $("#id_group").trigger("change"); + }); + if (metaconsole == 1) { $("#nodes").change(function() { disabled = $("#disabled").val(); @@ -142,6 +154,13 @@ function form_controls_massive_operations_agents(metaconsole) { }, disabled: function() { return disabled; + }, + os_agent: function() { + return os_agent; + }, + os_agent_version: function() { + console.log(os_agent_version); + return os_agent_version; } }; From e29fef437be7b6a0cf3a973b379dfe81799b2597 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 17 May 2023 13:15:26 +0200 Subject: [PATCH 08/29] #11231 added token for filter recursively in remote component --- .../modules/manage_network_components.php | 17 ++++++++++++-- .../include/functions_network_components.php | 23 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index 7ef20ca385..1af17e323c 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -602,6 +602,7 @@ if ((bool) $id !== false || $new_component $search_id_group = (int) get_parameter('search_id_group'); +$group_recursive = (bool) get_parameter_switch('group_recursive', false); $search_string = (string) get_parameter('search_string'); $offset = (int) get_parameter('offset'); @@ -672,7 +673,15 @@ $table->data[0][] = html_print_label_input_block( 'width: 100%' ) ); - +$table->data[0][] = html_print_label_input_block( + __('Recursive'), + html_print_checkbox_switch( + 'group_recursive', + 1, + $group_recursive, + true + ) +); $table->data[0][] = html_print_label_input_block( __('Free Search'), html_print_input_text( @@ -722,7 +731,11 @@ ui_toggle( $filter = []; if ($search_id_group) { - $filter['id_group'] = $search_id_group; + if ($group_recursive === true) { + $filter['id_group'] = network_component_get_groups_recursive($search_id_group); + } else { + $filter['id_group'] = $search_id_group; + } } if ($search_string != '') { diff --git a/pandora_console/include/functions_network_components.php b/pandora_console/include/functions_network_components.php index f6c0087b37..7ca97d65c4 100644 --- a/pandora_console/include/functions_network_components.php +++ b/pandora_console/include/functions_network_components.php @@ -594,3 +594,26 @@ function network_components_duplicate_network_component($id_local_component) return network_components_create_network_component($name, $network['type'], $network['id_group'], $network); } + + +/** + * Return all children groups recursive include parent. + * + * @param integer $id_parent Id of parent. + * @param array $groups NO setting, array for recursive. + * + * @return array $groups All children ids include first parent. + */ +function network_component_get_groups_recursive($id_parent, $groups=[]) +{ + $groups[] = $id_parent; + $ids = db_get_all_rows_filter('tnetwork_component_group', ['parent' => $id_parent], 'id_sg'); + + if ($ids !== false) { + foreach ($ids as $key => $id) { + $groups = network_component_get_groups_recursive($id['id_sg'], $groups); + } + } + + return $groups; +} From e783cd6f297bceae9df0d57ffb969cb737241e4b Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Tue, 23 May 2023 15:20:30 +0200 Subject: [PATCH 09/29] #11287 Add title to image --- pandora_console/include/ajax/module.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index b20bad2a18..9e3e2580af 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -1267,7 +1267,10 @@ if (check_login()) { 'content' => html_print_image( 'images/module-graph.svg', true, - [ 'class' => 'main_menu_icon' ] + [ + 'title' => $module['nombre'], + 'class' => 'main_menu_icon forced_title', + ] ), ], true From ec334f252e884aa56251dc4eb55e70b1e61f4d41 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 25 May 2023 11:38:01 +0200 Subject: [PATCH 10/29] #11267 fix inverse critical switch template load --- pandora_console/include/javascript/pandora_modules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index 220459bacd..a5e55809fb 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -492,7 +492,7 @@ function configure_modules_form() { data["unit"] == "" ? "" : data["unit"] ); - $("#checkbox-critical_inverse").prop( + $("#checkbox-critical_inverse_string").prop( "checked", data["critical_inverse"] ); From c21e26ee1f08e95a03687cf60b06dc3952576855 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Fri, 26 May 2023 13:54:11 +0200 Subject: [PATCH 11/29] #11370 Fix default value selected --- .../godmode/agentes/module_manager_editor_network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 9c6142ee8d..9d08fe7ed0 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -245,7 +245,7 @@ $snmp_versions['3'] = 'v. 3'; $snmpVersionsInput = html_print_select( $snmp_versions, 'snmp_version', - ($id_module_type >= 15 && $id_module_type <= 18) ? $snmp_version : 0, + ($id_module_type >= 15 && $id_module_type <= 18) ? $snmp_version : '2c', '', '', '', From 206daabbd758224ab150fb976a6612b6b0e6578c Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 29 May 2023 10:59:12 +0200 Subject: [PATCH 12/29] #11379 fixed filter in agent list when use action --- pandora_console/godmode/agentes/modificar_agente.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 0b27809299..dfd691bd1a 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -929,7 +929,7 @@ if ($agents !== false) { [ 'href' => ui_get_full_url( sprintf( - 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&%s_agent=%s&group_id=%s&recursion=%s&search=%s&offset=%s&sort_field=%s&sort=%s&disabled=%s', + 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&%s_agent=%s&group_id=%s&recursion=%s&search=%s&offset=%s&sort_field=%s&sort=%s&disabled=%s&os=%s', $agentDisableEnableAction, $agent['id_agente'], $ag_group, @@ -938,7 +938,8 @@ if ($agents !== false) { '', $sortField, $sort, - $disabled + $disabled, + $os ) ), 'onClick' => ($agent['id_os'] === CLUSTER_OS_ID) ? sprintf('if (!confirm(\'%s\')) return false', $agentDisableEnableCaption) : 'return true;', From d12d98d458633fb13b1dfe804e1c3b05e54bcbc8 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Fri, 2 Jun 2023 11:42:18 +0200 Subject: [PATCH 13/29] #11287 Fix title icons --- pandora_console/include/ajax/module.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 9e3e2580af..1c9dbf3598 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -1252,7 +1252,10 @@ if (check_login()) { 'content' => html_print_image( 'images/event-history.svg', true, - [ 'class' => 'main_menu_icon' ] + [ + 'title' => __('Event history'), + 'class' => 'main_menu_icon forced_title', + ] ), ], true @@ -1268,7 +1271,7 @@ if (check_login()) { 'images/module-graph.svg', true, [ - 'title' => $module['nombre'], + 'title' => __('Module graph'), 'class' => 'main_menu_icon forced_title', ] ), @@ -1287,7 +1290,10 @@ if (check_login()) { 'content' => html_print_image( 'images/simple-value.svg', true, - [ 'class' => 'main_menu_icon' ] + [ + 'title' => __('Module detail'), + 'class' => 'main_menu_icon forced_title', + ] ), ], true From 964c1f3142c88e98226569cf59fff00f7fea8192 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Fri, 2 Jun 2023 12:03:29 +0200 Subject: [PATCH 14/29] #11287 Fix title icons --- pandora_console/include/ajax/module.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 1c9dbf3598..fe6ba7ae01 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -1329,7 +1329,10 @@ if (check_login()) { 'content' => html_print_image( $imgaction, true, - [ 'class' => 'main_menu_icon' ] + [ + 'title' => __('Force remote check'), + 'class' => 'main_menu_icon forced_title', + ] ), ], true @@ -1346,7 +1349,10 @@ if (check_login()) { 'content' => html_print_image( 'images/edit.svg', true, - [ 'class' => 'main_menu_icon' ] + [ + 'title' => __('Edit configuration'), + 'class' => 'main_menu_icon forced_title', + ] ), ], true From 0b3f23f137ce45d35a288f1b58ff8199c66dfc95 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 5 Jun 2023 12:45:37 +0200 Subject: [PATCH 15/29] #11465 fixed agent module widget when server is restarted --- pandora_console/include/functions_modules.php | 4 + .../lib/Dashboard/Widgets/agent_module.php | 92 +++++++++++++++++-- 2 files changed, 88 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 26e63c5975..96f4f52447 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -3676,6 +3676,10 @@ function get_modules_agents( implode(',', $id_agents) ) ); + + if ($rows === false) { + $rows = []; + } } else { $rows = []; } diff --git a/pandora_console/include/lib/Dashboard/Widgets/agent_module.php b/pandora_console/include/lib/Dashboard/Widgets/agent_module.php index 02368a42c7..ddbb3689e8 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/agent_module.php +++ b/pandora_console/include/lib/Dashboard/Widgets/agent_module.php @@ -292,6 +292,10 @@ class AgentModuleWidget extends Widget } } + if (is_metaconsole() === true) { + $this->values['mAgents'] = $this->getIdCacheAgent($this->values['mAgents']); + } + $inputs[] = [ 'class' => 'flex flex-row', 'id' => 'select_multiple_modules_filtered', @@ -315,6 +319,65 @@ class AgentModuleWidget extends Widget } + /** + * Return array with the real id agent and server. + * + * @param string $id_agents_cache String with the agents cache id. + * + * @return string $agents_servers with the real id agent and server. + */ + public function getRealIdAgentNode($id_agents_cache) + { + $agents_servers = []; + $target_agents = explode(',', $id_agents_cache); + foreach ($target_agents as $agent_id) { + $id_agente = $agent_id; + $tmeta_agent = db_get_row_filter( + 'tmetaconsole_agent', + ['id_agente' => $id_agente] + ); + + $id_agente = $tmeta_agent['id_tagente']; + $tserver = $tmeta_agent['id_tmetaconsole_setup']; + $agents_servers[] = $tserver.'|'.$id_agente; + } + + return implode(',', $agents_servers); + } + + + /** + * Return string with the cache id agent in metaconsole. + * + * @param string $id_agents String with the agents and server id. + * + * @return string $cache_id_agents with the cache id agent. + */ + public function getIdCacheAgent($id_agents) + { + $target_agents = explode(',', $id_agents); + $cache_id_agents = []; + foreach ($target_agents as $agent_id) { + if (str_contains($agent_id, '|') === false) { + $cache_id_agents[] = $agent_id; + continue; + } + + $server_agent = explode('|', $agent_id); + $tmeta_agent = db_get_row_filter( + 'tmetaconsole_agent', + [ + 'id_tagente' => $server_agent[1], + 'id_tmetaconsole_setup' => $server_agent[0], + ] + ); + $cache_id_agents[] = $tmeta_agent['id_agente']; + } + + return implode(',', $cache_id_agents); + } + + /** * Get Post for widget. * @@ -341,6 +404,10 @@ class AgentModuleWidget extends Widget $values['mAgents'] = \get_parameter( 'filtered-module-agents-'.$this->cellId ); + if (is_metaconsole() === true) { + $values['mAgents'] = $this->getRealIdAgentNode($values['mAgents']); + } + $values['mShowCommonModules'] = \get_parameter( 'filtered-module-show-common-modules-'.$this->cellId ); @@ -697,15 +764,24 @@ class AgentModuleWidget extends Widget $target_agents = explode(',', $this->values['mAgents']); foreach ($target_agents as $agent_id) { try { - $id_agente = $agent_id; - if ((bool) is_metaconsole() === true) { - $tmeta_agent = db_get_row_filter( - 'tmetaconsole_agent', - [ 'id_agente' => $id_agente ] - ); + if (is_metaconsole() === true && str_contains($agent_id, '|') === true) { + $server_agent = explode('|', $agent_id); + } else { + $id_agente = $agent_id; + } - $id_agente = $tmeta_agent['id_tagente']; - $tserver = $tmeta_agent['id_tmetaconsole_setup']; + if ((bool) is_metaconsole() === true) { + if (isset($server_agent) === true) { + $id_agente = $server_agent[1]; + $tserver = $server_agent[0]; + } else { + $tmeta_agent = db_get_row_filter( + 'tmetaconsole_agent', + [ 'id_agente' => $id_agente ] + ); + $id_agente = $tmeta_agent['id_tagente']; + $tserver = $tmeta_agent['id_tmetaconsole_setup']; + } if (metaconsole_connect(null, $tserver) !== NOERR) { continue; From 6c00b3955087b067cb23ceb4389babe45f766b0d Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 5 Jun 2023 16:43:27 +0200 Subject: [PATCH 16/29] #11460 fixed widgets Top N events by agent and Top N events by module --- .../Widgets/top_n_events_by_group.php | 108 +++++++++---- .../Widgets/top_n_events_by_module.php | 145 +++++++++++++----- 2 files changed, 186 insertions(+), 67 deletions(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_group.php b/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_group.php index 8c4fece94e..a9905c9670 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_group.php +++ b/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_group.php @@ -385,33 +385,81 @@ class TopNEventByGroupWidget extends Widget $all_group = true; } - if ($all_group === false) { - $sql = sprintf( - 'SELECT id_agente, COUNT(*) AS count - FROM tevento - WHERE utimestamp >= %d - AND id_grupo IN (%s) - GROUP BY id_agente - ORDER BY count DESC - LIMIT %d', - $timestamp, - implode(',', $this->values['groupId']), - $this->values['amountShow'] - ); - } else { - $sql = sprintf( - 'SELECT id_agente, COUNT(*) AS count - FROM tevento - WHERE utimestamp >= %d - GROUP BY id_agente - ORDER BY count DESC - LIMIT %d', - $timestamp, - $this->values['amountShow'] - ); - } + if (is_metaconsole() === true) { + $servers = metaconsole_get_connection_names(); + $result = []; + foreach ($servers as $key => $server) { + $connection = metaconsole_get_connection($server); + if (metaconsole_connect($connection) != NOERR) { + continue; + } - $result = db_get_all_rows_sql($sql); + if ($all_group === false) { + $sql = sprintf( + 'SELECT id_agente, + COUNT(*) AS count, + "'.$connection['id'].'" AS id_server + FROM tevento + WHERE utimestamp >= %d + AND id_grupo IN (%s) + GROUP BY id_agente + ORDER BY count DESC + LIMIT %d', + $timestamp, + implode(',', $this->values['groupId']), + $this->values['amountShow'] + ); + } else { + $sql = sprintf( + 'SELECT id_agente, + COUNT(*) AS count, + "'.$connection['id'].'" AS id_server + FROM tevento + WHERE utimestamp >= %d + GROUP BY id_agente + ORDER BY count DESC + LIMIT %d', + $timestamp, + $this->values['amountShow'] + ); + } + + $rows = db_get_all_rows_sql($sql); + if ($rows !== false) { + $result = array_merge($result, $rows); + } + + metaconsole_restore_db(); + } + } else { + if ($all_group === false) { + $sql = sprintf( + 'SELECT id_agente, COUNT(*) AS count + FROM tevento + WHERE utimestamp >= %d + AND id_grupo IN (%s) + GROUP BY id_agente + ORDER BY count DESC + LIMIT %d', + $timestamp, + implode(',', $this->values['groupId']), + $this->values['amountShow'] + ); + } else { + $sql = sprintf( + 'SELECT id_agente, COUNT(*) AS count + FROM tevento + WHERE utimestamp >= %d + GROUP BY id_agente + ORDER BY count DESC + LIMIT %d', + $timestamp, + $this->values['amountShow'] + ); + } + + $result = db_get_all_rows_sql($sql); + } if (empty($result) === true) { $output .= '
'; @@ -430,11 +478,13 @@ class TopNEventByGroupWidget extends Widget $name = __('System'); } else { if (is_metaconsole() === true) { - $name = (string) db_get_value( + $name = (string) db_get_value_filter( 'alias', 'tmetaconsole_agent', - 'id_tagente', - (int) $row['id_agente'] + [ + 'id_tagente' => $row['id_agente'], + 'id_tmetaconsole_setup' => $row['id_server'], + ] ); } else { $name = io_safe_output( diff --git a/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_module.php b/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_module.php index 0adf0b7975..e528724fd8 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_module.php +++ b/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_module.php @@ -383,39 +383,91 @@ class TopNEventByModuleWidget extends Widget $all_group = true; } - if ($all_group === false) { - $sql = sprintf( - 'SELECT id_agente, - id_agentmodule, - event_type, - COUNT(*) AS count - FROM tevento - WHERE utimestamp >= %d - AND id_grupo IN (%s) - GROUP BY id_agentmodule, event_type - ORDER BY count DESC - LIMIT %d', - $timestamp, - implode(',', $this->values['groupId']), - $this->values['amountShow'] - ); - } else { - $sql = sprintf( - 'SELECT id_agente, - id_agentmodule, - event_type, - COUNT(*) AS count - FROM tevento - WHERE utimestamp >= %d - GROUP BY id_agentmodule, event_type - ORDER BY count DESC - LIMIT %d', - $timestamp, - $this->values['amountShow'] - ); - } + if (is_metaconsole() === true) { + $servers = metaconsole_get_connection_names(); + $result = []; + foreach ($servers as $key => $server) { + $connection = metaconsole_get_connection($server); + if (metaconsole_connect($connection) != NOERR) { + continue; + } - $result = db_get_all_rows_sql($sql); + if ($all_group === false) { + $sql = sprintf( + 'SELECT id_agente, + id_agentmodule, + event_type, + "'.$server.'" AS name_server, + COUNT(*) AS count + FROM tevento + WHERE utimestamp >= %d + AND id_grupo IN (%s) + GROUP BY id_agentmodule, event_type + ORDER BY count DESC + LIMIT %d', + $timestamp, + implode(',', $this->values['groupId']), + $this->values['amountShow'] + ); + } else { + $sql = sprintf( + 'SELECT id_agente, + id_agentmodule, + event_type, + "'.$server.'" AS name_server, + COUNT(*) AS count + FROM tevento + WHERE utimestamp >= %d + GROUP BY id_agentmodule, event_type + ORDER BY count DESC + LIMIT %d', + $timestamp, + $this->values['amountShow'] + ); + } + + $rows = db_get_all_rows_sql($sql); + if ($rows !== false) { + $result = array_merge($result, $rows); + } + + metaconsole_restore_db(); + } + } else { + if ($all_group === false) { + $sql = sprintf( + 'SELECT id_agente, + id_agentmodule, + event_type, + COUNT(*) AS count + FROM tevento + WHERE utimestamp >= %d + AND id_grupo IN (%s) + GROUP BY id_agentmodule, event_type + ORDER BY count DESC + LIMIT %d', + $timestamp, + implode(',', $this->values['groupId']), + $this->values['amountShow'] + ); + } else { + $sql = sprintf( + 'SELECT id_agente, + id_agentmodule, + event_type, + COUNT(*) AS count + FROM tevento + WHERE utimestamp >= %d + GROUP BY id_agentmodule, event_type + ORDER BY count DESC + LIMIT %d', + $timestamp, + $this->values['amountShow'] + ); + } + + $result = db_get_all_rows_sql($sql); + } if (empty($result) === true) { $output = '
'; @@ -433,13 +485,30 @@ class TopNEventByModuleWidget extends Widget if ($row['id_agentmodule'] == 0) { $name = __('System'); } else { - $name_agent = io_safe_output( - agents_get_alias($row['id_agente']) - ); + if (is_metaconsole() === true) { + $connection = metaconsole_get_connection($row['name_server']); + if (metaconsole_connect($connection) != NOERR) { + continue; + } + + $name_agent = io_safe_output( + agents_get_alias($row['id_agente']) + ); + + $name_module = io_safe_output( + modules_get_agentmodule_name($row['id_agentmodule']) + ); + metaconsole_restore_db(); + } else { + $name_agent = io_safe_output( + agents_get_alias($row['id_agente']) + ); + + $name_module = io_safe_output( + modules_get_agentmodule_name($row['id_agentmodule']) + ); + } - $name_module = io_safe_output( - modules_get_agentmodule_name($row['id_agentmodule']) - ); if ($size['width'] < 400) { $name_agent = ui_print_truncate_text( $name_agent, From 6e8f0d1e931e6848339e6e697fcd0efaceaa4fde Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 6 Jun 2023 14:55:30 +0200 Subject: [PATCH 17/29] #11469 Fixed add selected modules --- pandora_console/operation/agentes/ver_agente.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 2e2ee2e37a..a09fa51844 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -67,6 +67,7 @@ if (is_ajax()) { $agents_inserted = get_parameter('agents_inserted', []); $id_group = (int) get_parameter('id_group'); $pendingdelete = (bool) get_parameter('pendingdelete'); + $get_node_agent = (bool) get_parameter('get_node_agent', false); $refresh_contact = get_parameter('refresh_contact', 0); @@ -1297,6 +1298,18 @@ if (is_ajax()) { return; } + if ($get_node_agent === true) { + $id = get_parameter('id', 0); + if (empty($id) === false) { + $result = db_get_value_sql( + 'SELECT id_tmetaconsole_setup FROM tmetaconsole_agent WHERE id_agente = '.$id + ); + + echo json_encode($result); + return; + } + } + return; } From b0bd5d30595dd903ab521686935943d300e1a482 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 20 Jun 2023 16:36:32 +0200 Subject: [PATCH 18/29] #11628 fix total amount dashboard tactical view --- .../include/functions_reporting.php | 39 ++++--------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 3dcb84a8c1..0eb4530a93 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -14816,7 +14816,13 @@ function reporting_get_stats_servers() 'class' => 'main_menu_icon invert_filter', ] ); - $tdata[1] = ''.html_print_image('images/spinner.gif', true).''; + $sql_count_event = 'SELECT SQL_NO_CACHE COUNT(id_evento) FROM tevento '; + if ($config['event_view_hr']) { + $sql_count_event .= 'WHERE utimestamp > (UNIX_TIMESTAMP(NOW()) - '.($config['event_view_hr'] * SECONDS_1HOUR).')'; + } + + $system_events = db_get_value_sql($sql_count_event); + $tdata[1] = ''.$system_events.''; if (isset($system_events) && $system_events > 50000 && !enterprise_installed()) { $tdata[2] = "
"; @@ -14831,37 +14837,6 @@ function reporting_get_stats_servers() $output = '
'.__('Server performance').''.html_print_table($table_srv, true).'
'; - $public_hash = get_parameter('auth_hash', false); - if ($public_hash === false) { - $output .= ''; - } else { - // This is for public link on the dashboard - $sql_count_event = 'SELECT SQL_NO_CACHE COUNT(id_evento) FROM tevento '; - if ($config['event_view_hr']) { - $sql_count_event .= 'WHERE utimestamp > (UNIX_TIMESTAMP(NOW()) - '.($config['event_view_hr'] * SECONDS_1HOUR).')'; - } - - $system_events = db_get_value_sql($sql_count_event); - - $output .= ''; - } - return $output; } From 69c6c328c2c5ba742e0efe07282cc6bc37b5e53c Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Tue, 27 Jun 2023 11:08:29 +0200 Subject: [PATCH 19/29] #11657 Fix inventory item sql error --- .../godmode/reporting/reporting_builder.item_editor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index eee8a326f7..52e78ad0bf 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1954,7 +1954,7 @@ $class = 'databox filters'; $modulegroup, $id_agents, !$selection_a_m, - true + false ); } From 70ae1f20e4d3cf301b6ea67a746d56917802a589 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 27 Jun 2023 15:11:18 +0200 Subject: [PATCH 20/29] #11648 fixed email send with encrypt password --- pandora_console/include/functions_config.php | 2 +- pandora_server/lib/PandoraFMS/Tools.pm | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index d9196d5967..c616c5837d 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2831,7 +2831,7 @@ function config_process_config() } if (!isset($config['email_from_dir'])) { - config_update_value('email_from_dir', 'pandora@pandorafms.com/community/'); + config_update_value('email_from_dir', 'pandora@pandorafms.com'); } if (!isset($config['email_from_name'])) { diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index fb4b551a3a..56f9f8dfa1 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -774,9 +774,16 @@ sub pandora_sendmail { $mail{Message} = encode("UTF-8", $mail{Message}); $mail{'Content-Type'} = 'text/plain; charset="UTF-8"'; } - + if ($pa_config->{"mta_user"} ne ""){ - $mail{auth} = {user=>$pa_config->{"mta_user"}, password=>$pa_config->{"mta_pass"}, method=>$pa_config->{"mta_auth"}, required=>1 }; + $mail{auth} = { + user=>$pa_config->{"mta_user"}, + password=>PandoraFMS::Core::pandora_output_password( + $pa_config, + safe_output($pa_config->{"mta_pass"}) + ), + method=>$pa_config->{"mta_auth"}, required=>1 + }; } eval { From 7c99e788c7686d7aed544b83ead14ba262a9a8d3 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 27 Jun 2023 15:53:42 +0200 Subject: [PATCH 21/29] #10691 added image no data in pue graph --- .../include/lib/Dashboard/Widgets/top_n.php | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/top_n.php b/pandora_console/include/lib/Dashboard/Widgets/top_n.php index d11718ee43..13d6d919dc 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/top_n.php +++ b/pandora_console/include/lib/Dashboard/Widgets/top_n.php @@ -586,10 +586,26 @@ class TopNWidget extends Widget break; case 'pie': - $output .= pie_graph( - $data, - $options - ); + $empty = true; + foreach ($data as $key => $value) { + if ($value > 0) { + $empty = false; + break; + } + } + + if ($empty === true) { + $output .= html_print_image( + 'images/no_data_toshow.png', + true, + [ 'style' => 'width: 60%;' ] + ); + } else { + $output .= pie_graph( + $data, + $options + ); + } break; default: From 2a6a53ccd51f0a55a6ab3edcda3a037b777c2a41 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Tue, 27 Jun 2023 16:20:30 +0200 Subject: [PATCH 22/29] some fixes --- .../godmode/modules/manage_network_components.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index ffdb29863f..32fe1a7c7f 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -610,8 +610,7 @@ $search_string = (string) get_parameter('search_string'); $offset = (int) get_parameter('offset'); $url = ui_get_url_refresh( [ - 'offset' => $offset, - 'search_string' => $search_string, + 'search_string' => urlencode(io_safe_output($search_string)), 'search_id_group' => $search_id_group, 'id' => $id, ], @@ -691,7 +690,8 @@ $table->data[0][] = html_print_label_input_block( ) ); -$toggleFilters = '
'; +$filter_action_url = 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_network_components&id='.$component['id_nc'].'&search_string='.urlencode(io_safe_output($search_string)).'&search_id_group'.$search_id_group.'&pure='.$pure; +$toggleFilters = ''; $toggleFilters .= html_print_table($table, true); $toggleFilters .= html_print_div( [ From 2366a89850e73146ade8922ebd8209340fc4bddc Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 28 Jun 2023 12:19:05 +0200 Subject: [PATCH 23/29] fixed error --- pandora_console/godmode/modules/manage_network_components.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index 32fe1a7c7f..c7eae109dd 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -738,7 +738,7 @@ $total_components = network_components_get_network_components( 'COUNT(*) AS total' ); $total_components = $total_components[0]['total']; -$offset_delete = ($offset >= ($total_components - 1)) ? ($offset - $config['block_size']) : $offset; +$offset_delete = ($offset > 0 && $offset >= ($total_components - 1)) ? ($offset - $config['block_size']) : $offset; $filter['offset'] = (int) get_parameter('offset'); $filter['limit'] = (int) $config['block_size']; $components = network_components_get_network_components( From 238481fa4cf3b4f39274a5414894c07c637eea78 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 28 Jun 2023 13:01:41 +0200 Subject: [PATCH 24/29] minor fix --- .../update_manager_client/lib/UpdateManager/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/update_manager_client/lib/UpdateManager/Client.php b/pandora_console/update_manager_client/lib/UpdateManager/Client.php index e719017de4..ba1574d8f9 100644 --- a/pandora_console/update_manager_client/lib/UpdateManager/Client.php +++ b/pandora_console/update_manager_client/lib/UpdateManager/Client.php @@ -2094,7 +2094,7 @@ class Client sprintf( 'UPDATE `tconfig` SET `value` = \'%s\' WHERE `token` = "progress_update"', - $updates + mysqli_real_escape_string($this->dbh, $updates) ) ); } From 487b6673d1c001508ce57b7d3f7986974e34d4ee Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 29 Jun 2023 08:09:06 +0200 Subject: [PATCH 25/29] #11671 Fix color in tactical view --- pandora_console/include/functions_reporting.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index aba777f8fb..1842e514e5 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -12302,29 +12302,29 @@ function reporting_get_stats_modules_status($data, $graph_width=250, $graph_heig $tdata = []; $tdata[0] = html_print_div(['class' => 'main_menu_icon module_background_state', 'style' => 'background-color: '.COL_CRITICAL, 'title' => __('Monitor critical')], true); $tdata[1] = $data['monitor_critical'] <= 0 ? '-' : $data['monitor_critical']; - $tdata[1] = ''.$tdata[1].''; + $tdata[1] = ''.$tdata[1].''; $tdata[2] = html_print_div(['class' => 'main_menu_icon module_background_state', 'style' => 'background-color: '.COL_WARNING_DARK, 'title' => __('Monitor warning')], true); $tdata[3] = $data['monitor_warning'] <= 0 ? '-' : $data['monitor_warning']; - $tdata[3] = ''.$tdata[3].''; + $tdata[3] = ''.$tdata[3].''; $table_mbs->rowclass[] = ''; $table_mbs->data[] = $tdata; $tdata = []; $tdata[0] = html_print_div(['class' => 'main_menu_icon module_background_state', 'style' => 'background-color: '.COL_NORMAL, 'title' => __('Monitor normal')], true); $tdata[1] = $data['monitor_ok'] <= 0 ? '-' : $data['monitor_ok']; - $tdata[1] = ''.$tdata[1].''; + $tdata[1] = ''.$tdata[1].''; $tdata[2] = html_print_div(['class' => 'main_menu_icon module_background_state', 'style' => 'background-color: '.COL_UNKNOWN, 'title' => __('Monitor unknown')], true); $tdata[3] = $data['monitor_unknown'] <= 0 ? '-' : $data['monitor_unknown']; - $tdata[3] = ''.$tdata[3].''; + $tdata[3] = ''.$tdata[3].''; $table_mbs->rowclass[] = ''; $table_mbs->data[] = $tdata; $tdata = []; $tdata[0] = html_print_div(['class' => 'main_menu_icon module_background_state', 'style' => 'background-color: '.COL_NOTINIT, 'title' => __('Monitor not init')], true); $tdata[1] = $data['monitor_not_init'] <= 0 ? '-' : $data['monitor_not_init']; - $tdata[1] = ''.$tdata[1].''; + $tdata[1] = ''.$tdata[1].''; $tdata[2] = $tdata[3] = ''; $table_mbs->rowclass[] = ''; From 61ab82d8083dc7b571253c3e3595a656df782672 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 29 Jun 2023 12:59:32 +0200 Subject: [PATCH 26/29] #10304 Fix action default in agent detail --- pandora_console/include/functions_ui.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 95a74394c4..1407dd3421 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1446,13 +1446,22 @@ function ui_format_alert_row( $actionText .= '
'; - if ($actionDefault != '') { - $actionText .= db_get_sql( + if ($actionDefault !== '') { + $actionDefault_name = db_get_sql( sprintf( 'SELECT name FROM talert_actions WHERE id = %d', $actionDefault ) - ).' ('.__('Default').')'; + ); + foreach ($actions as $action) { + if ($actionDefault_name === $action['name']) { + $hide_actionDefault = true; + } + } + + if ($hide_actionDefault !== true) { + $actionText .= $actionDefault_name.' ('.__('Default').')'; + } } } From a2faf2cd58201145f7382e98a0358e0e2c0ed515 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 1 Jul 2023 01:02:08 +0200 Subject: [PATCH 27/29] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index a4b3c2d2f5..d9a9bc52ec 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.772-230630 +Version: 7.0NG.772-230701 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 b9dfc5147e..7b3fec0c3b 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.772-230630" +pandora_version="7.0NG.772-230701" 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 4b81038151..8f141d82ef 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.772'; -use constant AGENT_BUILD => '230630'; +use constant AGENT_BUILD => '230701'; # 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 407bbb26df..750d5a3598 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.772 -%define release 230630 +%define release 230701 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 04272994b2..fe998f82f8 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.772 -%define release 230630 +%define release 230701 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 1975af3439..13cd5cfa37 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230630" +PI_BUILD="230701" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index fff4dcaf99..47c43482a2 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230630} +{230701} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 7ad91b237a..4dac7eb7d2 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.772 Build 230630") +#define PANDORA_VERSION ("7.0NG.772 Build 230701") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 63ed2aab87..834f0dbed0 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.772(Build 230630))" + VALUE "ProductVersion", "(7.0NG.772(Build 230701))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9870245294..e3714a26d3 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230630 +Version: 7.0NG.772-230701 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 e39a6f25d9..25a413e00b 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.772-230630" +pandora_version="7.0NG.772-230701" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6be9630912..2977984d2c 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 = 'PC230630'; +$build_version = 'PC230701'; $pandora_version = 'v7.0NG.772'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 2e2b066d0a..28dce49f3e 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index aacc28de75..61aedd7315 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.772 -%define release 230630 +%define release 230701 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 446f4230cd..4b234d4df8 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.772 -%define release 230630 +%define release 230701 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 1a4f39d8ab..e5a1186bea 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230630" +PI_BUILD="230701" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index a210640a3a..17f6f8cce2 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.772 Build 230630"; +my $version = "7.0NG.772 Build 230701"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 76106cdbda..25bc42ee9b 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.772 Build 230630"; +my $version = "7.0NG.772 Build 230701"; # save program name for logging my $progname = basename($0); From 1d3f1b38fa5bdeeac2a2b975a4bb59f36600e48b Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 2 Jul 2023 01:00:46 +0200 Subject: [PATCH 28/29] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index d9a9bc52ec..f6195b9bf9 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.772-230701 +Version: 7.0NG.772-230702 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 7b3fec0c3b..20a530108d 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.772-230701" +pandora_version="7.0NG.772-230702" 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 8f141d82ef..d162a235e0 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.772'; -use constant AGENT_BUILD => '230701'; +use constant AGENT_BUILD => '230702'; # 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 750d5a3598..5ddeeeb476 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.772 -%define release 230701 +%define release 230702 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 fe998f82f8..5cc05fb3df 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.772 -%define release 230701 +%define release 230702 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 13cd5cfa37..dbea4bb44c 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230701" +PI_BUILD="230702" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 47c43482a2..a79785acd7 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230701} +{230702} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 4dac7eb7d2..88a347eec5 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.772 Build 230701") +#define PANDORA_VERSION ("7.0NG.772 Build 230702") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 834f0dbed0..bde2f75178 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.772(Build 230701))" + VALUE "ProductVersion", "(7.0NG.772(Build 230702))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index e3714a26d3..7c7117dabf 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230701 +Version: 7.0NG.772-230702 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 25a413e00b..83f8ae57ea 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.772-230701" +pandora_version="7.0NG.772-230702" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 2977984d2c..0e2dbe12ec 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 = 'PC230701'; +$build_version = 'PC230702'; $pandora_version = 'v7.0NG.772'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 28dce49f3e..a04a94b31b 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 61aedd7315..72ed106097 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.772 -%define release 230701 +%define release 230702 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 4b234d4df8..509a8d16ea 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.772 -%define release 230701 +%define release 230702 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index e5a1186bea..10e9e2e2e6 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230701" +PI_BUILD="230702" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 17f6f8cce2..35588b2785 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.772 Build 230701"; +my $version = "7.0NG.772 Build 230702"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 25bc42ee9b..9ab2ffcc9d 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.772 Build 230701"; +my $version = "7.0NG.772 Build 230702"; # save program name for logging my $progname = basename($0); From 74c4b28fc566da872948cfc742b6febfb1e706ed Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 3 Jul 2023 01:00:41 +0200 Subject: [PATCH 29/29] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index f6195b9bf9..b4c86b6bb4 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.772-230702 +Version: 7.0NG.772-230703 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 20a530108d..ab4db06828 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.772-230702" +pandora_version="7.0NG.772-230703" 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 d162a235e0..99d1cba038 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.772'; -use constant AGENT_BUILD => '230702'; +use constant AGENT_BUILD => '230703'; # 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 5ddeeeb476..aca51417b3 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.772 -%define release 230702 +%define release 230703 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 5cc05fb3df..e8c0c58201 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.772 -%define release 230702 +%define release 230703 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 dbea4bb44c..cf7642e0e6 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230702" +PI_BUILD="230703" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index a79785acd7..a4ea43f56f 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230702} +{230703} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 88a347eec5..1bf2c6d13a 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.772 Build 230702") +#define PANDORA_VERSION ("7.0NG.772 Build 230703") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index bde2f75178..c6a9010073 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.772(Build 230702))" + VALUE "ProductVersion", "(7.0NG.772(Build 230703))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7c7117dabf..28b7eb6ec8 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230702 +Version: 7.0NG.772-230703 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 83f8ae57ea..4b3711632e 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.772-230702" +pandora_version="7.0NG.772-230703" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 0e2dbe12ec..eeebe3539c 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 = 'PC230702'; +$build_version = 'PC230703'; $pandora_version = 'v7.0NG.772'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index a04a94b31b..092c7d2952 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 72ed106097..367d8f193d 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.772 -%define release 230702 +%define release 230703 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 509a8d16ea..265c5fbc9f 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.772 -%define release 230702 +%define release 230703 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 10e9e2e2e6..b9c0218c95 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230702" +PI_BUILD="230703" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 35588b2785..4777e8e6e5 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.772 Build 230702"; +my $version = "7.0NG.772 Build 230703"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 9ab2ffcc9d..4768b4db0f 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.772 Build 230702"; +my $version = "7.0NG.772 Build 230703"; # save program name for logging my $progname = basename($0);