From 8cebe4cd8659e56c99c14fecd835c1ec5a9365b3 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 26 Apr 2023 16:37:09 +0200 Subject: [PATCH 01/66] 10752-Add csv ipam modal --- pandora_console/include/javascript/tree/TreeController.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index a32a749c5e..448b098284 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -1559,7 +1559,10 @@ var TreeController = { this.reload(); }, init: function(data) { - if (data.filter.statusModule === "fired") { + if ( + typeof data.filter !== "undefined" && + data.filter.statusModule === "fired" + ) { const newData = { ajaxUrl: data.ajaxURL, baseURL: data.baseURL, From 886bde919b83958617b3aba6d4a419a3689f149d Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 8 May 2023 14:25:57 +0200 Subject: [PATCH 02/66] 11135-Move js code from ui_print_datatable --- .../godmode/agentes/planned_downtime.list.php | 2 +- pandora_console/godmode/groups/tactical.php | 2 +- .../update_manager/update_manager.history.php | 2 +- .../include/class/AuditLog.class.php | 2 +- .../include/class/CalendarManager.class.php | 2 +- .../include/class/ConfigPEN.class.php | 2 +- .../include/class/CredentialStore.class.php | 2 +- .../include/class/Diagnostics.class.php | 3 +- .../include/class/EventSound.class.php | 2 +- .../include/class/SatelliteAgent.class.php | 2 +- .../class/SatelliteCollection.class.php | 2 +- .../include/class/SnmpConsole.class.php | 2 +- .../include/class/TipsWindow.class.php | 2 +- pandora_console/include/functions_ui.php | 534 +++++------------- .../include/javascript/datatablesFunction.js | 377 +++++++++++++ .../javascript/i18n/dataTables.en.json | 1 - .../lib/Dashboard/Widgets/DataMatrix.php | 2 +- .../lib/Dashboard/Widgets/ModulesByStatus.php | 2 +- pandora_console/include/styles/form.css | 4 + pandora_console/include/styles/pandora.css | 3 +- pandora_console/include/styles/tables.css | 20 + .../operation/agentes/alerts_status.php | 2 +- pandora_console/operation/events/events.php | 2 +- .../operation/inventory/inventory.php | 14 +- pandora_console/views/calendar/list.php | 2 +- pandora_console/views/cluster/list.php | 2 +- pandora_console/views/consoles/list.php | 2 +- 27 files changed, 572 insertions(+), 422 deletions(-) create mode 100644 pandora_console/include/javascript/datatablesFunction.js diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php index da860c1bbc..db22e3a3da 100755 --- a/pandora_console/godmode/agentes/planned_downtime.list.php +++ b/pandora_console/godmode/agentes/planned_downtime.list.php @@ -89,7 +89,7 @@ if (is_ajax() === true) { [ 'id' => 'agent_modules_affected_planned_downtime', 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => 'godmode/agentes/planned_downtime.list', diff --git a/pandora_console/godmode/groups/tactical.php b/pandora_console/godmode/groups/tactical.php index 5339590bc4..588e2bbd76 100644 --- a/pandora_console/godmode/groups/tactical.php +++ b/pandora_console/godmode/groups/tactical.php @@ -187,7 +187,7 @@ try { [ 'id' => 'list_agents_tactical', 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $columnNames, 'return' => true, diff --git a/pandora_console/godmode/update_manager/update_manager.history.php b/pandora_console/godmode/update_manager/update_manager.history.php index e4350a3902..13f50687e0 100644 --- a/pandora_console/godmode/update_manager/update_manager.history.php +++ b/pandora_console/godmode/update_manager/update_manager.history.php @@ -50,7 +50,7 @@ try { [ 'id' => $tableId, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => 'include/ajax/update_manager', diff --git a/pandora_console/include/class/AuditLog.class.php b/pandora_console/include/class/AuditLog.class.php index c16628dd69..db4f2805e0 100644 --- a/pandora_console/include/class/AuditLog.class.php +++ b/pandora_console/include/class/AuditLog.class.php @@ -178,7 +178,7 @@ class AuditLog extends HTML [ 'id' => $this->tableId, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => $this->ajaxController, diff --git a/pandora_console/include/class/CalendarManager.class.php b/pandora_console/include/class/CalendarManager.class.php index d2411e8263..e8603cffe1 100644 --- a/pandora_console/include/class/CalendarManager.class.php +++ b/pandora_console/include/class/CalendarManager.class.php @@ -1040,7 +1040,7 @@ class CalendarManager 'id' => 'templates_alerts_special_days', 'return' => true, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => 'godmode/alerts/alert_special_days', diff --git a/pandora_console/include/class/ConfigPEN.class.php b/pandora_console/include/class/ConfigPEN.class.php index 03638df6f2..654952996f 100644 --- a/pandora_console/include/class/ConfigPEN.class.php +++ b/pandora_console/include/class/ConfigPEN.class.php @@ -612,7 +612,7 @@ class ConfigPEN extends HTML 'id' => $tableId, 'return' => true, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => $this->ajaxController, diff --git a/pandora_console/include/class/CredentialStore.class.php b/pandora_console/include/class/CredentialStore.class.php index 904ddbc6e4..5e500fbde5 100644 --- a/pandora_console/include/class/CredentialStore.class.php +++ b/pandora_console/include/class/CredentialStore.class.php @@ -827,7 +827,7 @@ class CredentialStore extends Wizard [ 'id' => $this->tableId, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => $this->ajaxController, diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index 7599e3c71d..046152bdff 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -1579,7 +1579,7 @@ class Diagnostics extends Wizard [ 'id' => $tableId, 'class' => 'info_table caption_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $columnNames, 'ajax_data' => [ @@ -1591,6 +1591,7 @@ class Diagnostics extends Wizard 'no_sortable_columns' => [-1], 'caption' => $title, 'print' => true, + 'mini_csv' => true, ] ); } else { diff --git a/pandora_console/include/class/EventSound.class.php b/pandora_console/include/class/EventSound.class.php index 41e54cc4ff..e8a65751a2 100644 --- a/pandora_console/include/class/EventSound.class.php +++ b/pandora_console/include/class/EventSound.class.php @@ -320,7 +320,7 @@ class EventSound extends HTML [ 'id' => $this->tableId, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => $this->ajaxController, diff --git a/pandora_console/include/class/SatelliteAgent.class.php b/pandora_console/include/class/SatelliteAgent.class.php index e313a774cd..1c1d759dd3 100644 --- a/pandora_console/include/class/SatelliteAgent.class.php +++ b/pandora_console/include/class/SatelliteAgent.class.php @@ -162,7 +162,7 @@ class SatelliteAgent extends HTML [ 'id' => $this->tableId, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => $this->ajaxController, diff --git a/pandora_console/include/class/SatelliteCollection.class.php b/pandora_console/include/class/SatelliteCollection.class.php index ac4d275aa2..922bcf7309 100644 --- a/pandora_console/include/class/SatelliteCollection.class.php +++ b/pandora_console/include/class/SatelliteCollection.class.php @@ -142,7 +142,7 @@ class SatelliteCollection extends HTML [ 'id' => $this->tableId, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => $this->ajaxController, diff --git a/pandora_console/include/class/SnmpConsole.class.php b/pandora_console/include/class/SnmpConsole.class.php index 1d1a598bc7..441d98f52d 100644 --- a/pandora_console/include/class/SnmpConsole.class.php +++ b/pandora_console/include/class/SnmpConsole.class.php @@ -326,7 +326,7 @@ class SnmpConsole extends HTML [ 'id' => $tableId, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => $this->ajaxController, diff --git a/pandora_console/include/class/TipsWindow.class.php b/pandora_console/include/class/TipsWindow.class.php index 4f913f5a28..48faf5e0c7 100644 --- a/pandora_console/include/class/TipsWindow.class.php +++ b/pandora_console/include/class/TipsWindow.class.php @@ -452,7 +452,7 @@ class TipsWindow [ 'id' => 'list_tips_windows', 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'dom_elements' => 'lpfti', 'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar', 'columns' => $columns, diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 4dcf94edf1..ab35eff26c 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3461,28 +3461,71 @@ function ui_progress_extend( * Generate needed code to print a datatables jquery plugin. * * @param array $parameters All desired data using following format: - * [ - * 'print' => true (by default printed) - * 'id' => datatable id. - * 'class' => datatable class. - * 'style' => datatable style. - * 'order' => [ - * 'field' => column name - * 'direction' => asc or desc - * ], - * 'default_pagination' => integer, default pagination is set to block_size - * 'ajax_url' => 'include/ajax.php' ajax_url. - * 'ajax_data' => [ operation => 1 ] extra info to be sent. - * 'ajax_postprocess' => a javscript function to postprocess data received - * by ajax call. It is applied foreach row and must - * use following format: - * * [code] - * * function (item) { - * * // Process received item, for instance, name: - * * tmp = '' + item.name + ''; - * * item.name = tmp; - * * } - * * [/code] + * + * ```php + * $parameters = [ + * // JS Parameters + * 'serverside' => true, + * 'paging' => true, + * 'default_pagination' => $config['block_size'], + * 'searching' => false, + * 'dom_elements' => "plfrtiB", + * 'pagination_options' => [default_pagination, 5, 10, 20, 100, 200, 500, 1000, "All"], + * 'ordering' => true, + * 'order' => [[0, "asc"]], //['field' => 'column_name', 'direction' => 'asc/desc'] + * 'zeroRecords' => "No matching records found", + * 'emptyTable' => "No data available in table", + * 'no_sortable_columns' => [], //Allows the column name (db) from "columns" parameter + * 'csv_field_separator' => ",", + * 'csv_header' => true, + * 'mini_csv' => false, + * 'mini_pagination' => false, + * 'mini_search' => false, + * 'drawCallback' => undefined, //'console.log(123),' + * 'data_element' => undefined, //Rows processed + * 'ajax_postprocess' => undefined, //'process_datatables_item(item)' + * 'ajax_data' => undefined, //Extra data to be sent ['field1' => 1, 'field2 => 0] + * 'ajax_url' => undefined, + * 'caption' => undefined, + * + * // PHP Parameters + * 'id' => undefined, //Used for table and form id, + * 'columns' =>, + * 'column_names' =>, + * 'filter_main_class' =>, + * 'toggle_collapsed' =>true, + * 'search_button_class' => 'sub filter', + * 'csv' =>=1, + * 'form' => + * ..[ + * ....'id' => $form_id, + * ....'class' => 'flex-row', + * ....'style' => 'width: 100%,', + * ....'js' => '', + * ....'html' => $filter, + * ....'inputs' => [], + * ....'extra_buttons' => $buttons, + * ..], + * 'no_toggle' => false, + * 'form_html' => undefined, + * 'toggle_collapsed' => true, + * 'class' => "", //Datatable class. + * 'style' => "" ,//Datatable style. + * 'return' => false, + * 'print' => true, + * ] + * + * ``` + * + * ```php + * ajax_postprocess => a javscript function to postprocess data received + * by ajax call. It is applied foreach row and must + * use following format: + * function (item) { + * // Process received item, for instance, name: + * tmp = '' + item.name + ''; + * item.name = tmp; + * } * 'columns_names' => [ * 'column1' :: Used as th text. Direct text entry. It could be array: * OR @@ -3499,7 +3542,6 @@ function ui_progress_extend( * 'column2', * ... * ], - * 'no_sortable_columns' => [ indexes ] 1,2... -1 etc. Avoid sorting. * 'form' => [ * 'html' => 'html code' a directly defined inputs in HTML. * 'extra_buttons' => [ @@ -3531,12 +3573,7 @@ function ui_progress_extend( * ] * ], * 'extra_html' => HTML content to be placed after 'filter' section. - * 'drawCallback' => function to be called after draw. Sample in: - * https://datatables.net/examples/advanced_init/row_grouping.html - * ] - * 'zeroRecords' => Message when zero records obtained from filter.(Leave blank for default). - * 'emptyTable' => Message when table data empty.(Leave blank for default). - * End. + * ``` * * @return string HTML code with datatable. * @throws Exception On error. @@ -3553,6 +3590,9 @@ function ui_print_datatable(array $parameters) $form_id = uniqid('datatable_filter_'); } + $parameters['table_id'] = $table_id; + $parameters['form_id'] = $form_id; + if (!isset($parameters['columns']) || !is_array($parameters['columns'])) { throw new Exception('[ui_print_datatable]: You must define columns for datatable'); } @@ -3572,10 +3612,6 @@ function ui_print_datatable(array $parameters) $parameters['default_pagination'] = $config['block_size']; } - if (!isset($parameters['paging'])) { - $parameters['paging'] = true; - } - if (!isset($parameters['filter_main_class'])) { $parameters['filter_main_class'] = ''; } @@ -3584,13 +3620,9 @@ function ui_print_datatable(array $parameters) $parameters['toggle_collapsed'] = true; } - $no_sortable_columns = json_encode([]); - if (isset($parameters['no_sortable_columns'])) { - $no_sortable_columns = json_encode($parameters['no_sortable_columns']); - } - if (!is_array($parameters['order'])) { - $order = '0, "asc"'; + $order = 0; + $direction = 'asc'; } else { if (!isset($parameters['order']['direction'])) { $direction = 'asc'; @@ -3609,45 +3641,35 @@ function ui_print_datatable(array $parameters) } } - $order .= ', "'.$parameters['order']['direction'].'"'; + $direction = $parameters['order']['direction']; } - if (!isset($parameters['ajax_data'])) { - $parameters['ajax_data'] = ''; + $parameters['order']['order'] = $order; + $parameters['order']['direction'] = $direction; + + foreach ($parameters['no_sortable_columns'] as $key => $find) { + $found = array_search( + $parameters['no_sortable_columns'][$key], + $parameters['columns'] + ); + + if ($found !== false) { + unset($parameters['no_sortable_columns'][$key]); + array_push($parameters['no_sortable_columns'], $found); + } + + if (is_int($parameters['no_sortable_columns'][$key]) === false) { + unset($parameters['no_sortable_columns'][$key]); + } } - $search_button_class = 'sub filter'; + $parameters['csvTextInfo'] = __('Export current page to CSV'); + $parameters['csvFileTitle'] = sprintf(__('export_%s_current_page_%s'), $table_id, date('Y-m-d')); + if (isset($parameters['search_button_class'])) { $search_button_class = $parameters['search_button_class']; - } - - if (isset($parameters['pagination_options'])) { - $pagination_options = $parameters['pagination_options']; } else { - $pagination_options = [ - [ - $parameters['default_pagination'], - 5, - 10, - 25, - 100, - 200, - 500, - 1000, - -1, - ], - [ - $parameters['default_pagination'], - 5, - 10, - 25, - 100, - 200, - 500, - 1000, - 'All', - ], - ]; + $search_button_class = 'sub filter'; } if (isset($parameters['datacolumns']) === false @@ -3660,16 +3682,12 @@ function ui_print_datatable(array $parameters) $parameters['csv'] = 1; } - $dom_elements = '"plfrtiB"'; - if (isset($parameters['dom_elements'])) { - $dom_elements = '"'.$parameters['dom_elements'].'"'; - } - $filter = ''; // Datatable filter. if (isset($parameters['form']) && is_array($parameters['form'])) { if (isset($parameters['form']['id'])) { $form_id = $parameters['form']['id']; + $parameters['form_id'] = $form_id; } if (isset($parameters['form']['class'])) { @@ -3787,10 +3805,13 @@ function ui_print_datatable(array $parameters) ) ); $processing .= ''; + $parameters['processing'] = $processing; $zeroRecords = isset($parameters['zeroRecords']) === true ? $parameters['zeroRecords'] : __('No matching records found'); $emptyTable = isset($parameters['emptyTable']) === true ? $parameters['emptyTable'] : __('No data available in table'); + $parameters['zeroRecords'] = $zeroRecords; + $parameters['emptyTable'] = $emptyTable; // Extra html. $extra = ''; if (isset($parameters['extra_html']) && !empty($parameters['extra_html'])) { @@ -3799,8 +3820,8 @@ function ui_print_datatable(array $parameters) // Base table. $table = ''; + $table .= 'class="'.$parameters['class'].'"'; + $table .= 'style="box-sizing: border-box;'.$parameters['style'].'">'; $table .= ''; if (isset($parameters['column_names']) @@ -3827,335 +3848,60 @@ function ui_print_datatable(array $parameters) } $table .= ''; - - if (isset($parameters['data_element']) === true) { - $table .= ''; - foreach ($parameters['data_element'] as $row) { - $table .= ''; - foreach ($row as $td_data) { - $table .= ''; - } - - $table .= ''; - } - - $table .= ''; - - $js = ''; - } - $table .= '
'.$td_data.'
'; - $pagination_class = 'pandora_pagination'; - if (!empty($parameters['pagination_class'])) { - $pagination_class = $parameters['pagination_class']; + $parameters['ajax_url_full'] = ui_get_full_url('ajax.php', false, false, false); + + $parameters['spinnerLoading'] = html_print_image( + 'images/spinner.gif', + true, + [ + 'id' => $form_id.'_loading', + 'class' => 'loading-search-datatables-button', + ] + ); + + $language = substr(get_user_language(), 0, 2); + if (is_metaconsole() === false) { + $parameters['language'] = 'include/javascript/i18n/dataTables.'.$language.'.json'; + } else { + $parameters['language'] = '../../include/javascript/i18n/dataTables.'.$language.'.json'; } - $columns = ''; - for ($i = 1; $i <= (count($parameters['columns']) - 3); $i++) { - if ($i != (count($parameters['columns']) - 3)) { - $columns .= $i.','; - } else { - $columns .= $i; - } + $parameters['phpDate'] = date('Y-m-d'); + $parameters['dataElements'] = json_encode($parameters['data_element']); + + // * START JAVASCRIPT. + if (is_metaconsole() === false) { + $file_path = ui_get_full_url('include/javascript/datatablesFunction.js'); + } else { + $file_path = ui_get_full_url('../../include/javascript/datatablesFunction.js'); } - $export_columns = ''; - if (isset($parameters['csv_exclude_latest']) === true - && $parameters['csv_exclude_latest'] === true - ) { - $export_columns = ',columns: \'th:not(:last-child)\''; - } + $file_content = file_get_contents($file_path); + $json_data = json_encode($parameters); + $json_config = json_encode($config); - if (isset($parameters['data_element']) === false || isset($parameters['print_pagination_search_csv'])) { - if (isset($parameters['ajax_url'])) { - $type_data = 'ajax: { - url: "'.ui_get_full_url('ajax.php', false, false, false).'", - type: "POST", - dataSrc: function (json) { - if($("#'.$form_id.'_search_bt") != undefined) { - $("#'.$form_id.'_loading").remove(); - } + $js = ''; - if (json.error) { - console.error(json.error); - $("#error-'.$table_id.'").html(json.error); - $("#error-'.$table_id.'").dialog({ - title: "Filter failed", - width: 630, - resizable: true, - draggable: true, - modal: false, - closeOnEscape: true, - buttons: { - "Ok" : function () { - $(this).dialog("close"); - } - } - }).parent().addClass("ui-state-error"); - } else {'; - - if (isset($parameters['ajax_return_operation']) === true - && empty($parameters['ajax_return_operation']) === false - && isset($parameters['ajax_return_operation_function']) === true - && empty($parameters['ajax_return_operation_function']) === false - ) { - $type_data .= ' - if (json.'.$parameters['ajax_return_operation'].' !== undefined) { - '.$parameters['ajax_return_operation_function'].'(json.'.$parameters['ajax_return_operation'].'); - } - '; - } - - if (isset($parameters['ajax_postprocess'])) { - $type_data .= ' - if (json.data) { - json.data.forEach(function(item) { - '.$parameters['ajax_postprocess'].' - }); - } else { - json.data = {}; - }'; - } - - $type_data .= ' - return json.data; - } - }, - data: function (data) { - if($("#button-'.$form_id.'_search_bt") != undefined) { - var loading = \''.html_print_image( - 'images/spinner.gif', - true, - [ - 'id' => $form_id.'_loading', - 'class' => 'loading-search-datatables-button', - ] - ).'\'; - $("#button-'.$form_id.'_search_bt").parent().append(loading); - } - - inputs = $("#'.$form_id.' :input"); - - values = {}; - inputs.each(function() { - values[this.name] = $(this).val(); - }) - - $.extend(data, { - filter: values,'."\n"; - - if (is_array($parameters['ajax_data'])) { - foreach ($parameters['ajax_data'] as $k => $v) { - $type_data .= $k.':'.json_encode($v).",\n"; - } - } - - $type_data .= 'page: "'.$parameters['ajax_url'].'" - }); - - return data; - } - },'; - } else { - $type_data = 'data: '.json_encode($parameters['data_element']).','; - } - - $serverside = 'true'; - if (isset($parameters['data_element'])) { - $serverside = 'false'; - } - - // Javascript controller. - $js = ''; - } - - // Order. + $js .= ''; + // * END JAVASCRIPT. $info_msg_arr = []; $info_msg_arr['message'] = $emptyTable; $info_msg_arr['div_class'] = 'info_box_container invisible_important datatable-msg-info-'.$table_id; - $spinner = '
'; + $spinner = '
'; $info_msg = '
'.ui_print_info_message($info_msg_arr).'
'; + $err_msg = '
'; $output = $info_msg.$err_msg.$filter.$extra.$spinner.$table.$js; if (is_ajax() === false) { @@ -4179,7 +3925,7 @@ function ui_print_datatable(array $parameters) false, false ); - $output .= '?v='.$config['current_package'].'"/>'; + $output .= '"/>'; // Load tables.css. $output .= ' 1) { + $( + "div.pagination-child-div > .dataTables_paginate.paging_simple_numbers" + ).show(); + $(`#${dt.id}_paginate`).show(); + } else { + $( + "div.pagination-child-div > .dataTables_paginate.paging_simple_numbers" + ).hide(); + $(`#${dt.id}_paginate`).hide(); + } + } + + function moveElementsToActionButtons() { + $(".action_buttons_right_content").html( + '
' + ); + $(".pagination-child-div").append( + $(`#${dt.id}_wrapper > .dataTables_paginate.paging_simple_numbers`).attr( + "style", + "margin-right: 10px;" + ) + ); + $(".pagination-child-div").append( + $(`#${dt.id}_wrapper > .dataTables_length`) + ); + $(".pagination-child-div").append($(`#${dt.id}_wrapper > .dt-buttons`)); + $(".pagination-child-div").append( + $(`#${dt.id}_wrapper > .dataTables_filter`) + ); + } + + $.fn.dataTable.ext.errMode = "none"; + $.fn.dataTable.ext.classes.sPageButton = paginationClass; + + if (dt.mini_pagination === true) { + $.fn.dataTable.ext.classes.sPageButton = `${paginationClass} mini-pandora-pagination`; + } + + var settings_datatable = { + processing: true, + responsive: true, + serverSide, + paging, + pageLength, + searching, + dom, + lengthMenu, + ordering, + order, + columns: eval(datacolumns), + columnDefs, + language: { + url: dt.language, + processing, + zeroRecords, + emptyTable + }, + buttons: + dt.csv == 1 + ? [ + { + extend: "csv", + className: csvClassName, + text: dt.csvTextInfo, + titleAttr: dt.csvTextInfo, + title: dt.csvFileTitle, + fieldSeparator: csvFieldSeparator, + header: csvHeader, + action: function(e, dt, node, config) { + blockResubmit(node); + // Call the default csvHtml5 action method to create the CSV file + $.fn.dataTable.ext.buttons.csvHtml5.action.call( + this, + e, + dt, + node, + config + ); + }, + exportOptions: { + modifier: { + // DataTables core + order: "current", + page: "All", + search: "applied" + }, + columns: csvExcludeLast + } + } + ] + : [], + initComplete: function(settings, json) { + moveElementsToActionButtons(); + + checkPages(); + + $(`div#${dt.id}-spinner`).hide(); + }, + drawCallback: function(settings) { + if ($(`#${dt.id} tr td`).length == 1) { + $(`.datatable-msg-info-${dt.id}`) + .removeClass("invisible_important") + .show(); + $(`table#${dt.id}`).hide(); + $("div.pagination-child-div").hide(); + $("div.dataTables_info").hide(); + $(`#${dt.id}_wrapper`).hide(); + $(`.action_buttons_right_content .pagination-child-div`).hide(); + } else { + $(`.datatable-msg-info-${dt.id}`).hide(); + $(`table#${dt.id}`).show(); + $("div.pagination-child-div").show(); + $("div.dataTables_info").show(); + $(`#${dt.id}_wrapper`).show(); + + if (typeof dt.drawCallback !== "undefined") { + eval(dt.drawCallback); + } + } + + $(`div#${dt.id}-spinner`).hide(); + + checkPages(); + } + }; + + var ajaxOrData = {}; + if (typeof dt.data_element == "undefined") { + ajaxOrData = { + ajax: { + url: dt.ajax_url_full, + type: "POST", + dataSrc: function(json) { + if ($(`#${dt.form_id}_search_bt`) != undefined) { + $(`#${dt.form_id}_loading`).remove(); + } + + if (json.error) { + console.error(json.error); + $(`#error-${dt.id}`).html(json.error); + $(`#error-${dt.id}`) + .dialog({ + title: "Filter failed", + width: 630, + resizable: true, + draggable: true, + modal: false, + closeOnEscape: true, + buttons: { + Ok: function() { + $(this).dialog("close"); + } + } + }) + .parent() + .addClass("ui-state-error"); + } else { + if (json.ajaxReturn !== "undefined") { + eval(`${ajaxReturnFunction}(${json.ajaxReturn})`); + } + + if (typeof dt.ajax_postprocess !== "undefined") { + if (json.data) { + json.data.forEach(function(item) { + eval(dt.ajax_postprocess); + }); + } else { + json.data = {}; + } + } + + return json.data; + } + }, + data: function(data) { + $(`div#${dt.id}-spinner`).show(); + if ($(`#button-${dt.form_id}_search_bt`) != undefined) { + var loading = ``; + $(`#button-${dt.form_id}_search_bt`) + .parent() + .append(loading); + } + + var inputs = $(`#${dt.form_id} :input`); + + var values = {}; + inputs.each(function() { + values[this.name] = $(this).val(); + }); + + $.extend(data, ajaxData); + + $.extend(data, { + filter: values, + page: dt.ajax_url + }); + + return data; + } + } + }; + } else { + ajaxOrData = { data: dt.data_element }; + } + + $.extend(settings_datatable, ajaxOrData); + var dt_table = $(`#${dt.table_id}`).DataTable(settings_datatable); + + $(`#button-${dt.form_id}_search_bt`).click(function() { + dt_table.draw().page(0); + }); + + if (typeof dt.caption !== "undefined" && dt.caption !== "") { + $(`#${dt.table_id}`).append(`${dt.caption}`); + $(".datatables_thead_tr").css("height", 0); + } + + $(function() { + $(document).on("init.dt", function(ev, settings) { + if (dt.mini_search === true) { + $(`#${dt.id}_filter > label > input`).addClass("mini-search-input"); + } + + $("div.dataTables_length").show(); + $("div.dataTables_filter").show(); + $("div.dt-buttons").show(); + + if (dt_table.page.info().pages === 0) { + $(`.action_buttons_right_content .pagination-child-div`).hide(); + } + + if (dt_table.page.info().pages === 1) { + $(`div.pagination-child-div > #${dt.table_id}_paginate`).hide(); + } else { + $(`div.pagination-child-div > #${dt.table_id}_paginate`).show(); + } + }); + }); +}); + +$(function() { + $(document).on("preInit.dt", function(ev, settings) { + $(`#${dt.id}_wrapper div.dataTables_length`).hide(); + $(`#${dt.id}_wrapper div.dataTables_filter`).hide(); + $(`#${dt.id}_wrapper div.dt-buttons`).hide(); + }); +}); diff --git a/pandora_console/include/javascript/i18n/dataTables.en.json b/pandora_console/include/javascript/i18n/dataTables.en.json index 9ccd76c4ad..d80bbe6e75 100644 --- a/pandora_console/include/javascript/i18n/dataTables.en.json +++ b/pandora_console/include/javascript/i18n/dataTables.en.json @@ -6,7 +6,6 @@ "infoThousands": ",", "lengthMenu": "Show _MENU_ entries", "loadingRecords": "Loading...", - "processing": "Processing...", "search": "Search:", "zeroRecords": "No matching records found", "thousands": ",", diff --git a/pandora_console/include/lib/Dashboard/Widgets/DataMatrix.php b/pandora_console/include/lib/Dashboard/Widgets/DataMatrix.php index 1f3ed213c7..6ba27fbd92 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/DataMatrix.php +++ b/pandora_console/include/lib/Dashboard/Widgets/DataMatrix.php @@ -520,7 +520,7 @@ class DataMatrix extends Widget [ 'id' => $tableId, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => 'include/ajax/module', diff --git a/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php b/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php index 01a8781606..4a804890e2 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php +++ b/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php @@ -416,7 +416,7 @@ class ModulesByStatus extends Widget [ 'id' => $tableId, 'class' => 'info_table align-left-important', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => 'include/ajax/module', diff --git a/pandora_console/include/styles/form.css b/pandora_console/include/styles/form.css index fd7e496aac..a0e5957358 100644 --- a/pandora_console/include/styles/form.css +++ b/pandora_console/include/styles/form.css @@ -365,3 +365,7 @@ form#modal_form_feedback > ul > li > textarea { form#modal_form_feedback > ul > li:not(:first-child) > label { margin-top: 20px !important; } + +table.dataTable { + box-sizing: border-box !important; +} diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index adf1325b07..7577f11985 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -11854,7 +11854,7 @@ span.help_icon_15px > img { /* ==== Spinner ==== */ .spinner-fixed { position: absolute; - left: 40%; + left: 45%; top: 40%; z-index: 1; width: 100px; @@ -11864,6 +11864,7 @@ span.help_icon_15px > img { animation: animate 1.2s linear infinite; margin: auto; margin-bottom: 40px; + text-align: initial; } .spinner-fixed span { position: absolute; diff --git a/pandora_console/include/styles/tables.css b/pandora_console/include/styles/tables.css index 65c1ad32b2..d6fc8453d4 100644 --- a/pandora_console/include/styles/tables.css +++ b/pandora_console/include/styles/tables.css @@ -378,15 +378,35 @@ a.pandora_pagination.current:hover { cursor: pointer; } +.dt-button.buttons-csv.buttons-html5.mini-csv-button { + background-image: url(../../images/file-csv.svg); + background-position: 4px center; + height: 26px; + width: 31px; + margin-left: 10px; + box-shadow: 0px 0px 0px #00000000; + border: 0px; + border-radius: 0px; +} + .dt-button.buttons-csv.buttons-html5:hover { color: #1d7873 !important; border: 2px solid #1d7873 !important; } +.dt-button.buttons-csv.buttons-html5.mini-csv-button:hover { + color: #00000000 !important; + border: 0px !important; +} + .dt-button.buttons-csv.buttons-html5:before { content: "csv"; } +.dt-button.buttons-csv.buttons-html5.mini-csv-button:before { + content: ""; +} + .dt-button.buttons-csv.buttons-html5 span { font-size: 0; } diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 4139d30342..a409373d6f 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -355,7 +355,7 @@ if ($agent_view_page === true) { [ 'id' => 'alerts_status_datatable', 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'no_sortable_columns' => $no_sortable_columns, diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index a826986e95..cb2101813b 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -2503,7 +2503,7 @@ try { [ 'id' => $table_id, 'class' => 'info_table events', - 'style' => 'width: 99%;', + 'style' => 'width: 100%;', 'ajax_url' => 'operation/events/events', 'ajax_data' => [ 'get_events' => 1, diff --git a/pandora_console/operation/inventory/inventory.php b/pandora_console/operation/inventory/inventory.php index ba45efe85a..ea6087ff08 100755 --- a/pandora_console/operation/inventory/inventory.php +++ b/pandora_console/operation/inventory/inventory.php @@ -801,7 +801,7 @@ if ($inventory_module !== 'basic') { [ 'id' => $id_table, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $columns, 'no_sortable_columns' => [], @@ -912,7 +912,7 @@ if ($inventory_module !== 'basic') { [ 'id' => $id_table, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $columns, 'no_sortable_columns' => [], @@ -1073,7 +1073,7 @@ if ($inventory_module !== 'basic') { [ 'id' => $id_table, 'class' => 'info_table w100p', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $columns, 'no_sortable_columns' => [], @@ -1163,7 +1163,7 @@ if ($inventory_module !== 'basic') { [ 'id' => $id_table, 'class' => 'info_table w100p', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $columns, 'no_sortable_columns' => [], @@ -1178,6 +1178,8 @@ if ($inventory_module !== 'basic') { 'emptyTable' => __('No inventory found'), 'return' => true, 'no_sortable_columns' => [], + 'mini_search' => true, + 'mini_pagination' => true, ] ); @@ -1194,7 +1196,7 @@ if ($inventory_module !== 'basic') { [ 'id' => $id_table, 'class' => 'info_table w100p', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $columns, 'no_sortable_columns' => [], @@ -1223,7 +1225,7 @@ if ($inventory_module !== 'basic') { $agentes = []; $data = []; $class = 'info_table'; - $style = 'width: 99%'; + $style = 'width: 100%'; $ordering = true; $searching = false; diff --git a/pandora_console/views/calendar/list.php b/pandora_console/views/calendar/list.php index d37a49955f..805a9d6a50 100644 --- a/pandora_console/views/calendar/list.php +++ b/pandora_console/views/calendar/list.php @@ -105,7 +105,7 @@ try { [ 'id' => $tableId, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => $ajax_url, diff --git a/pandora_console/views/cluster/list.php b/pandora_console/views/cluster/list.php index bcfc0743b6..bab56d9918 100644 --- a/pandora_console/views/cluster/list.php +++ b/pandora_console/views/cluster/list.php @@ -82,7 +82,7 @@ try { [ 'id' => $tableId, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => $model->ajaxController, diff --git a/pandora_console/views/consoles/list.php b/pandora_console/views/consoles/list.php index 14368647aa..303d0d7892 100644 --- a/pandora_console/views/consoles/list.php +++ b/pandora_console/views/consoles/list.php @@ -86,7 +86,7 @@ try { [ 'id' => $tableId, 'class' => 'info_table', - 'style' => 'width: 99%', + 'style' => 'width: 100%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => 'include/ajax/consoles.ajax', From 7ed61cca750ce92e67bffb2177d0be134e4cb73b Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 10 May 2023 08:43:29 +0200 Subject: [PATCH 03/66] 10640-Report task --- .../godmode/reporting/reporting_builder.php | 26 ++++++++++++++++--- pandora_console/godmode/servers/discovery.php | 2 +- .../wizards/DiscoveryTaskList.class.php | 13 ++++++++++ pandora_console/images/report-task.svg | 8 ++++++ 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 pandora_console/images/report-task.svg diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index cd049f1d83..f8c54abbf3 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -120,6 +120,8 @@ require_once $config['homedir'].'/include/functions_reports.php'; // Load enterprise extensions. enterprise_include('operation/reporting/custom_reporting.php'); enterprise_include_once('include/functions_metaconsole.php'); +enterprise_include_once('include/functions_tasklist.php'); +enterprise_include_once('include/functions_cron.php'); @@ -782,7 +784,7 @@ switch ($action) { ''.__('Filters').'', 'filter_form', '', - false, + true, false, '', 'white-box-content', @@ -1251,7 +1253,12 @@ switch ($action) { array_push($table->data, $data); } - html_print_table($table); + $reports_table = '
'; + $reports_table .= ''.__('Reports').''; + $reports_table .= html_print_table($table, true); + $reports_table .= '
'; + echo $reports_table; + $tablePagination = ui_pagination( $total_reports, $url, @@ -1259,7 +1266,7 @@ switch ($action) { $pagination, true, 'offset', - false, + false ); } else { ui_print_info_message( @@ -1270,6 +1277,19 @@ switch ($action) { ); } + $report_task_data = enterprise_hook('tasklist_showListConsoleTask', [$object, true]); + if (is_array($report_task_data) === true || strpos($report_task_data, 'class="nf"') === false) { + $task_table = '
'; + $task_table .= ''.__('Report tasks'); + $task_table .= ui_print_help_tip(__('To schedule a report, do it from the editing view of each report.'), true); + $task_table .= '
'; + $task_table .= $report_task_data; + $task_table .= '
'; + echo $task_table; + } else { + ui_print_info_message($report_task_data.__('To schedule a report, do it from the editing view of each report.')); + } + if (check_acl($config['id_user'], 0, 'RW') || check_acl($config['id_user'], 0, 'RM') ) { diff --git a/pandora_console/godmode/servers/discovery.php b/pandora_console/godmode/servers/discovery.php index 3df3342f52..0fb36b4cfb 100755 --- a/pandora_console/godmode/servers/discovery.php +++ b/pandora_console/godmode/servers/discovery.php @@ -161,7 +161,7 @@ if ($classname_selected === null) { $wiz_data = []; foreach ($classes as $classpath) { if (is_reporting_console_node() === true) { - if ($classpath !== '/var/www/html/pandora_console/godmode/wizards/DiscoveryTaskList.class.php') { + if ($classpath !== $config['homedir'].'/godmode/wizards/DiscoveryTaskList.class.php') { continue; } } diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 12e557de87..dd4110f7ff 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -129,6 +129,11 @@ class DiscoveryTaskList extends HTML } $delete_console_task = (bool) get_parameter('delete_console_task'); + $report_task = (bool) get_parameter('report_task', 0); + if ($report_task === true) { + $this->url = ui_get_full_url('index.php?sec=reporting&sec2=godmode/reporting/reporting_builder'); + } + if ($delete_console_task === true) { return $this->deleteConsoleTask(); } @@ -287,6 +292,10 @@ class DiscoveryTaskList extends HTML } $id_console_task = (int) get_parameter('id_console_task'); + $report_task = (bool) get_parameter('report_task', 0); + if ($report_task === true) { + $this->url = ui_get_full_url('index.php?sec=reporting&sec2=godmode/reporting/reporting_builder'); + } if ($id_console_task != null) { // -------------------------------- @@ -352,6 +361,10 @@ class DiscoveryTaskList extends HTML } $id_console_task = (int) get_parameter('id_console_task'); + $report_task = (bool) get_parameter('report_task', 0); + if ($report_task === true) { + $this->url = ui_get_full_url('index.php?sec=reporting&sec2=godmode/reporting/reporting_builder'); + } if ($id_console_task > 0) { $result = db_process_sql_update( diff --git a/pandora_console/images/report-task.svg b/pandora_console/images/report-task.svg new file mode 100644 index 0000000000..b16b7144da --- /dev/null +++ b/pandora_console/images/report-task.svg @@ -0,0 +1,8 @@ + + + Reportes programados@svg + + + + + \ No newline at end of file From 05cc72eb0f6ce7eb025520bfdec455e08ab54b90 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Fri, 12 May 2023 14:16:04 +0200 Subject: [PATCH 04/66] #10696 new widget for netflow --- .../include/lib/Dashboard/Widget.php | 4 + .../include/lib/Dashboard/Widgets/netflow.php | 458 ++++++++++++++++++ 2 files changed, 462 insertions(+) create mode 100644 pandora_console/include/lib/Dashboard/Widgets/netflow.php diff --git a/pandora_console/include/lib/Dashboard/Widget.php b/pandora_console/include/lib/Dashboard/Widget.php index 245c9f0481..76b87f0b01 100644 --- a/pandora_console/include/lib/Dashboard/Widget.php +++ b/pandora_console/include/lib/Dashboard/Widget.php @@ -416,6 +416,10 @@ class Widget $className .= '\OsQuickReportWidget'; break; + case 'netflow': + $className .= '\Netflow'; + break; + case 'GroupedMeterGraphs': case 'ColorModuleTabs': case 'BlockHistogram': diff --git a/pandora_console/include/lib/Dashboard/Widgets/netflow.php b/pandora_console/include/lib/Dashboard/Widgets/netflow.php new file mode 100644 index 0000000000..d4e6410247 --- /dev/null +++ b/pandora_console/include/lib/Dashboard/Widgets/netflow.php @@ -0,0 +1,458 @@ +width = $width; + + // Height. + $this->height = $height; + + // Grid Width. + $this->gridWidth = $gridWidth; + + // Options. + $this->values = $this->getOptionsWidget(); + + // Positions. + $this->position = $this->getPositionWidget(); + + // Page. + $this->page = basename(__FILE__); + + // ClassName. + $class = new \ReflectionClass($this); + $this->className = $class->getShortName(); + + // Title. + $this->title = __('Netflow'); + + // Name. + if (empty($this->name) === true) { + $this->name = 'netflow'; + } + } + + + /** + * Generates inputs for form (specific). + * + * @return array Of inputs. + * + * @throws Exception On error. + */ + public function getFormInputs(): array + { + $values = $this->values; + + // Retrieve global - common inputs. + $inputs = parent::getFormInputs(); + + // Default values. + if (isset($values['quantity']) === false) { + $values['quantity'] = 5; + } + + // Default values. + if (isset($values['period']) === false) { + $values['period'] = SECONDS_1WEEK; + } + + // Default values. + if (isset($values['max_values']) === false) { + $values['max_values'] = 10; + } + + // Period. + $inputs[] = [ + 'label' => __('Interval'), + 'arguments' => [ + 'name' => 'period', + 'type' => 'interval', + 'value' => $values['period'], + 'nothing' => __('None'), + 'nothing_value' => 0, + 'style_icon' => 'flex-grow: 0', + ], + ]; + $chart_types = netflow_get_chart_types(); + $chart_types['usage_map'] = __('Usage map'); + $inputs[] = [ + 'label' => __('Type graph'), + 'arguments' => [ + 'name' => 'chart_type', + 'type' => 'select', + 'fields' => $chart_types, + 'selected' => $values['chart_type'], + ], + ]; + + $aggregate_list = [ + 'srcip' => __('Src Ip Address'), + 'dstip' => __('Dst Ip Address'), + 'srcport' => __('Src Port'), + 'dstport' => __('Dst Port'), + ]; + $inputs[] = [ + 'label' => __('Aggregated by'), + 'id' => 'aggregated', + 'arguments' => [ + 'name' => 'aggregate', + 'type' => 'select', + 'fields' => $aggregate_list, + 'selected' => $values['aggregate'], + ], + ]; + + $inputs[] = [ + 'label' => __('Data to show'), + 'id' => 'data_to_show', + 'arguments' => [ + 'name' => 'action', + 'type' => 'select', + 'fields' => network_get_report_actions(), + 'selected' => $values['action'], + ], + ]; + + $max_values = [ + '2' => '2', + '5' => '5', + '10' => '10', + '15' => '15', + '20' => '20', + '25' => '25', + '50' => '50', + ]; + + $inputs[] = [ + 'label' => __('Max values'), + 'arguments' => [ + 'name' => 'max_values', + 'type' => 'select', + 'fields' => $max_values, + 'selected' => $values['max_values'], + ], + ]; + + return $inputs; + } + + + /** + * Get Post for widget. + * + * @return array + */ + public function getPost():array + { + // Retrieve global - common inputs. + $values = parent::getPost(); + + $values['period'] = \get_parameter('period', 0); + $values['chart_type'] = \get_parameter('chart_type', ''); + $values['aggregate'] = \get_parameter('aggregate'); + $values['max_values'] = \get_parameter('max_values', 10); + $values['action'] = \get_parameter('action', 'srcip'); + + return $values; + } + + + /** + * Draw widget. + * + * @return string + */ + public function load() + { + global $config; + + $output = ''; + + $size = parent::getSize(); + + $start_date = (time() - $this->values['period']); + $end_date = time(); + if ($this->values['chart_type'] === 'usage_map') { + $map_data = netflow_build_map_data( + $start_date, + $end_date, + $this->values['max_values'], + ($this->values['action'] === 'talkers') ? 'srcip' : 'dstip' + ); + $has_data = !empty($map_data['nodes']); + + if ($has_data === true) { + $map_manager = new \NetworkMap($map_data); + $map_manager->printMap(); + } else { + ui_print_info_message(__('No data to show')); + } + } else { + $netflowContainerClass = ($this->values['chart_type'] === 'netflow_data' || $this->values['chart_type'] === 'netflow_summary' || $this->values['chart_type'] === 'netflow_top_N') ? '' : 'white_box'; + $filter = [ + 'aggregate' => $this->values['aggregate'], + 'netflow_monitoring_interval' => 300, + ]; + + $output .= html_print_input_hidden( + 'selected_style_theme', + $config['style'], + true + ); + $style = 'height: 100%; border: none;'; + if ($this->values['chart_type'] !== 'netflow_area') { + $style .= ' width: 95%;'; + } + + // Draw the netflow chart. + $output .= html_print_div( + [ + 'class' => $netflowContainerClass, + 'style' => $style, + 'content' => netflow_draw_item( + $start_date, + $end_date, + 12, + $this->values['chart_type'], + $filter, + $this->values['max_values'], + '', + 'HTML', + 0 + ), + ], + true + ); + } + + return $output; + + } + + + /** + * Return aux javascript code for forms. + * + * @return string + */ + public function getFormJS() + { + return ' + $(document).ready(function(){ + //Limit 1 week + $("#period_select option").each(function(key, element){ + if(element.value > 604800){ + $(element).remove(); + } + }) + $("#period_manual option").each(function(key, element){ + if(element.value > 604800){ + $(element).remove(); + } + }); + $("#period_manual input").on("change", function(e){ + if($("#hidden-period").val() > 604800) { + $(this).val(1); + $("#hidden-period").val(604800); + $("#period_manual select option").removeAttr("selected"); + setTimeout(() => { + $("#period_default select option[value=\'604800\']").attr("selected", "selected"); + $("#period_manual select option[value=\'604800\']").attr("selected", "selected"); + $("#period_manual select").val(604800); + }, 500); + } + }); + if(this.value === "usage_map") { + $("#data_to_show").show(); + $("#aggregated").hide(); + } else { + $("#data_to_show").hide(); + $("#aggregated").show(); + } + $("#chart_type").on("change", function(e){ + if(this.value === "usage_map") { + $("#data_to_show").show(); + $("#aggregated").hide(); + } else { + $("#data_to_show").hide(); + $("#aggregated").show(); + } + }); + }); + '; + } + + + /** + * Get description. + * + * @return string. + */ + public static function getDescription() + { + return __('Netflow'); + } + + + /** + * Get Name. + * + * @return string. + */ + public static function getName() + { + return 'netflow'; + } + + + /** + * Get size Modal Configuration. + * + * @return array + */ + public function getSizeModalConfiguration(): array + { + $size = [ + 'width' => 400, + 'height' => 530, + ]; + + return $size; + } + + +} From 5adcdb1cae17071f2e242d4eb92832642885d4ca Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 16 May 2023 09:34:59 +0200 Subject: [PATCH 05/66] #10696 fixed select Usage map --- pandora_console/include/lib/Dashboard/Widgets/netflow.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/netflow.php b/pandora_console/include/lib/Dashboard/Widgets/netflow.php index d4e6410247..1451ccd9d9 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/netflow.php +++ b/pandora_console/include/lib/Dashboard/Widgets/netflow.php @@ -396,7 +396,7 @@ class Netflow extends Widget }, 500); } }); - if(this.value === "usage_map") { + if($("#chart_type").val() === "usage_map") { $("#data_to_show").show(); $("#aggregated").hide(); } else { From e737cb4f014dd63cbf38a67f15d0b2fa9a2a6434 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 16 May 2023 13:36:32 +0200 Subject: [PATCH 06/66] #10696 added image netflow widget --- pandora_console/images/widgets/netflow.png | Bin 0 -> 7588 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pandora_console/images/widgets/netflow.png diff --git a/pandora_console/images/widgets/netflow.png b/pandora_console/images/widgets/netflow.png new file mode 100644 index 0000000000000000000000000000000000000000..1b2b216824e0a5a4c67d39d20a28cd5805aa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&bUtpkD9RBC1r zwZN*Z^O@oSBF~5Ei7!3Y>rXGy>rC`$BHSlz`aHngI28Fi#l0r0KKjT=H z>SFJ~mo8w9BHE~EU0YH&^E1vH+;^h4>K6_wQ5Iepn2c> zW_6Tkp_Q8b-|NU!U2{>R(VjDLT#$-o9lAP*-IvzS|6)X)2HTWOzAMpHg5w2ZX5p$W zktRkZzw}nZ{0G6;e*NWZ7tfyjpiV0dh;1KH7N}6lg;rSp`tV6}m(BiQ=&c*q29~R; zGT*vjGS!Z3n)GV#gxxg%gYt>({z4{s-Oh?!kHZj zv0C1q6TT^yLTTDV3uqDv9WG{npHax=T!Q=#-3G-*)_+d%8#V6KO%9j!RbOFHo4w+y zZ4KQ~W|u4cQH6cGXmae8i)Y8!5{kI)WL6D7Oeo;MP-a8I=&2LMY2FI6WG;WTUz@}H zoW|YzIo_(IH_JVJ@?hDY*DPGC^*5J(?E`<6Z=iH~heG*dMUg3MpAo9osQaO-UmbLX z2YNq8sFAxj+gz!{qkyw_`>)k@?^wSiFq8@CnB=S01~3mzDA*oWH`{0<{hRNEX8g4; zWY4yr`jZ)EV0i8NKe+OtQQD5K_%`o^iVJ*ln_Ao&-VHl^o7%D(PwWs_wutBAF54ln ztilru9+oZQdfa0cJd~>N#P*F+%UHv`Zu`cXq!hwijq)K@qYO{1Mm=<^QBu*!$I#wd z9 Date: Wed, 17 May 2023 10:17:39 +0200 Subject: [PATCH 07/66] #11218 Modification of unrelated political icons --- pandora_console/godmode/agentes/module_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 5b9e2f093c..8f87d1d3ef 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -842,7 +842,7 @@ if ($modules !== false) { if ($linked !== false) { if ($adopt === true) { - $img = 'images/policies_brick.png'; + $img = 'images/policies_not_brick.png'; $title = '('.__('Adopted').') '.$policyInfo['name_policy']; } else { $img = 'images/policies_mc.png'; From fb297c88919084f83f9ba1d5f2e99abdb4b1c3c6 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 8 Jun 2023 15:56:13 +0200 Subject: [PATCH 08/66] #10696 delete switches from graphs in netflow widget --- .../include/lib/Dashboard/Widgets/netflow.php | 3 ++- pandora_console/include/styles/netflow_widget.css | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 pandora_console/include/styles/netflow_widget.css diff --git a/pandora_console/include/lib/Dashboard/Widgets/netflow.php b/pandora_console/include/lib/Dashboard/Widgets/netflow.php index 1451ccd9d9..6af2e78bab 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/netflow.php +++ b/pandora_console/include/lib/Dashboard/Widgets/netflow.php @@ -298,6 +298,7 @@ class Netflow extends Widget */ public function load() { + ui_require_css_file('netflow_widget', 'include/styles/', true); global $config; $output = ''; @@ -333,7 +334,7 @@ class Netflow extends Widget $config['style'], true ); - $style = 'height: 100%; border: none;'; + $style = 'width:100%; height: 100%; border: none;'; if ($this->values['chart_type'] !== 'netflow_area') { $style .= ' width: 95%;'; } diff --git a/pandora_console/include/styles/netflow_widget.css b/pandora_console/include/styles/netflow_widget.css new file mode 100644 index 0000000000..04b093c989 --- /dev/null +++ b/pandora_console/include/styles/netflow_widget.css @@ -0,0 +1,9 @@ +.menu_graph { + display: none; +} +.parent_graph { + width: 97% !important; +} +#image_hide_show_labels { + display: none !important; +} From 81991cc4fe2381182db989f093ec08f9e1bb7bf1 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 12 Jun 2023 10:48:10 +0200 Subject: [PATCH 09/66] #10696 new icon netflow --- pandora_console/images/widgets/netflow.png | Bin 7588 -> 10896 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/pandora_console/images/widgets/netflow.png b/pandora_console/images/widgets/netflow.png index 1b2b216824e0a5a4c67d39d20a28cd5805aa90a5..5a34c1635f0ebbb840f2c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mDSe5Ex@4@5x zxvDQsi4&9Rp8fQ|uFdNrGEW?7qbn?^Y|qd(t%Nsx&ZrMF81%JjM{A&Y-}`2DlxU%q zn*HDF$W&c(QKQkGGjUvyie(+TI*8qu*3bW9M4blPlz&XVE74Vg;{{@7;i@f>CPpQ{ z^j5&KLMD0L&Wc=-(XDakK~>ltI;$6b*8S?m(_-g$H^+ zN2rmzH``pP#G`<-cl)o^cJElfBruc-=$PcI)&?*SO(@tNRyW&dBmJB2gl7D;FJ#ZQ zpZb#-W?*>j`aihxp;6k7uJ|_Zgo+D%a+_M*8r}^%e4E;`8c*yHShk4g;x5}Eu&lxp z3uhjdE#i9IV-`G=s_?}2jZ({4!@X|%#+sxQ!ds2es`LY7!6G(NFZC~oBc2Oms2o$Je9)&Kwi07*qoM6N<$ Ef Date: Tue, 13 Jun 2023 12:37:28 +0200 Subject: [PATCH 10/66] #10254 added secondary server in ad --- pandora_console/godmode/setup/setup_auth.php | 8 ++++- pandora_console/include/auth/mysql.php | 8 ++++- pandora_console/include/functions_config.php | 32 ++++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index 3822a01b2e..caf9e3e494 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -538,7 +538,13 @@ echo ''; if ($('input[type=checkbox][name=secondary_ldap_enabled]:checked').val() == 1) { $("tr[id*='ldap_'][id$='_secondary']").show(); } else { - $( "tr[id*='ldap_'][id$='_secondary']" ).hide(); + $( "tr[id*='ldap_'][id$='_secondary']" ).hide(); + } + + if ($('input[type=checkbox][name=secondary_active_directory]:checked').val() == 1) { + $("tr[id*='ad_'][id$='_secondary']").show(); + } else { + $( "tr[id*='ad_'][id$='_secondary']" ).hide(); } } $( document ).ready(function() { diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index 9d26ba22eb..5f4b1cfe59 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -237,7 +237,13 @@ function process_user_login_remote($login, $pass, $api=false) // Active Directory. case 'ad': - if (enterprise_hook('ad_process_user_login', [$login, $pass]) === false) { + $sr = enterprise_hook('ad_process_user_login', [$login, $pass]); + // Try with secondary server. + if ($sr === false && (bool) $config['secondary_active_directory'] === true) { + $sr = enterprise_hook('ad_process_user_login', [$login, $pass, true]); + } + + if ($sr === false) { $config['auth_error'] = 'User not found in database or incorrect password'; return false; } diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 468c228733..5d1bf22a71 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -623,6 +623,38 @@ function config_update_config() $error_update[] = __('Domain'); } + if (config_update_value('secondary_active_directory', get_parameter('secondary_active_directory'), true) === false) { + $error_update[] = __('Secondary active directory'); + } + + if (config_update_value('ad_server_secondary', get_parameter('ad_server_secondary'), true) === false) { + $error_update[] = __('Secondary active directory server'); + } + + if (config_update_value('ad_port_secondary', get_parameter('ad_port_secondary'), true) === false) { + $error_update[] = __('Secondary active directory port'); + } + + if (config_update_value('ad_start_tls_secondary', get_parameter('ad_start_tls_secondary'), true) === false) { + $error_update[] = __('Secondary start TLS'); + } + + if (config_update_value('recursive_search_secondary', get_parameter('recursive_search_secondary'), true) === false) { + $error_update[] = __('Secondary recursive search'); + } + + if (config_update_value('ad_advanced_config_secondary', get_parameter('ad_advanced_config_secondary'), true) === false) { + $error_update[] = __('Secondary advanced Config AD'); + } + + if (config_update_value('ldap_advanced_config_secondary', get_parameter('ldap_advanced_config_secondary'), true) === false) { + $error_update[] = __('Secondary advanced Config LDAP'); + } + + if (config_update_value('ad_domain_secondary', get_parameter('ad_domain_secondary'), true) === false) { + $error_update[] = __('Secondary domain'); + } + if (config_update_value('ad_adv_perms', get_parameter('ad_adv_perms'), true) === false) { $error_update[] = __('Advanced Permisions AD'); } From 052852f2d144228194ca82c446046991a2529dd1 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 13 Jun 2023 13:20:28 +0200 Subject: [PATCH 11/66] #10254 added timeout in active directory --- pandora_console/godmode/setup/setup_auth.php | 2 +- pandora_console/include/functions_config.php | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index caf9e3e494..cdd8e447fd 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -210,7 +210,7 @@ if (is_ajax() === true) { // Ldapsearch timeout. // Default Ldapsearch timeout. - set_when_empty($config['ldap_searh_timeout'], 5); + set_when_empty($config['ldap_search_timeout'], 5); $row = []; $row['name'] = __('Ldap search timeout (secs)'); $row['control'] = html_print_input_text( diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 5d1bf22a71..0e9d40f0cc 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -639,16 +639,8 @@ function config_update_config() $error_update[] = __('Secondary start TLS'); } - if (config_update_value('recursive_search_secondary', get_parameter('recursive_search_secondary'), true) === false) { - $error_update[] = __('Secondary recursive search'); - } - - if (config_update_value('ad_advanced_config_secondary', get_parameter('ad_advanced_config_secondary'), true) === false) { - $error_update[] = __('Secondary advanced Config AD'); - } - - if (config_update_value('ldap_advanced_config_secondary', get_parameter('ldap_advanced_config_secondary'), true) === false) { - $error_update[] = __('Secondary advanced Config LDAP'); + if (config_update_value('ad_search_timeout', get_parameter('ad_search_timeout'), true) === false) { + $error_update[] = __('AD search timeout'); } if (config_update_value('ad_domain_secondary', get_parameter('ad_domain_secondary'), true) === false) { @@ -3114,6 +3106,14 @@ function config_process_config() config_update_value('ad_port', 389); } + if (!isset($config['ad_server_secondary'])) { + config_update_value('ad_server_secondary', 'localhost'); + } + + if (!isset($config['ad_port_secondary'])) { + config_update_value('ad_port_secondary', 389); + } + if (!isset($config['ad_start_tls'])) { config_update_value('ad_start_tls', 0); } From 561e8c4c208f2b1147aa957d009cb2e859044732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Thu, 15 Jun 2023 09:29:14 -0600 Subject: [PATCH 12/66] Skip recover alert if was alredy recovered --- pandora_server/lib/PandoraFMS/Core.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 06deaa4331..18187984e7 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1041,8 +1041,12 @@ sub pandora_execute_alert { $event_generated = 1; $monitoring_event_custom_data = $custom_data; } - + + if($alert_mode == FIRED_ALERT || ($alert_mode == RECOVERED_ALERT && $action->{'recovered'} == 0)) { pandora_execute_action ($pa_config, $data, $agent, $alert, $alert_mode, $action, $module, $dbh, $timestamp, $extra_macros, $monitoring_event_custom_data); + }else{ + logger ($pa_config, "Skipping recover action " . safe_output($action->{'name'}) . " for alert '" . safe_output($alert->{'name'}) . "' module '" . safe_output($module->{'nombre'}) . "'.", 10); + } if($alert_mode == RECOVERED_ALERT) { # Reset action thresholds and set recovered From 1499af3a2d3f7388db5dbf95924b0949500a5d9f Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 19 Jun 2023 11:04:08 +0200 Subject: [PATCH 13/66] added setup token --- pandora_console/godmode/setup/setup_general.php | 10 ++++++++++ pandora_console/include/functions_config.php | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 3b168cf4d0..44cfab606d 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -730,6 +730,16 @@ $table->data[$i][] = html_print_label_input_block( ) ); +$table->data[$i][] = html_print_label_input_block( + __('Show experimental features'), + html_print_checkbox_switch( + 'show_experimental_features', + 1, + $config['show_experimental_features'], + true + ) +); + echo '
'; echo '
'; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 468c228733..b313b46088 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -374,6 +374,10 @@ function config_update_config() $error_update[] = __('keep_in_process_status_extra_id'); } + if (config_update_value('show_experimental_features', get_parameter('show_experimental_features'), true) === false) { + $error_update[] = __('show_experimental_features'); + } + if (config_update_value('console_log_enabled', get_parameter('console_log_enabled'), true) === false) { $error_update[] = __('Console log enabled'); } @@ -2359,6 +2363,10 @@ function config_process_config() config_update_value('keep_in_process_status_extra_id', 0); } + if (!isset($config['show_experimental_features'])) { + config_update_value('show_experimental_features', 0); + } + if (!isset($config['console_log_enabled'])) { config_update_value('console_log_enabled', 0); } From 77ff766f84aac043d0bd728ed04420cd9eaeea64 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 19 Jun 2023 15:25:37 +0200 Subject: [PATCH 14/66] remove legacy visual console --- pandora_console/general/header.php | 7 +- .../reporting/visual_console_builder.php | 6 -- .../godmode/setup/setup_visuals.php | 17 +--- pandora_console/include/functions_config.php | 4 - .../include/functions_visual_map_editor.php | 97 +++++++++---------- pandora_console/mobile/operation/home.php | 16 ++- .../visual_console/public_console.php | 7 +- .../operation/visual_console/render_view.php | 7 +- 8 files changed, 60 insertions(+), 101 deletions(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index b0cbc0cec5..bb2884c2ae 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -217,11 +217,8 @@ echo sprintf('
', $menuTypeClass); $header_autorefresh = ''; $header_autorefresh_counter = ''; - if ($config['legacy_vc'] - || ($_GET['sec2'] !== 'operation/visual_console/render_view') - || (($_GET['sec2'] !== 'operation/visual_console/render_view') - && $config['legacy_vc']) - ) { + + if (($_GET['sec2'] !== 'operation/visual_console/render_view')) { if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false ) { diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index a898ff017a..b4f04e9be9 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -837,12 +837,6 @@ $buttons['wizard'] = [ 'active' => false, 'text' => ''.html_print_image('images/wizard@svg.svg', true, ['title' => __('Wizard'), 'class' => 'invert_filter']).'', ]; -if ($config['legacy_vc']) { - $buttons['editor'] = [ - 'active' => false, - 'text' => ''.html_print_image('images/builder@svg.svg', true, ['title' => __('Builder'), 'class' => 'invert_filter']).'', - ]; -} $buttons['view'] = [ 'active' => false, diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index caee126804..b8f93edc1d 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -1339,17 +1339,6 @@ $table_vc->style[0] = 'font-weight: bold'; $table_vc->size[0] = '50%'; $table_vc->data = []; -// Remove when the new view reaches rock solid stability. -$table_vc->data[$row][] = html_print_label_input_block( - __('Legacy Visual Console View'), - html_print_checkbox_switch( - 'legacy_vc', - 1, - (bool) $config['legacy_vc'], - true - ) -); - $table_vc->data[$row][] = html_print_label_input_block( __('Default cache expiration'), html_print_extended_select_for_time( @@ -1367,7 +1356,6 @@ $table_vc->data[$row][] = html_print_label_input_block( $intervals ) ); -$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Default interval for refresh on Visual Console'), @@ -1383,6 +1371,7 @@ $table_vc->data[$row][] = html_print_label_input_block( false ) ); +$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Type of view of visual consoles'), @@ -1396,12 +1385,12 @@ $table_vc->data[$row][] = html_print_label_input_block( true ) ); -$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Number of favorite visual consoles to show in the menu'), "" ); +$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Default line thickness for the Visual Console'), @@ -1414,7 +1403,6 @@ $table_vc->data[$row][] = html_print_label_input_block( true ) ); -$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Mobile view not allow visual console orientation'), @@ -1425,6 +1413,7 @@ $table_vc->data[$row][] = html_print_label_input_block( true ) ); +$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Display item frame on alert triggered'), diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 468c228733..dde3d4ceae 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -3417,10 +3417,6 @@ function config_process_config() config_update_value('dbtype', 'mysql'); } - if (!isset($config['legacy_vc'])) { - config_update_value('legacy_vc', 0); - } - if (!isset($config['vc_default_cache_expiration'])) { config_update_value('vc_default_cache_expiration', 60); } diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index c40d2e0740..c7971256e0 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -1274,52 +1274,50 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) ); $form_items_advance['element_group_row']['html'] .= ''; - if (!$config['legacy_vc']) { - $intervals = [ - 10 => '10 '.__('seconds'), - 30 => '30 '.__('seconds'), - 60 => '1 '.__('minutes'), - 300 => '5 '.__('minutes'), - 900 => '15 '.__('minutes'), - 1800 => '30 '.__('minutes'), - 3600 => '1 '.__('hour'), - ]; + $intervals = [ + 10 => '10 '.__('seconds'), + 30 => '30 '.__('seconds'), + 60 => '1 '.__('minutes'), + 300 => '5 '.__('minutes'), + 900 => '15 '.__('minutes'), + 1800 => '30 '.__('minutes'), + 3600 => '1 '.__('hour'), + ]; - $form_items_advance['cache_expiration_row'] = []; - $form_items_advance['cache_expiration_row']['items'] = [ - 'static_graph', - 'percentile_bar', - 'percentile_item', - 'module_graph', - 'simple_value', - 'datos', - 'auto_sla_graph', - 'group_item', - 'bars_graph', - 'donut_graph', - 'color_cloud', - 'service', - ]; - $form_items_advance['cache_expiration_row']['html'] = ''; - $form_items_advance['cache_expiration_row']['html'] .= __('Cache expiration'); - $form_items_advance['cache_expiration_row']['html'] .= ''; - $form_items_advance['cache_expiration_row']['html'] .= ''; - $form_items_advance['cache_expiration_row']['html'] .= html_print_extended_select_for_time( - 'cache_expiration', - $config['vc_default_cache_expiration'], - '', - __('No cache'), - 0, - false, - true, - false, - true, - '', - false, - $intervals - ); - $form_items_advance['cache_expiration_row']['html'] .= ''; - } + $form_items_advance['cache_expiration_row'] = []; + $form_items_advance['cache_expiration_row']['items'] = [ + 'static_graph', + 'percentile_bar', + 'percentile_item', + 'module_graph', + 'simple_value', + 'datos', + 'auto_sla_graph', + 'group_item', + 'bars_graph', + 'donut_graph', + 'color_cloud', + 'service', + ]; + $form_items_advance['cache_expiration_row']['html'] = ''; + $form_items_advance['cache_expiration_row']['html'] .= __('Cache expiration'); + $form_items_advance['cache_expiration_row']['html'] .= ''; + $form_items_advance['cache_expiration_row']['html'] .= ''; + $form_items_advance['cache_expiration_row']['html'] .= html_print_extended_select_for_time( + 'cache_expiration', + $config['vc_default_cache_expiration'], + '', + __('No cache'), + 0, + false, + true, + false, + true, + '', + false, + $intervals + ); + $form_items_advance['cache_expiration_row']['html'] .= ''; // Insert and modify before the buttons to create or update. if (enterprise_installed()) { @@ -1454,12 +1452,9 @@ function visual_map_editor_print_toolbox() visual_map_print_button_editor('box_item', __('Box'), 'left', false, 'box_item', true); visual_map_print_button_editor('line_item', __('Line'), 'left', false, 'line_item', true); visual_map_print_button_editor('color_cloud', __('Color cloud'), 'left', false, 'color_cloud_min', true); - if (isset($config['legacy_vc']) === false - || (bool) $config['legacy_vc'] === false - ) { - // Applies only on modern VC. - visual_map_print_button_editor('network_link', __('Network link'), 'left', false, 'network_link_min', true); - } + + // Applies only on modern VC. + visual_map_print_button_editor('network_link', __('Network link'), 'left', false, 'network_link_min', true); if (defined('METACONSOLE')) { echo ' 'ui-icon-menu-group ui-widget-icon-floatbeginning ui-icon-menu-square', ]; - if ((bool) $system->getConfig('legacy_vc', false) === false) { - // Show Visual consoles only if new system is enabled. - $items['visualmaps'] = [ - 'name' => __('Visual consoles'), - 'filename' => 'visualmaps.php', - 'menu_item' => true, - 'icon' => 'ui-icon-menu-visual_console ui-widget-icon-floatbeginning ui-icon-menu-square', - ]; - } + // Show Visual consoles only if new system is enabled. + $items['visualmaps'] = [ + 'name' => __('Visual consoles'), + 'filename' => 'visualmaps.php', + 'menu_item' => true, + 'icon' => 'ui-icon-menu-visual_console ui-widget-icon-floatbeginning ui-icon-menu-square', + ]; $items['alerts'] = [ 'name' => __('Alerts'), diff --git a/pandora_console/operation/visual_console/public_console.php b/pandora_console/operation/visual_console/public_console.php index 5c6f2d1fcf..91793ba129 100755 --- a/pandora_console/operation/visual_console/public_console.php +++ b/pandora_console/operation/visual_console/public_console.php @@ -15,13 +15,8 @@ // The session is configured and started inside the config process. require_once '../../include/config.php'; -$legacy = (bool) get_parameter('legacy', $config['legacy_vc']); if (is_metaconsole() === true) { $config['requirements_use_base_url'] = true; } -if ($legacy === false) { - include_once $config['homedir'].'/operation/visual_console/public_view.php'; -} else { - include_once $config['homedir'].'/operation/visual_console/legacy_public_view.php'; -} +require_once $config['homedir'].'/operation/visual_console/public_view.php'; diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index fade549824..158a2d0836 100755 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -13,9 +13,4 @@ // GNU General Public License for more details. global $config; -$legacy = (bool) get_parameter('legacy', $config['legacy_vc']); -if ($legacy === false) { - include_once $config['homedir'].'/operation/visual_console/view.php'; -} else { - include_once $config['homedir'].'/operation/visual_console/legacy_view.php'; -} +require_once $config['homedir'].'/operation/visual_console/view.php'; From 4bda7090b79cbd030b12aca420e27e13fea12955 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 19 Jun 2023 16:33:56 +0200 Subject: [PATCH 15/66] #11335 controled name and group in network maps --- .../operation/agentes/pandora_networkmap.php | 408 +++++++++--------- 1 file changed, 216 insertions(+), 192 deletions(-) diff --git a/pandora_console/operation/agentes/pandora_networkmap.php b/pandora_console/operation/agentes/pandora_networkmap.php index 57573bca44..7d4ec5d520 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.php +++ b/pandora_console/operation/agentes/pandora_networkmap.php @@ -256,152 +256,165 @@ if ($new_networkmap || $save_networkmap) { $name = (string) get_parameter('name'); - // Default size values. - $width = $config['networkmap_max_width']; - $height = $config['networkmap_max_width']; - - $method = (string) get_parameter('method', 'fdp'); - - $recon_task_id = (int) get_parameter( - 'recon_task_id', - 0 + $exist = db_get_row_filter( + 'tmap', + [ + 'name' => $name, + 'id_group_map' => $id_group_map, + ], ); - $ip_mask = get_parameter( - 'ip_mask', - '' - ); - $source = (string) get_parameter('source', 'group'); - $dont_show_subgroups = (int) get_parameter_checkbox( - 'dont_show_subgroups', - 0 - ); - $node_radius = (int) get_parameter('node_radius', 40); - $description = get_parameter('description', ''); + hd('Entraaaa', true); + hd($exist, true); + if ($exist !== false) { + $result_txt = ui_print_error_message(__('Another network map already exists with this name and group.')); + } else { + // Default size values. + $width = $config['networkmap_max_width']; + $height = $config['networkmap_max_width']; - $offset_x = get_parameter('pos_x', 0); - $offset_y = get_parameter('pos_y', 0); - $scale_z = get_parameter('scale_z', 0.5); + $method = (string) get_parameter('method', 'fdp'); - $node_sep = get_parameter('node_sep', '0.25'); - $rank_sep = get_parameter('rank_sep', ($method === 'twopi') ? '1.0' : '0.5'); - - $mindist = get_parameter('mindist', '1.0'); - $kval = get_parameter('kval', '0.3'); - - $refresh_time = get_parameter('refresh_time', '300'); - - $values = []; - $values['name'] = $name; - $values['id_group'] = implode(',', $id_group); - $values['source_period'] = 60; - $values['width'] = $width; - $values['height'] = $height; - $values['id_user'] = $config['id_user']; - $values['description'] = $description; - $values['id_group_map'] = $id_group_map; - $values['refresh_time'] = $refresh_time; - - switch ($method) { - case 'twopi': - $values['generation_method'] = LAYOUT_RADIAL; - break; - - case 'dot': - $values['generation_method'] = LAYOUT_FLAT; - break; - - case 'circo': - $values['generation_method'] = LAYOUT_CIRCULAR; - break; - - case 'neato': - $values['generation_method'] = LAYOUT_SPRING1; - break; - - case 'fdp': - $values['generation_method'] = LAYOUT_SPRING2; - break; - - case 'radial_dinamic': - $values['generation_method'] = LAYOUT_RADIAL_DYNAMIC; - break; - - default: - $values['generation_method'] = LAYOUT_RADIAL; - break; - } - - if ($source == 'group') { - $values['source'] = 0; - $values['source_data'] = implode(',', $id_group); - } else if ($source == 'recon_task') { - $values['source'] = 1; - $values['source_data'] = $recon_task_id; - } else if ($source == 'ip_mask') { - $values['source'] = 2; - $values['source_data'] = $ip_mask; - } - - if ($networkmap_write === false && $networkmap_manage === false) { - db_pandora_audit( - AUDIT_LOG_ACL_VIOLATION, - 'Trying to access networkmap' + $recon_task_id = (int) get_parameter( + 'recon_task_id', + 0 ); - include 'general/noaccess.php'; - return; - } - - $filter = []; - $filter['dont_show_subgroups'] = $dont_show_subgroups; - $filter['node_radius'] = $node_radius; - $filter['x_offs'] = $offset_x; - $filter['y_offs'] = $offset_y; - $filter['z_dash'] = $scale_z; - $filter['node_sep'] = $node_sep; - $filter['rank_sep'] = $rank_sep; - $filter['mindist'] = $mindist; - $filter['kval'] = $kval; - - $values['filter'] = json_encode($filter); - - $result = false; - if (!empty($name)) { - $result = db_process_sql_insert( - 'tmap', - $values + $ip_mask = get_parameter( + 'ip_mask', + '' ); - } + $source = (string) get_parameter('source', 'group'); + $dont_show_subgroups = (int) get_parameter_checkbox( + 'dont_show_subgroups', + 0 + ); + $node_radius = (int) get_parameter('node_radius', 40); + $description = get_parameter('description', ''); - $result_txt = ui_print_result_message( - $result, - __('Succesfully created'), - __('Could not be created'), - '', - true - ); + $offset_x = get_parameter('pos_x', 0); + $offset_y = get_parameter('pos_y', 0); + $scale_z = get_parameter('scale_z', 0.5); - $id = $result; - define('_id_', $id); + $node_sep = get_parameter('node_sep', '0.25'); + $rank_sep = get_parameter('rank_sep', ($method === 'twopi') ? '1.0' : '0.5'); - if ($result !== false) { - $tab = 'view'; - if ($values['generation_method'] == LAYOUT_RADIAL_DYNAMIC) { - $tab = 'r_dinamic'; - define('_activeTab_', 'radial_dynamic'); - $url = 'index.php?sec=network&sec2=operation/agentes/networkmap.dinamic&activeTab=radial_dynamic'; - header( - 'Location: '.ui_get_full_url( - $url.'&id_networkmap='.$id - ) + $mindist = get_parameter('mindist', '1.0'); + $kval = get_parameter('kval', '0.3'); + + $refresh_time = get_parameter('refresh_time', '300'); + + $values = []; + $values['name'] = $name; + $values['id_group'] = implode(',', $id_group); + $values['source_period'] = 60; + $values['width'] = $width; + $values['height'] = $height; + $values['id_user'] = $config['id_user']; + $values['description'] = $description; + $values['id_group_map'] = $id_group_map; + $values['refresh_time'] = $refresh_time; + + switch ($method) { + case 'twopi': + $values['generation_method'] = LAYOUT_RADIAL; + break; + + case 'dot': + $values['generation_method'] = LAYOUT_FLAT; + break; + + case 'circo': + $values['generation_method'] = LAYOUT_CIRCULAR; + break; + + case 'neato': + $values['generation_method'] = LAYOUT_SPRING1; + break; + + case 'fdp': + $values['generation_method'] = LAYOUT_SPRING2; + break; + + case 'radial_dinamic': + $values['generation_method'] = LAYOUT_RADIAL_DYNAMIC; + break; + + default: + $values['generation_method'] = LAYOUT_RADIAL; + break; + } + + if ($source == 'group') { + $values['source'] = 0; + $values['source_data'] = implode(',', $id_group); + } else if ($source == 'recon_task') { + $values['source'] = 1; + $values['source_data'] = $recon_task_id; + } else if ($source == 'ip_mask') { + $values['source'] = 2; + $values['source_data'] = $ip_mask; + } + + if ($networkmap_write === false && $networkmap_manage === false) { + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access networkmap' ); - } else { - $url = 'index.php?sec=network&sec2=operation/agentes/pandora_networkmap'; - header( - 'Location: '.ui_get_full_url( - $url.'&tab='.$tab.'&id_networkmap='.$id - ) + include 'general/noaccess.php'; + return; + } + + $filter = []; + $filter['dont_show_subgroups'] = $dont_show_subgroups; + $filter['node_radius'] = $node_radius; + $filter['x_offs'] = $offset_x; + $filter['y_offs'] = $offset_y; + $filter['z_dash'] = $scale_z; + $filter['node_sep'] = $node_sep; + $filter['rank_sep'] = $rank_sep; + $filter['mindist'] = $mindist; + $filter['kval'] = $kval; + + $values['filter'] = json_encode($filter); + + $result = false; + if (!empty($name)) { + $result = db_process_sql_insert( + 'tmap', + $values ); } + + $result_txt = ui_print_result_message( + $result, + __('Succesfully created'), + __('Could not be created'), + '', + true + ); + + $id = $result; + define('_id_', $id); + + if ($result !== false) { + $tab = 'view'; + if ($values['generation_method'] == LAYOUT_RADIAL_DYNAMIC) { + $tab = 'r_dinamic'; + define('_activeTab_', 'radial_dynamic'); + $url = 'index.php?sec=network&sec2=operation/agentes/networkmap.dinamic&activeTab=radial_dynamic'; + header( + 'Location: '.ui_get_full_url( + $url.'&id_networkmap='.$id + ) + ); + } else { + $url = 'index.php?sec=network&sec2=operation/agentes/pandora_networkmap'; + header( + 'Location: '.ui_get_full_url( + $url.'&tab='.$tab.'&id_networkmap='.$id + ) + ); + } + } } } } @@ -464,70 +477,81 @@ else if ($update_networkmap || $copy_networkmap || $delete) { } $name = (string) get_parameter('name', ''); - - $recon_task_id = (int) get_parameter( - 'recon_task_id', - 0 + $exist = db_get_row_filter( + 'tmap', + [ + 'name' => $name, + 'id_group_map' => $id_group_map, + ], ); - $source = (string) get_parameter('source', 'group'); - - $offset_x = get_parameter('pos_x', 0); - $offset_y = get_parameter('pos_y', 0); - $scale_z = get_parameter('scale_z', 0.5); - - $refresh_time = get_parameter('refresh_time', '300'); - - $values = []; - $values['name'] = $name; - $values['id_group'] = implode(',', $id_group); - $values['id_group_map'] = $id_group_map; - - $description = get_parameter('description', ''); - $values['description'] = $description; - - $values['refresh_time'] = $refresh_time; - - $dont_show_subgroups = (int) get_parameter('dont_show_subgroups', 0); - $node_radius = (int) get_parameter('node_radius', 40); - $row = db_get_row('tmap', 'id', $id); - $filter = json_decode($row['filter'], true); - $filter['dont_show_subgroups'] = $dont_show_subgroups; - $filter['node_radius'] = $node_radius; - $filter['x_offs'] = $offset_x; - $filter['y_offs'] = $offset_y; - $filter['z_dash'] = $scale_z; - - $values['filter'] = json_encode($filter); - - $result = false; - if (empty($name) === false) { - $result = db_process_sql_update( - 'tmap', - $values, - ['id' => $id] + if ($exist !== false) { + $result_txt = ui_print_error_message(__('Another network map already exists with this name and group.')); + } else { + $recon_task_id = (int) get_parameter( + 'recon_task_id', + 0 ); - ui_update_name_fav_element($id, 'Network_map', $name); - } - $result_txt = ui_print_result_message( - $result, - __('Succesfully updated'), - __('Could not be updated'), - '', - true - ); + $source = (string) get_parameter('source', 'group'); - if ($result) { - // If change the group, the map must be regenerated - if ($id_group != $id_group_old) { - networkmap_delete_nodes($id); - // Delete relations. - networkmap_delete_relations($id); + $offset_x = get_parameter('pos_x', 0); + $offset_y = get_parameter('pos_y', 0); + $scale_z = get_parameter('scale_z', 0.5); + + $refresh_time = get_parameter('refresh_time', '300'); + + $values = []; + $values['name'] = $name; + $values['id_group'] = implode(',', $id_group); + $values['id_group_map'] = $id_group_map; + + $description = get_parameter('description', ''); + $values['description'] = $description; + + $values['refresh_time'] = $refresh_time; + + $dont_show_subgroups = (int) get_parameter('dont_show_subgroups', 0); + $node_radius = (int) get_parameter('node_radius', 40); + $row = db_get_row('tmap', 'id', $id); + $filter = json_decode($row['filter'], true); + $filter['dont_show_subgroups'] = $dont_show_subgroups; + $filter['node_radius'] = $node_radius; + $filter['x_offs'] = $offset_x; + $filter['y_offs'] = $offset_y; + $filter['z_dash'] = $scale_z; + + $values['filter'] = json_encode($filter); + + $result = false; + if (empty($name) === false) { + $result = db_process_sql_update( + 'tmap', + $values, + ['id' => $id] + ); + ui_update_name_fav_element($id, 'Network_map', $name); } - $networkmap_write = $networkmap_write_new; - $networkmap_manage = $networkmap_manage_new; + $result_txt = ui_print_result_message( + $result, + __('Succesfully updated'), + __('Could not be updated'), + '', + true + ); + + if ($result) { + // If change the group, the map must be regenerated + if ($id_group != $id_group_old) { + networkmap_delete_nodes($id); + // Delete relations. + networkmap_delete_relations($id); + } + + $networkmap_write = $networkmap_write_new; + $networkmap_manage = $networkmap_manage_new; + } } } From 50dca5f8e6d14df9284d313637d77ec45ff14865 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 20 Jun 2023 15:09:50 +0200 Subject: [PATCH 16/66] #11480 fixed widget status group --- .../lib/Dashboard/Widgets/system_group_status.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php b/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php index 02df4c2888..4782dc883f 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php +++ b/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php @@ -395,7 +395,9 @@ class SystemGroupStatusWidget extends Widget $user_groups = users_get_groups(false, 'AR', $return_all_group); $selected_groups = explode(',', $this->values['groupId'][0]); + $all_group_selected = false; if (in_array(0, $selected_groups) === true) { + $all_group_selected = true; $selected_groups = []; foreach (groups_get_all() as $key => $name_group) { $selected_groups[] = groups_get_id($name_group); @@ -480,7 +482,12 @@ class SystemGroupStatusWidget extends Widget } } - $this->values['groupId'] = $selected_groups; + if ($all_group_selected === true) { + $this->values['groupId'] = array_keys($result_groups); + } else { + $this->values['groupId'] = $selected_groups; + } + $this->values['status'] = explode(',', $this->values['status'][0]); $style = 'font-size: 1.5em; font-weight: bolder;text-align: center;'; From 5ee902902aedc32fd976875bdea9647c1c45376d Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 20 Jun 2023 15:20:43 +0200 Subject: [PATCH 17/66] #11480 added recursion in condition --- .../include/lib/Dashboard/Widgets/system_group_status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php b/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php index 4782dc883f..b648796ca8 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php +++ b/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php @@ -482,7 +482,7 @@ class SystemGroupStatusWidget extends Widget } } - if ($all_group_selected === true) { + if ($all_group_selected === true && $this->values['groupRecursion'] === true) { $this->values['groupId'] = array_keys($result_groups); } else { $this->values['groupId'] = $selected_groups; From bd652e577892e2c712dc1ce4a81aa5a40ebb730d Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 20 Jun 2023 17:19:23 +0200 Subject: [PATCH 18/66] #11419 added new options in basic chart --- .../include/graphs/functions_flot.php | 2 +- .../lib/Dashboard/Widgets/BasicChart.php | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index d1856b7b4c..754e428168 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -252,7 +252,7 @@ function flot_area_graph( $return .= html_print_input_hidden( 'line_width_graph', - $config['custom_graph_width'], + (empty($params['line_width']) === true) ? $config['custom_graph_width'] : $params['line_width'], true ); $return .= "
__('Area'), + 'line' => __('Wire'), + ]; + + $inputs['inputs']['row1'][] = [ + 'label' => __('Type graph'), + 'arguments' => [ + 'type' => 'select', + 'fields' => $types_graph, + 'name' => 'type_graph', + 'selected' => $values['type_graph'], + 'return' => true, + ], + ]; + $inputs['inputs']['row2'][] = [ 'label' => __('Show Value'), 'arguments' => [ @@ -520,6 +544,18 @@ class BasicChart extends Widget ], ]; + $inputs['inputs']['row2'][] = [ + 'label' => __('Graph line size'), + 'arguments' => [ + 'name' => 'line_width', + 'type' => 'number', + 'value' => (empty($values['line_width']) === true) ? 3 : $values['line_width'], + 'return' => true, + 'min' => 2, + 'max' => 10, + ], + ]; + return $inputs; } @@ -546,6 +582,8 @@ class BasicChart extends Widget $values['colorChart'] = \get_parameter('colorChart'); $values['formatData'] = \get_parameter_switch('formatData'); $values['label'] = \get_parameter('label'); + $values['type_graph'] = \get_parameter('type_graph'); + $values['line_width'] = \get_parameter('line_width'); return $values; } @@ -606,6 +644,8 @@ class BasicChart extends Widget 'title' => $module_name, 'unit' => $units_name, 'only_image' => false, + 'type_graph' => $this->values['type_graph'], + 'line_width' => (empty($this->values['line_width']) === true) ? 3 : $this->values['line_width'], 'menu' => false, 'vconsole' => true, 'return_img_base_64' => false, From 4f51d31f3fff0dd8dbc3dcb25719dad91636363e Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 22 Jun 2023 11:55:59 +0200 Subject: [PATCH 19/66] #11360 historigram default 1hour --- .../godmode/reporting/reporting_builder.item_editor.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 32f73d21ed..3d5688106c 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -6651,6 +6651,8 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_historical_db_check").hide(); + period_set_value($("#hidden-period").attr('class'), 3600); + $("#row_period").find('select').val('3600').trigger('change'); break; case 'SLA_monthly': From 3f085e2482c86617279c788ca7fb98ed21110863 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 22 Jun 2023 12:01:05 +0200 Subject: [PATCH 20/66] #11057 text-shadow login span --- pandora_console/include/styles/login.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/include/styles/login.css b/pandora_console/include/styles/login.css index 4314296d15..30d29c584c 100644 --- a/pandora_console/include/styles/login.css +++ b/pandora_console/include/styles/login.css @@ -351,6 +351,7 @@ span.span1 { font-family: "lato-bolder"; color: #fff; margin-right: 30px; + text-shadow: 2px 2px #000; } span.span2 { @@ -361,6 +362,7 @@ span.span2 { font-family: "lato-bolder"; color: #fff; margin-right: 30px; + text-shadow: 2px 2px #000; } div.img_banner_login img { From b80962cb55389ea0bbd224aafa2c7ee85b64db3d Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 22 Jun 2023 14:30:54 +0200 Subject: [PATCH 21/66] #11644 action buttons select option delete agents --- pandora_console/godmode/massive/massive_delete_agents.php | 8 ++++++++ pandora_console/include/styles/pandora.css | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/pandora_console/godmode/massive/massive_delete_agents.php b/pandora_console/godmode/massive/massive_delete_agents.php index f5b194f3cc..ed7e1a95c5 100755 --- a/pandora_console/godmode/massive/massive_delete_agents.php +++ b/pandora_console/godmode/massive/massive_delete_agents.php @@ -189,6 +189,14 @@ echo get_table_inputs_masive_agents($params); if (is_metaconsole() === true || is_management_allowed() === true) { attachActionButton('delete', 'delete', '100%', false, $SelectAction); +} else { + html_print_action_buttons( + '', + [ + 'right_content' => $SelectAction, + 'class' => 'pdd_t_15px_important pdd_b_15px_important', + ] + ); } echo ''; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 034467f83e..79dfcc56b1 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -7606,6 +7606,10 @@ div.graph div.legend table { padding-bottom: 10px !important; } +.pdd_b_15px_important { + padding-bottom: 15px !important; +} + .pdd_b_20px { padding-bottom: 20px; } @@ -7684,6 +7688,10 @@ div.graph div.legend table { padding-top: 15px; } +.pdd_t_15px_important { + padding-top: 15px !important; +} + .pdd_t_20px { padding-top: 20px; } From 40ea25eeea94a678434b90d4ec34692382913f53 Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 22 Jun 2023 18:52:06 +0200 Subject: [PATCH 22/66] Clean deleted agents from dashboards, reports, etc --- pandora_console/include/functions_agents.php | 63 ++++++++++++++++++++ pandora_server/util/pandora_db.pl | 50 +++++++++++++++- 2 files changed, 112 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index f8bb2fc024..2c5ca86e7f 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -2769,6 +2769,69 @@ function agents_delete_agent($id_agents, $disableACL=false) enterprise_include_once('include/functions_agents.php'); enterprise_hook('agent_delete_from_cache', [$id_agent]); + // Delete agent from visual console. + db_process_sql_delete( + 'tlayout_data', + ['id_agent' => $id_agent] + ); + + // Delete agent from visual dashboards. + db_process_sql( + 'UPDATE twidget_dashboard + SET options = NULL + WHERE options LIKE ("%\"agentid\":\"'.$id_agent.'\"%")' + ); + + // Delete agent from treport. + db_process_sql_delete( + 'treport_content', + ['id_agent' => $id_agent] + ); + + // Delete rules from tevent alerts (correlative alerts) + db_process_sql_delete( + 'tevent_rule', + [ + 'agent' => $id_agent, + 'operator_agent' => '==', + ] + ); + + db_process_sql_delete( + 'tevent_rule', + [ + 'log_agent' => $id_agent, + 'operator_log_agent' => '==', + ] + ); + + // Delete from gis maps history + db_process_sql_delete( + 'tgis_data_history', + ['tagente_id_agente' => $id_agent] + ); + + // Delete from policies. + db_process_sql_delete( + 'tpolicy_agents', + ['id_agent' => $id_agent] + ); + + // Delete from tnetwork maps + db_process_sql_delete( + 'titem', + ['source_data' => $id_agent] + ); + + db_process_sql_delete( + 'trel_item', + [ + 'id_parent_source_data' => $id_agent, + 'id_child_source_data' => $id_agent, + ], + 'OR' + ); + // Delete agent from fav menu. db_process_sql_delete( 'tfavmenu_user', diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 31218a8f19..48ea46f7fe 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -760,7 +760,55 @@ sub pandora_checkdb_integrity { # Delete orphan data_inc reference records db_do ($dbh, 'DELETE FROM tagente_datos_inc WHERE id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)'); - + + # Delete orphan data form deleted agents. + my @agents_ids = get_db_rows ($dbh, 'SELECT id_agente, alias FROM tagente'); + my $agents_id = '0'; + my $agents_alias; + foreach my $id (@agents_ids) { + $agents_id .= ','.$id->{'id_agente'}; + $agents_alias .= ','.$id->{'alias'}; + } + if(defined($agents_id) && $agents_id ne '0') { + # Delete orphan data from visual console. + db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agent NOT IN (?)', $agents_id); + + # Clearl orphan data from dashboards + my $where_condition; + my $index ; + foreach my $agent_id (@agents_ids) { + $where_condition .= 'options NOT LIKE ("%\\"agentid\\":\\"'.$agent_id->{'id_agente'}.'\\"%")'; + if($agent_id == @agents_ids[-1]) { + last; + } + $where_condition .= ' AND '; + } + db_do ($dbh, 'UPDATE twidget_dashboard set options = NULL WHERE '.$where_condition); + + # Delete orphan report items. + db_do ($dbh, 'DELETE FROM treport_content WHERE id_agent != 0 AND id_agent NOT IN (?)', $agents_id); + + # Delete orphan tevent alert rules + db_do ($dbh, 'DELETE FROM tevent_rule WHERE agent IS NOT NULL AND agent != "" AND agent NOT IN (?) AND operator_agent = ?', $agents_alias, '=='); + db_do ($dbh, 'DELETE FROM tevent_rule WHERE log_agent IS NOT NULL AND log_agent != "" AND log_agent NOT IN (?) AND operator_log_agent = ?', $agents_alias, '=='); + + # Delete orphan data from favorite agents + db_do ($dbh, 'DELETE FROM tfavmenu_user WHERE section = "Agents" AND id_element NOT IN (?)', $agents_id); + + # Delete orphan data from tservices. + db_do ($dbh, 'DELETE FROM tservice_element WHERE id_agent NOT IN (?)', $agents_id); + + # Delete orphan data from gis maps + db_do ($dbh, 'DELETE FROM tgis_data_history WHERE tagente_id_agente NOT IN (?)', $agents_id); + + # Delete agents from policies + db_do ($dbh, 'DELETE FROM tpolicy_agents WHERE id_agent NOT IN (?)', $agents_id); + + # Delete orphan tnetwork maps data + db_do ($dbh, 'DELETE FROM titem WHERE source_data NOT IN (?)', $agents_id); + db_do ($dbh, 'DELETE FROM trel_item WHERE id_parent_source_data NOT IN (?) OR id_child_source_data NOT IN (?)', $agents_id, $agents_id); + } + # Check enterprise tables enterprise_hook ('pandora_checkdb_integrity_enterprise', [$conf, $dbh]); } From 7a3da419bd0efd2c97103bd45365cdf1c26953a2 Mon Sep 17 00:00:00 2001 From: Calvo Date: Fri, 23 Jun 2023 15:06:31 +0200 Subject: [PATCH 23/66] Clean deleted agents and modules from dashboards, reports, etc --- pandora_server/util/pandora_db.pl | 36 +++++++++++++++++-------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 48ea46f7fe..d8d61eb7df 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -764,51 +764,55 @@ sub pandora_checkdb_integrity { # Delete orphan data form deleted agents. my @agents_ids = get_db_rows ($dbh, 'SELECT id_agente, alias FROM tagente'); my $agents_id = '0'; - my $agents_alias; foreach my $id (@agents_ids) { $agents_id .= ','.$id->{'id_agente'}; - $agents_alias .= ','.$id->{'alias'}; } if(defined($agents_id) && $agents_id ne '0') { # Delete orphan data from visual console. + log_message ('INTEGRITY', "Deleting orphan visual console items."); db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agent NOT IN (?)', $agents_id); + db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)'); # Clearl orphan data from dashboards + log_message ('INTEGRITY', "Deleting orphan dahsboard items."); my $where_condition; - my $index ; foreach my $agent_id (@agents_ids) { $where_condition .= 'options NOT LIKE ("%\\"agentid\\":\\"'.$agent_id->{'id_agente'}.'\\"%")'; - if($agent_id == @agents_ids[-1]) { + if($agent_id == $agents_ids[-1]) { last; } $where_condition .= ' AND '; } + db_do ($dbh, 'UPDATE twidget_dashboard set options = NULL WHERE '.$where_condition); - # Delete orphan report items. - db_do ($dbh, 'DELETE FROM treport_content WHERE id_agent != 0 AND id_agent NOT IN (?)', $agents_id); + $where_condition = ''; + my @modules = get_db_rows($dbh, 'SELECT id_agente_modulo FROM tagente_modulo'); + foreach my $id_agente_modulo (@modules) { + print Dumper($id_agente_modulo); + $where_condition .= 'options NOT LIKE ("%\\"moduleId\\":\\"'.$id_agente_modulo->{'id_agente_modulo'}.'\\"%")'; + if($id_agente_modulo == $modules[-1]) { + last; + } + $where_condition .= ' AND '; + } - # Delete orphan tevent alert rules - db_do ($dbh, 'DELETE FROM tevent_rule WHERE agent IS NOT NULL AND agent != "" AND agent NOT IN (?) AND operator_agent = ?', $agents_alias, '=='); - db_do ($dbh, 'DELETE FROM tevent_rule WHERE log_agent IS NOT NULL AND log_agent != "" AND log_agent NOT IN (?) AND operator_log_agent = ?', $agents_alias, '=='); + db_do ($dbh, 'UPDATE twidget_dashboard set options = NULL WHERE '.$where_condition); # Delete orphan data from favorite agents + log_message ('INTEGRITY', "Deleting orphan favories items."); db_do ($dbh, 'DELETE FROM tfavmenu_user WHERE section = "Agents" AND id_element NOT IN (?)', $agents_id); - # Delete orphan data from tservices. - db_do ($dbh, 'DELETE FROM tservice_element WHERE id_agent NOT IN (?)', $agents_id); - # Delete orphan data from gis maps + log_message ('INTEGRITY', "Deleting orphan GIS data."); db_do ($dbh, 'DELETE FROM tgis_data_history WHERE tagente_id_agente NOT IN (?)', $agents_id); - # Delete agents from policies - db_do ($dbh, 'DELETE FROM tpolicy_agents WHERE id_agent NOT IN (?)', $agents_id); - # Delete orphan tnetwork maps data + log_message ('INTEGRITY', "Deleting orphan networkmaps data."); db_do ($dbh, 'DELETE FROM titem WHERE source_data NOT IN (?)', $agents_id); db_do ($dbh, 'DELETE FROM trel_item WHERE id_parent_source_data NOT IN (?) OR id_child_source_data NOT IN (?)', $agents_id, $agents_id); } - + # Check enterprise tables enterprise_hook ('pandora_checkdb_integrity_enterprise', [$conf, $dbh]); } From 51abf5328a91ce6e7b272b3fbb618271170eb4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Wed, 28 Jun 2023 17:55:25 -0600 Subject: [PATCH 24/66] Change URL and Email references --- pandora_agents/pc/DEBIAN/control | 2 +- pandora_agents/shellscript/linux/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/composer.lock | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/vendor/artica/phpchartjs/composer.json | 2 +- pandora_console/vendor/composer/installed.json | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/Makefile.PL | 2 +- tentacle/Makefile.PL | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pandora_agents/pc/DEBIAN/control b/pandora_agents/pc/DEBIAN/control index cdbcc99cfe..688b9fe895 100644 --- a/pandora_agents/pc/DEBIAN/control +++ b/pandora_agents/pc/DEBIAN/control @@ -4,7 +4,7 @@ Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: ÁRTICA ST +Maintainer: ÁRTICA ST Homepage: https://pandorafms.org/ Depends: coreutils, perl, unzip Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_agents/shellscript/linux/DEBIAN/control b/pandora_agents/shellscript/linux/DEBIAN/control index 55a5168f93..14288b1551 100755 --- a/pandora_agents/shellscript/linux/DEBIAN/control +++ b/pandora_agents/shellscript/linux/DEBIAN/control @@ -4,7 +4,7 @@ Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: ÁRTICA ST +Maintainer: ÁRTICA ST Homepage: http://pandorafms.org/ Depends: coreutils, perl Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 4074736a7b..9175dbbff6 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -4,7 +4,7 @@ Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: ÁRTICA ST +Maintainer: ÁRTICA ST Homepage: http://pandorafms.org/ Depends: coreutils, perl, unzip Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 90c5479759..4ce8489606 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -163,7 +163,7 @@ if [ $package_pear -eq 1 ] then echo "Make the package \"php-xml-rpc\"." cd temp_package - dh-make-pear --maintainer "ÁRTICA ST " XML_RPC + dh-make-pear --maintainer "ÁRTICA ST " XML_RPC cd php-xml-rpc-* dpkg-buildpackage -rfakeroot cd .. diff --git a/pandora_console/composer.lock b/pandora_console/composer.lock index d7a05579a9..cf6f9f2502 100644 --- a/pandora_console/composer.lock +++ b/pandora_console/composer.lock @@ -609,7 +609,7 @@ } ], "description": "PHP library for ChartJS", - "homepage": "https://artica.es/", + "homepage": "https://pandorafms.com/", "keywords": [ "chartjs", "graph", diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index d39c28a6da..f10233e698 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -15,7 +15,7 @@ Name: %{name} Version: %{version} Release: %{release} License: GPL -Vendor: Artica ST +Vendor: Artica ST #Source0: %{name}-%{version}-%{revision}.tar.gz Source0: %{name}-%{version}.tar.gz URL: http://www.pandorafms.com diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index 962d9c393e..22b7fa2915 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -15,7 +15,7 @@ Name: %{name} Version: %{version} Release: %{release} License: GPL -Vendor: Artica ST +Vendor: Artica ST #Source0: %{name}-%{version}-%{revision}.tar.gz Source0: %{name}-%{version}.tar.gz URL: http://www.pandorafms.com diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 9e3182bca6..667eb6d549 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -18,7 +18,7 @@ Name: %{name} Version: %{version} Release: %{release} License: GPL -Vendor: Artica ST +Vendor: Artica ST Source0: %{name}-%{version}.tar.gz URL: http://www.pandorafms.org Group: System/Monitoring diff --git a/pandora_console/vendor/artica/phpchartjs/composer.json b/pandora_console/vendor/artica/phpchartjs/composer.json index 81cd50ecf5..39d63f4fd4 100644 --- a/pandora_console/vendor/artica/phpchartjs/composer.json +++ b/pandora_console/vendor/artica/phpchartjs/composer.json @@ -7,7 +7,7 @@ "php" ], "readme": "README.md", - "homepage": "https://artica.es/", + "homepage": "https://pandorafms.com/", "type": "package", "version": "v1.0.2", "license": "AGPL-3.0-or-later", diff --git a/pandora_console/vendor/composer/installed.json b/pandora_console/vendor/composer/installed.json index 1022a9f68b..3679134135 100644 --- a/pandora_console/vendor/composer/installed.json +++ b/pandora_console/vendor/composer/installed.json @@ -629,7 +629,7 @@ } ], "description": "PHP library for ChartJS", - "homepage": "https://artica.es/", + "homepage": "https://pandorafms.com/", "keywords": [ "chartjs", "graph", diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 52bdf371ca..79eed8a7a4 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -4,7 +4,7 @@ Architecture: all Priority: optional Section: admin Installed-Size: 640 -Maintainer: ÁRTICA ST +Maintainer: ÁRTICA ST Homepage: http://pandorafms.org/ Depends: perl (>= 5.8), libdbi-perl, libdbd-mysql-perl, libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libxml-twig-perl, libhtml-parser-perl, snmp, snmpd, traceroute, nmap, sudo, libwww-perl, libsocket6-perl, libio-socket-inet6-perl, libio-socket-ssl-perl, snmp-mibs-downloader, libjson-perl, libnet-telnet-perl, libencode-locale-perl, libgeo-ip-perl Description: Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments. This is the server package. Server makes the remote checks and process information transfer by Pandora FMS agents to the server. diff --git a/pandora_server/Makefile.PL b/pandora_server/Makefile.PL index ac1c613f3b..acfb18860b 100644 --- a/pandora_server/Makefile.PL +++ b/pandora_server/Makefile.PL @@ -17,7 +17,7 @@ WriteMakefile( NAME => 'PandoraFMS', VERSION_FROM => 'lib/PandoraFMS/Config.pm', - AUTHOR => 'Artica ST ', + AUTHOR => 'Artica ST ', PREREQ_PM => { NetAddr::IP => 0, DBI => 0, diff --git a/tentacle/Makefile.PL b/tentacle/Makefile.PL index cc444b8524..ace5d54fa8 100644 --- a/tentacle/Makefile.PL +++ b/tentacle/Makefile.PL @@ -15,7 +15,7 @@ WriteMakefile( ) :(), NAME => 'PandoraFMS', - AUTHOR => 'Artica ST ', + AUTHOR => 'Artica ST ', EXE_FILES => [ @exe_files ], PMLIBDIRS => [ 'lib' ], 'dist' => { 'TAR' => 'tar', 'TARFLAGS' => 'cvfz', 'SUFFIX' => '.gz', 'COMPRESS' => 'gzip'} From da16993531e39e9f40264ddd081b9acbdf093486 Mon Sep 17 00:00:00 2001 From: rafael Date: Thu, 29 Jun 2023 10:45:41 +0200 Subject: [PATCH 25/66] 11296 remove dependencies and add proxytimeout --- .../pandora_deploy_community.sh | 10 ++++---- .../pandora_deploy_community_el8.sh | 14 ++++++----- .../pandora_deploy_community_ubuntu_2204.sh | 25 +++++++------------ 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index 2e40524588..c16729bca0 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -11,7 +11,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf -S_VERSION='2023050901' +S_VERSION='2023062901' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" # define default variables @@ -285,8 +285,7 @@ console_dependencies=" \ mod_ssl \ libzstd \ openldap-clients \ - chromium \ - http://firefly.pandorafms.com/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm" + chromium" execute_cmd "yum install -y $console_dependencies" "Installing Pandora FMS Console dependencies" # Server dependencies @@ -313,7 +312,6 @@ server_dependencies=" \ bind-utils \ whois \ cpanminus \ - http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \ https://firefly.pandorafms.com/centos7/pandorawmic-1.0.0-1.x86_64.rpm" execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies" @@ -341,7 +339,6 @@ execute_cmd "yum install -y $oracle_dependencies || yum reinstall -y $oracle_dep #ipam dependencies ipam_dependencies=" \ - http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \ perl(NetAddr::IP) \ perl(Sys::Syslog) \ perl(DBI) \ @@ -719,6 +716,9 @@ echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cro systemctl enable pandora_agent_daemon &>> $LOGFILE execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent" +# Enable postrix +systemctl enable postfix --now &>> "$LOGFILE" + #SSH banner [ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me) diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index 972a094c95..3b4dde6cef 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -14,7 +14,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf -S_VERSION='2023050901' +S_VERSION='2023062901' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" # define default variables @@ -344,8 +344,7 @@ console_dependencies=" \ http://firefly.pandorafms.com/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \ http://firefly.pandorafms.com/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \ http://firefly.pandorafms.com/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ - http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \ - http://firefly.pandorafms.com/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm" + http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm" execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies" # Server dependencies @@ -371,7 +370,7 @@ server_dependencies=" \ java \ bind-utils \ whois \ - http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \ + libnsl \ http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \ https://firefly.pandorafms.com/centos8/pandorawmic-1.0.0-1.x86_64.rpm" execute_cmd "dnf install -y $server_dependencies" "Installing Pandora FMS Server dependencies" @@ -399,7 +398,6 @@ execute_cmd "dnf install -y $oracle_dependencies" "Installing Oracle Instant cli #ipam dependencies ipam_dependencies=" \ - http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \ perl(NetAddr::IP) \ perl(Sys::Syslog) \ perl(DBI) \ @@ -622,8 +620,9 @@ sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini sed -i -e "s/.*post_max_size =.*/post_max_size = 800M/" /etc/php.ini -#adding 900s to httpd timeout +#adding 900s to httpd timeout and 300 to ProxyTimeout echo 'TimeOut 900' > /etc/httpd/conf.d/timeout.conf +echo 'ProxyTimeout 300' >> /etc/httpd/conf.d/timeout.conf cat > /var/www/html/index.html << EOF_INDEX @@ -787,6 +786,9 @@ echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cro systemctl enable pandora_agent_daemon &>> "$LOGFILE" execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent" +# Enable postfix +systemctl enable postfix --now &>> "$LOGFILE" + #SSH banner [ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me) diff --git a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh index 3d31ae10af..7e2ff6f532 100644 --- a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh +++ b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh @@ -17,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf WORKDIR=/opt/pandora/deploy -S_VERSION='2023050901' +S_VERSION='2023062901' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" rm -f $LOGFILE &> /dev/null # remove last log before start @@ -265,7 +265,6 @@ server_dependencies=" \ openssh-client \ postfix \ unzip \ - xprobe \ coreutils \ libio-compress-perl \ libmoosex-role-timer-perl \ @@ -287,6 +286,7 @@ server_dependencies=" \ libgeo-ip-perl \ arping \ snmp-mibs-downloader \ + libnsl2 \ openjdk-8-jdk " execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies" @@ -299,17 +299,7 @@ echo -en "${cyan}Installing wmic and pandorawmic...${reset}" chmod +x pandorawmic wmic &>> "$LOGFILE" && \ cp -a wmic /usr/bin/ &>> "$LOGFILE" && \ cp -a pandorawmic /usr/bin/ &>> "$LOGFILE" -check_cmd_status "Error Installing phanromjs" - -# phantomjs -echo -en "${cyan}Installing phantomjs...${reset}" - export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64" - export OPENSSL_CONF=/etc/ssl - curl -LSs -O "https://firefly.pandorafms.com/pandorafms/utils/$PHANTOM_JS.tar.bz2" &>> "$LOGFILE" && \ - tar xvjf "$PHANTOM_JS.tar.bz2" &>> "$LOGFILE" && \ - mv $PHANTOM_JS/bin/phantomjs /usr/bin &>> "$LOGFILE" && \ - /usr/bin/phantomjs --version &>> "$LOGFILE" -check_cmd_status "Error Installing phanromjs" +check_cmd_status "Error Installing pandorawmic/wmic" # create symlink for fping rm -f /usr/sbin/fping &>> "$LOGFILE" @@ -370,7 +360,6 @@ source '/root/.profile' &>> "$LOGFILE" #ipam dependencies ipam_dependencies=" \ - xprobe \ libnetaddr-ip-perl \ coreutils \ libdbd-mysql-perl \ @@ -619,8 +608,9 @@ sed --follow-symlinks -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.i sed --follow-symlinks -i -e "s/.*post_max_size =.*/post_max_size = 800M/" /etc/php.ini sed --follow-symlinks -i -e "s/^disable_functions/;disable_functions/" /etc/php.ini -#adding 900s to httpd timeout -#echo 'TimeOut 900' > /etc/httpd/conf.d/timeout.conf +#adding 900s to httpd timeout and 300 to ProxyTimeout +echo 'TimeOut 900' > /etc/apache2/conf-enabled/timeout.conf +echo 'ProxyTimeout 300' >> /etc/apache2/conf-enabled/timeout.conf cat > /var/www/html/index.html << EOF_INDEX @@ -792,6 +782,9 @@ systemctl enable pandora_agent_daemon &>> "$LOGFILE" #fix path phantomjs sed --follow-symlinks -i -e "s/^openssl_conf = openssl_init/#openssl_conf = openssl_init/g" /etc/ssl/openssl.cnf &>> "$LOGFILE" +# Enable postfix +systemctl enable postfix --now &>> "$LOGFILE" + #SSH banner [ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me) From 16ae738867317fb0ea29c4acedb7874198342da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Thu, 29 Jun 2023 08:06:25 -0600 Subject: [PATCH 26/66] Change Artica references --- pandora_agents/pc/DEBIAN/control | 2 +- pandora_agents/shellscript/linux/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/control | 2 +- .../PandoraFMS agent uninstaller.app/Contents/Info.plist | 2 +- pandora_agents/win32/versioninfo.rc | 4 ++-- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandora_websocket_engine | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/Makefile.PL | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- tentacle/Makefile.PL | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pandora_agents/pc/DEBIAN/control b/pandora_agents/pc/DEBIAN/control index 688b9fe895..ac23fd959f 100644 --- a/pandora_agents/pc/DEBIAN/control +++ b/pandora_agents/pc/DEBIAN/control @@ -4,7 +4,7 @@ Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: ÁRTICA ST +Maintainer: Pandora FMS Homepage: https://pandorafms.org/ Depends: coreutils, perl, unzip Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_agents/shellscript/linux/DEBIAN/control b/pandora_agents/shellscript/linux/DEBIAN/control index 14288b1551..2ffdee57df 100755 --- a/pandora_agents/shellscript/linux/DEBIAN/control +++ b/pandora_agents/shellscript/linux/DEBIAN/control @@ -4,7 +4,7 @@ Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: ÁRTICA ST +Maintainer: Pandora FMS Homepage: http://pandorafms.org/ Depends: coreutils, perl Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 9175dbbff6..661de7c7db 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -4,7 +4,7 @@ Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: ÁRTICA ST +Maintainer: Pandora FMS Homepage: http://pandorafms.org/ Depends: coreutils, perl, unzip Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_agents/unix/Darwin/dmg/files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/Info.plist b/pandora_agents/unix/Darwin/dmg/files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/Info.plist index 4ee8965fef..1edb91b81a 100644 --- a/pandora_agents/unix/Darwin/dmg/files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/Info.plist +++ b/pandora_agents/unix/Darwin/dmg/files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/Info.plist @@ -6,7 +6,7 @@ CFBundleIdentifier com.pandorafms.pandorafms_uninstall CFBundleVersion 7.0NG.772 - CFBundleGetInfoString 7.0NG.772 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020 + CFBundleGetInfoString 7.0NG.772 Pandora FMS Agent uninstaller for MacOS by Pandora FMS on Aug 2020 CFBundleShortVersionString 7.0NG.772 NSPrincipalClassNSApplication diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 730e8fd86b..fb089c0c13 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -6,9 +6,9 @@ BEGIN BEGIN BLOCK "080904E4" BEGIN - VALUE "CompanyName", "Artica ST" + VALUE "CompanyName", "Pandora FMS" VALUE "FileDescription", "Pandora FMS Agent for Windows Platform" - VALUE "LegalCopyright", "Artica ST" + VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductVersion", "(7.0NG.772(Build 230629))" diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index ef67f763bc..1c914324b4 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -4,7 +4,7 @@ Architecture: all Priority: optional Section: admin Installed-Size: 42112 -Maintainer: Artica ST +Maintainer: Pandora FMS Homepage: https://pandorafms.com/ Depends: php, php-snmp, php-gd, php-mysqlnd, php-db, php-xmlrpc, php-curl, graphviz, dbconfig-common, php-ldap, mysql-client | virtual-mysql-client, php-xmlrpc, php-zip, php-mbstring Description: Pandora FMS is an Open Source monitoring tool. It monitor your systems and applications, and allows you to control the status of any element of them. The web console is the graphical user interface (GUI) to manage the pool and to generate reports and graphs from the Pandora FMS monitoring process. diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 4ce8489606..cda538807a 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -163,7 +163,7 @@ if [ $package_pear -eq 1 ] then echo "Make the package \"php-xml-rpc\"." cd temp_package - dh-make-pear --maintainer "ÁRTICA ST " XML_RPC + dh-make-pear --maintainer "Pandora FMS " XML_RPC cd php-xml-rpc-* dpkg-buildpackage -rfakeroot cd .. diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index f10233e698..d286b2bdd5 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -15,7 +15,7 @@ Name: %{name} Version: %{version} Release: %{release} License: GPL -Vendor: Artica ST +Vendor: Pandora FMS #Source0: %{name}-%{version}-%{revision}.tar.gz Source0: %{name}-%{version}.tar.gz URL: http://www.pandorafms.com diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index 22b7fa2915..95a4ff9244 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -15,7 +15,7 @@ Name: %{name} Version: %{version} Release: %{release} License: GPL -Vendor: Artica ST +Vendor: Pandora FMS #Source0: %{name}-%{version}-%{revision}.tar.gz Source0: %{name}-%{version}.tar.gz URL: http://www.pandorafms.com diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 667eb6d549..34f1d34352 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -18,7 +18,7 @@ Name: %{name} Version: %{version} Release: %{release} License: GPL -Vendor: Artica ST +Vendor: Pandora FMS Source0: %{name}-%{version}.tar.gz URL: http://www.pandorafms.org Group: System/Monitoring diff --git a/pandora_console/pandora_websocket_engine b/pandora_console/pandora_websocket_engine index fb5b7551bb..3a41593c1f 100755 --- a/pandora_console/pandora_websocket_engine +++ b/pandora_console/pandora_websocket_engine @@ -39,7 +39,7 @@ if [[ -z ${PANDORA_RB_PRODUCT_NAME} ]]; then PANDORA_RB_PRODUCT_NAME="Pandora FMS" fi if [[ -z ${PANDORA_RB_COPYRIGHT_NOTICE} ]]; then - PANDORA_RB_COPYRIGHT_NOTICE="Artica ST" + PANDORA_RB_COPYRIGHT_NOTICE="Pandora FMS" fi export PANDORA_RB_PRODUCT_NAME=$PANDORA_RB_PRODUCT_NAME diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 79eed8a7a4..c383595a4a 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -4,7 +4,7 @@ Architecture: all Priority: optional Section: admin Installed-Size: 640 -Maintainer: ÁRTICA ST +Maintainer: Pandora FMS Homepage: http://pandorafms.org/ Depends: perl (>= 5.8), libdbi-perl, libdbd-mysql-perl, libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libxml-twig-perl, libhtml-parser-perl, snmp, snmpd, traceroute, nmap, sudo, libwww-perl, libsocket6-perl, libio-socket-inet6-perl, libio-socket-ssl-perl, snmp-mibs-downloader, libjson-perl, libnet-telnet-perl, libencode-locale-perl, libgeo-ip-perl Description: Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments. This is the server package. Server makes the remote checks and process information transfer by Pandora FMS agents to the server. diff --git a/pandora_server/Makefile.PL b/pandora_server/Makefile.PL index acfb18860b..107bd69c3f 100644 --- a/pandora_server/Makefile.PL +++ b/pandora_server/Makefile.PL @@ -17,7 +17,7 @@ WriteMakefile( NAME => 'PandoraFMS', VERSION_FROM => 'lib/PandoraFMS/Config.pm', - AUTHOR => 'Artica ST ', + AUTHOR => 'Pandora FMS ', PREREQ_PM => { NetAddr::IP => 0, DBI => 0, diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index ba2311be96..97b236aa3e 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -1527,7 +1527,7 @@ sub pandora_get_initial_product_name { sub pandora_get_initial_copyright_notice { # PandoraFMS product name my $name = $ENV{'PANDORA_RB_COPYRIGHT_NOTICE'}; - return 'Artica ST' unless (defined ($name) && $name ne ''); + return 'Pandora FMS' unless (defined ($name) && $name ne ''); return $name; } diff --git a/tentacle/Makefile.PL b/tentacle/Makefile.PL index ace5d54fa8..94156d5731 100644 --- a/tentacle/Makefile.PL +++ b/tentacle/Makefile.PL @@ -15,7 +15,7 @@ WriteMakefile( ) :(), NAME => 'PandoraFMS', - AUTHOR => 'Artica ST ', + AUTHOR => 'Pandora FMS ', EXE_FILES => [ @exe_files ], PMLIBDIRS => [ 'lib' ], 'dist' => { 'TAR' => 'tar', 'TARFLAGS' => 'cvfz', 'SUFFIX' => '.gz', 'COMPRESS' => 'gzip'} From dfd5b5dd9bb162b1a5cf7ffef8455135ce758f31 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Thu, 29 Jun 2023 16:09:25 +0200 Subject: [PATCH 27/66] show server conf remote edition in at least one server element --- .../godmode/servers/servers.build_table.php | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index cce4e1e053..143f217c28 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -101,6 +101,14 @@ foreach ($servers as $server) { } } +//unset($servers[1]); +$ext = ''; + +// Check for any data-type server present in servers list. If none, enable server access for first server. +if (array_search('data', array_column($servers, 'type')) === false) { + $ext = '_server'; +} + foreach ($servers as $server) { $data = []; @@ -185,14 +193,12 @@ foreach ($servers as $server) { $data[7] = ui_print_timestamp($server['keepalive'], true); - - $ext = '_server'; - if ($server['type'] != 'data') { - $ext = ''; + if ($server['type'] === 'data') { + $ext = '_server'; } $safe_server_name = servers_get_name($server['id_server']); - if (($server['type'] == 'data' || $server['type'] == 'enterprise satellite')) { + if (($ext === '_server' || $server['type'] == 'enterprise satellite')) { if (servers_check_remote_config($safe_server_name.$ext) && enterprise_installed()) { $names_servers[$safe_server_name] = true; } else { @@ -253,8 +259,8 @@ foreach ($servers as $server) { ); $data[8] .= ''; - if (($names_servers[$safe_server_name] === true) && ($server['type'] === 'data' || $server['type'] === 'enterprise satellite')) { - $data[8] .= ''; + if ($ext === '_server' || $server['type'] === 'enterprise satellite') { + $data[8] .= ''; $data[8] .= html_print_image( 'images/agents@svg.svg', true, @@ -298,6 +304,8 @@ foreach ($servers as $server) { unset($data[8]); } + $ext = ''; + array_push($table->data, $data); } From 29f9b3b0f59bdd707fec0c86d0c022f0bb32ff7f Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Thu, 29 Jun 2023 16:13:47 +0200 Subject: [PATCH 28/66] show server conf remote edition in at least one server element --- pandora_console/godmode/servers/servers.build_table.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index 143f217c28..2bc4f5217e 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -101,7 +101,6 @@ foreach ($servers as $server) { } } -//unset($servers[1]); $ext = ''; // Check for any data-type server present in servers list. If none, enable server access for first server. @@ -259,7 +258,7 @@ foreach ($servers as $server) { ); $data[8] .= ''; - if ($ext === '_server' || $server['type'] === 'enterprise satellite') { + if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) { $data[8] .= ''; $data[8] .= html_print_image( 'images/agents@svg.svg', From 6c54a877db3c1ff118ea0dede38c91ecaf9db8fb Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 6 Jul 2023 12:30:26 +0200 Subject: [PATCH 29/66] #11698 The modules are added to the select Cascade protection modules in the agent configuration --- pandora_console/godmode/agentes/agent_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index b161b7ff6d..c1a14a31f5 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -212,7 +212,7 @@ $groups = users_get_groups($config['id_user'], 'AR', false); // Get modules. $modules = db_get_all_rows_sql( 'SELECT id_agente_modulo as id_module, nombre as name FROM tagente_modulo - WHERE id_agente = '.$id_parent + WHERE id_agente = '.$id_agente ); $modules_values = []; $modules_values[0] = __('Any'); From 93571d1eb65258149d53fafa8f8b601197941a13 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 11 Jul 2023 14:10:55 +0200 Subject: [PATCH 30/66] #11708 fix delete image category metaconsole --- pandora_console/godmode/category/category.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/category/category.php b/pandora_console/godmode/category/category.php index 9872a002f5..46095b6efb 100755 --- a/pandora_console/godmode/category/category.php +++ b/pandora_console/godmode/category/category.php @@ -184,7 +184,7 @@ if (empty($result) === false) { ] ).'  '; $data[1] .= ''.html_print_image( - 'images/delet.svg', + 'images/delete.svg', true, [ 'title' => __('Delete'), From f6637e3827fabfa91d9617a5d2284f5058963f55 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Wed, 12 Jul 2023 10:19:08 +0200 Subject: [PATCH 31/66] #11031 fix audit log filter --- pandora_console/include/ajax/audit_log.php | 11 ++++++----- pandora_console/include/class/AuditLog.class.php | 13 +++++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/ajax/audit_log.php b/pandora_console/include/ajax/audit_log.php index c979568b21..026d8ca881 100644 --- a/pandora_console/include/ajax/audit_log.php +++ b/pandora_console/include/ajax/audit_log.php @@ -84,7 +84,7 @@ if ($save_log_filter) { if ($recover_aduit_log_select) { - echo json_encode(audit_get_audit_filter_select()); + echo json_encode(audit_get_audit_filter_select_fix_order()); } if ($update_log_filter) { @@ -190,7 +190,7 @@ function show_filter() { draggable: true, modal: false, closeOnEscape: true, - width: 380 + width: "auto" }); } @@ -207,12 +207,13 @@ function load_filter_values() { }, success: function(data) { var options = ""; + console.log(data); $.each(data,function(i,value){ if (i == 'text'){ $("#text-filter_text").val(value); } if (i == 'period'){ - $("#text-filter_period").val(value); + $("#filter_period").val(value).change(); } if (i == 'ip'){ $("#text-filter_ip").val(value); @@ -395,7 +396,7 @@ function save_new_filter() { "save_log_filter" : 1, "id_name" : $("#text-id_name").val(), "text" : $("#text-filter_text").val(), - "period" : $("#text-filter_period").val(), + "period" : $("#filter_period :selected").val(), "ip" : $('#text-filter_ip').val(), "type" : $('#filter_type :selected').val(), "user" : $('#filter_user :selected').val(), @@ -431,7 +432,7 @@ function save_update_filter() { "update_log_filter" : 1, "id" : $("#overwrite_filter :selected").val(), "text" : $("#text-filter_text").val(), - "period" : $("#text-filter_period").val(), + "period" : $("#filter_period :selected").val(), "ip" : $('#text-filter_ip').val(), "type" : $('#filter_type :selected').val(), "user" : $('#filter_user :selected').val(), diff --git a/pandora_console/include/class/AuditLog.class.php b/pandora_console/include/class/AuditLog.class.php index 98bca38e43..48ed1012d7 100644 --- a/pandora_console/include/class/AuditLog.class.php +++ b/pandora_console/include/class/AuditLog.class.php @@ -469,7 +469,7 @@ class AuditLog extends HTML success: function(data) { var options = ""; $.each(data,function(key,value){ - options += ""; + options += ""; }); $('#overwrite_filter').html(options); $('#overwrite_filter').select2(); @@ -509,8 +509,12 @@ class AuditLog extends HTML /* Filter management */ $('#button-load-filter').click(function (){ if($('#load-filter-select').length) { - $('#load-filter-select').dialog({width: "20%", - maxWidth: "25%", + $('#load-filter-select').dialog({ + resizable: true, + draggable: true, + modal: false, + closeOnEscape: true, + width: "auto", title: "" }); $.ajax({ @@ -523,8 +527,9 @@ class AuditLog extends HTML }, success: function(data) { var options = ""; + console.log(data) $.each(data,function(key,value){ - options += ""; + options += ""; }); $('#filter_id').html(options); $('#filter_id').select2(); From 8332dce8502616a4b870ecf606b93788f7284a9b Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Wed, 12 Jul 2023 13:15:46 +0200 Subject: [PATCH 32/66] #11724 Fix show hide button --- pandora_console/include/functions_html.php | 5 ++++- pandora_console/include/styles/pandora.css | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 1fe9e3236d..5c1afa0d8a 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -5503,7 +5503,10 @@ function html_print_input($data, $wrapper='div', $input_only=false) ($data['attributes'] ?? null), ((isset($data['return']) === true) ? $data['return'] : false), ((isset($data['password']) === true) ? $data['password'] : false), - ((isset($data['function']) === true) ? $data['function'] : '') + ((isset($data['function']) === true) ? $data['function'] : ''), + ((isset($data['autocomplete']) === true) ? $data['autocomplete'] : 'off'), + ((isset($data['disabled']) === true) ? $data['disabled'] : false), + ((isset($data['hide_div_eye']) === true) ? $data['hide_div_eye'] : false), ); break; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index d4fec36d08..47ad6dfe0d 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -11662,14 +11662,14 @@ p.trademark-copyright { } .show-hide-pass { - position: relative; - right: 40px; + position: absolute; + right: 9px; top: 4px; border: 0; outline: none; margin: 0; height: 30px; - width: 30px; + width: 40px; cursor: pointer; display: inline-block; } From 2af618b765b83540346d14808232d7e521bf9ca8 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Wed, 12 Jul 2023 14:11:00 +0200 Subject: [PATCH 33/66] #11726 Fix alert status column name agent --- pandora_console/operation/agentes/alerts_status.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 4db865990f..5f987cf286 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -258,7 +258,8 @@ if ((bool) check_acl($config['id_user'], $id_group, 'LW') === true || (bool) che ); } - if ($print_agent === true) { + /* + if ($print_agent === true) { array_push( $column_names, ['text' => 'Agent'] @@ -268,11 +269,12 @@ if ((bool) check_acl($config['id_user'], $id_group, 'LW') === true || (bool) che $columns, ['agent_name'] ); - } + }*/ } array_push( $column_names, + ['text' => 'Agent'], ['text' => 'Module'], ['text' => 'Template'], [ @@ -286,6 +288,7 @@ array_push( $columns = array_merge( $columns, + ['agent_name'], ['agent_module_name'], ['template_name'], ['action'], From ab590f64931638a5367d38b8a4cd79306d56f041 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 12 Jul 2023 16:24:46 +0200 Subject: [PATCH 34/66] #11716 fix size plugins preview --- pandora_console/godmode/servers/plugin.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index 04b622e312..315702528e 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -560,7 +560,14 @@ if (empty($create) === false || empty($view) === false) { // $data[0] = html_print_div(['id' => 'command_preview', 'class' => 'mono'], true); $data[0] = html_print_label_input_block( __('Command preview'), - html_print_div(['id' => 'command_preview', 'class' => 'mono'], true) + html_print_div( + [ + 'id' => 'command_preview', + 'class' => 'mono', + 'style' => 'max-width: 1050px;overflow-wrap: break-word;', + ], + true + ) ); $table->data['plugin_preview_inputs'] = $data; $table->colspan['plugin_preview_inputs'][0] = 2; From f96adf59e9fedf60058ca0ed4ac54e8ae0f53584 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 17 Jul 2023 10:16:13 +0200 Subject: [PATCH 35/66] #11737 Fix pgp update required message --- pandora_console/include/class/ConsoleSupervisor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index cb9435b559..5916f5bf12 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -1807,7 +1807,7 @@ class ConsoleSupervisor $this->cleanNotifications('NOTIF.PHP.SERIALIZE_PRECISION'); } - if (version_compare('8.1', PHP_VERSION) >= 0) { + if (version_compare('8.0.29', PHP_VERSION) > 0) { $url = 'https://www.php.net/supported-versions.php'; $this->notify( [ From d3fded0fa88a1143a9e0d814e917c415f2b4ad96 Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 17 Jul 2023 12:02:48 +0200 Subject: [PATCH 36/66] Deleted missing Dumper --- pandora_server/util/pandora_db.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index d8d61eb7df..671ac819fc 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -789,7 +789,6 @@ sub pandora_checkdb_integrity { $where_condition = ''; my @modules = get_db_rows($dbh, 'SELECT id_agente_modulo FROM tagente_modulo'); foreach my $id_agente_modulo (@modules) { - print Dumper($id_agente_modulo); $where_condition .= 'options NOT LIKE ("%\\"moduleId\\":\\"'.$id_agente_modulo->{'id_agente_modulo'}.'\\"%")'; if($id_agente_modulo == $modules[-1]) { last; From 567bfdcbb7a017be39dbf91aafc42e05c5651c26 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 17 Jul 2023 13:08:13 +0200 Subject: [PATCH 37/66] #11737 Fix version --- pandora_console/include/class/ConsoleSupervisor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 5916f5bf12..9142f9a692 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -1807,7 +1807,8 @@ class ConsoleSupervisor $this->cleanNotifications('NOTIF.PHP.SERIALIZE_PRECISION'); } - if (version_compare('8.0.29', PHP_VERSION) > 0) { + // If PHP_VERSION is lower than 8.0.27 version_compare() returns 1. + if (version_compare('8.0.27', PHP_VERSION) === 1) { $url = 'https://www.php.net/supported-versions.php'; $this->notify( [ From 8aaa98a741468b1adccc43961ba20fd707cba25f Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 17 Jul 2023 14:10:08 +0200 Subject: [PATCH 38/66] #10254 added message timeout --- pandora_console/include/auth/mysql.php | 1 - pandora_console/index.php | 1 - 2 files changed, 2 deletions(-) diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index 5f4b1cfe59..ef619236c8 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -244,7 +244,6 @@ function process_user_login_remote($login, $pass, $api=false) } if ($sr === false) { - $config['auth_error'] = 'User not found in database or incorrect password'; return false; } break; diff --git a/pandora_console/index.php b/pandora_console/index.php index a1304963c1..4d37baceb2 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -711,7 +711,6 @@ if (isset($config['id_user']) === false) { login_check_failed($nick); } - $config['auth_error'] = __('User is blocked'); $login_failed = true; } From 24b555da87c1bb37abab33c12cae6f7cd138c96d Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 17 Jul 2023 16:31:40 +0200 Subject: [PATCH 39/66] Optimize pandora_db iterations when possible --- pandora_server/util/pandora_db.pl | 85 +++++++++++++++---------------- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 671ac819fc..c3648d6fc6 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -761,56 +761,51 @@ sub pandora_checkdb_integrity { # Delete orphan data_inc reference records db_do ($dbh, 'DELETE FROM tagente_datos_inc WHERE id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)'); + # Delete orphan data from visual console. + log_message ('INTEGRITY', "Deleting orphan visual console items."); + db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agent NOT IN (SELECT id_agente FROM tagente)'); + db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)'); + # Delete orphan data form deleted agents. - my @agents_ids = get_db_rows ($dbh, 'SELECT id_agente, alias FROM tagente'); - my $agents_id = '0'; - foreach my $id (@agents_ids) { - $agents_id .= ','.$id->{'id_agente'}; + # Clearl orphan data from dashboards + log_message ('INTEGRITY', "Deleting orphan dahsboard items."); + my @agents_ids = get_db_rows($dbh, 'SELECT id_agente FROM tagente'); + my $where_condition; + foreach my $agent_id (@agents_ids) { + $where_condition .= 'options NOT LIKE ("%\\"agentid\\":\\"'.$agent_id->{'id_agente'}.'\\"%")'; + if($agent_id == $agents_ids[-1]) { + last; + } + $where_condition .= ' AND '; } - if(defined($agents_id) && $agents_id ne '0') { - # Delete orphan data from visual console. - log_message ('INTEGRITY', "Deleting orphan visual console items."); - db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agent NOT IN (?)', $agents_id); - db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)'); - # Clearl orphan data from dashboards - log_message ('INTEGRITY', "Deleting orphan dahsboard items."); - my $where_condition; - foreach my $agent_id (@agents_ids) { - $where_condition .= 'options NOT LIKE ("%\\"agentid\\":\\"'.$agent_id->{'id_agente'}.'\\"%")'; - if($agent_id == $agents_ids[-1]) { - last; - } - $where_condition .= ' AND '; - } + db_do ($dbh, 'UPDATE twidget_dashboard set options = NULL WHERE '.$where_condition); - db_do ($dbh, 'UPDATE twidget_dashboard set options = NULL WHERE '.$where_condition); - - $where_condition = ''; - my @modules = get_db_rows($dbh, 'SELECT id_agente_modulo FROM tagente_modulo'); - foreach my $id_agente_modulo (@modules) { - $where_condition .= 'options NOT LIKE ("%\\"moduleId\\":\\"'.$id_agente_modulo->{'id_agente_modulo'}.'\\"%")'; - if($id_agente_modulo == $modules[-1]) { - last; - } - $where_condition .= ' AND '; - } - - db_do ($dbh, 'UPDATE twidget_dashboard set options = NULL WHERE '.$where_condition); - - # Delete orphan data from favorite agents - log_message ('INTEGRITY', "Deleting orphan favories items."); - db_do ($dbh, 'DELETE FROM tfavmenu_user WHERE section = "Agents" AND id_element NOT IN (?)', $agents_id); - - # Delete orphan data from gis maps - log_message ('INTEGRITY', "Deleting orphan GIS data."); - db_do ($dbh, 'DELETE FROM tgis_data_history WHERE tagente_id_agente NOT IN (?)', $agents_id); - - # Delete orphan tnetwork maps data - log_message ('INTEGRITY', "Deleting orphan networkmaps data."); - db_do ($dbh, 'DELETE FROM titem WHERE source_data NOT IN (?)', $agents_id); - db_do ($dbh, 'DELETE FROM trel_item WHERE id_parent_source_data NOT IN (?) OR id_child_source_data NOT IN (?)', $agents_id, $agents_id); + $where_condition = ''; + my @modules = get_db_rows($dbh, 'SELECT id_agente_modulo FROM tagente_modulo'); + foreach my $id_agente_modulo (@modules) { + $where_condition .= 'options NOT LIKE ("%\\"moduleId\\":\\"'.$id_agente_modulo->{'id_agente_modulo'}.'\\"%")'; + if($id_agente_modulo == $modules[-1]) { + last; + } + $where_condition .= ' AND '; } + + db_do ($dbh, 'UPDATE twidget_dashboard set options = NULL WHERE '.$where_condition); + + # Delete orphan data from favorite agents + log_message ('INTEGRITY', "Deleting orphan favories items."); + db_do ($dbh, 'DELETE FROM tfavmenu_user WHERE section = "Agents" AND id_element NOT IN (SELECT id_agente FROM tagente)'); + + # Delete orphan data from gis maps + log_message ('INTEGRITY', "Deleting orphan GIS data."); + db_do ($dbh, 'DELETE FROM tgis_data_history WHERE tagente_id_agente NOT IN (SELECT id_agente FROM tagente)'); + + # Delete orphan tnetwork maps data + log_message ('INTEGRITY', "Deleting orphan networkmaps data."); + db_do ($dbh, 'DELETE FROM titem WHERE source_data NOT IN (SELECT id_agente FROM tagente)'); + db_do ($dbh, 'DELETE FROM trel_item WHERE id_parent_source_data NOT IN (SELECT id_agente FROM tagente) OR id_child_source_data NOT IN (SELECT id_agente FROM tagente)'); + # Check enterprise tables enterprise_hook ('pandora_checkdb_integrity_enterprise', [$conf, $dbh]); From 5806da78dd58e9ed6302d593c4b5689ccd6328a2 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 18 Jul 2023 10:18:30 +0200 Subject: [PATCH 40/66] #11487 Fixed subgroups --- pandora_console/include/functions_graph.php | 23 +++++++++---------- .../agentes/pandora_networkmap.editor.php | 8 ++++++- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 116deea959..ddf68475c6 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -4983,19 +4983,18 @@ function graph_monitor_wheel($width=550, $height=600, $filter=false) $filter_module_group = (!empty($filter) && !empty($filter['module_group'])) ? $filter['module_group'] : false; if ($filter['group'] != 0) { - $filter_subgroups = ''; - if (!$filter['dont_show_subgroups']) { - $filter_subgroups = ' || parent IN ('.$filter['group'].')'; + if ($filter['dont_show_subgroups'] === false) { + $groups = groups_get_children($filter['group']); + $groups_ax = []; + foreach ($groups as $g) { + $groups_ax[$g['id_grupo']] = $g; + } + + $groups = $groups_ax; + } else { + $groups = groups_get_group_by_id($filter['group']); + $groups[$group['id_grupo']] = $group; } - - $groups = db_get_all_rows_sql('SELECT * FROM tgrupo where id_grupo IN ('.$filter['group'].') '.$filter_subgroups); - - $groups_ax = []; - foreach ($groups as $g) { - $groups_ax[$g['id_grupo']] = $g; - } - - $groups = $groups_ax; } else { $groups = users_get_groups(false, 'AR', false, true, (!empty($filter) && isset($filter['group']) ? $filter['group'] : null)); } diff --git a/pandora_console/operation/agentes/pandora_networkmap.editor.php b/pandora_console/operation/agentes/pandora_networkmap.editor.php index ac73c474aa..3dea327116 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.editor.php +++ b/pandora_console/operation/agentes/pandora_networkmap.editor.php @@ -205,9 +205,15 @@ if ($edit_networkmap) { $button = []; if ($edit_networkmap === true) { + if (empty($method) === false && $method === 'radial_dinamic') { + $url = 'index.php?sec=network&sec2=operation/agentes/networkmap.dinamic&activeTab=radial_dynamic&id_networkmap='.$id; + } else { + $url = 'index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=view&id_networkmap='.$id; + } + $button['map'] = [ 'active' => false, - 'text' => ''.html_print_image( + 'text' => ''.html_print_image( 'images/network@svg.svg', true, [ From e645f65e8e1be6aa41e722d60afb4c9cb8365ca0 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 19 Jul 2023 01:00:45 +0200 Subject: [PATCH 41/66] 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 25cc4317bc..6e5a9ccc64 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-230718 +Version: 7.0NG.772-230719 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 841e77f29d..75850e3771 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-230718" +pandora_version="7.0NG.772-230719" 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 2d7565e722..37f16c658f 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 => '230718'; +use constant AGENT_BUILD => '230719'; # 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 7adf1af667..be1df542a1 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 230718 +%define release 230719 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 2fb3a3c47f..1713a34f17 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 230718 +%define release 230719 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 476bcfff87..90b464d570 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="230718" +PI_BUILD="230719" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 25d53728df..a147da9939 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230718} +{230719} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 37b5d7b223..8172d41f25 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 230718") +#define PANDORA_VERSION ("7.0NG.772 Build 230719") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f0fb52d90c..3878d891d0 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 230718))" + VALUE "ProductVersion", "(7.0NG.772(Build 230719))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 93e195b067..964bb752d0 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230718 +Version: 7.0NG.772-230719 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 1dec27507e..5342ae5725 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-230718" +pandora_version="7.0NG.772-230719" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index b384fdf8d2..20d3363e68 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 = 'PC230718'; +$build_version = 'PC230719'; $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 2a21ae2c9c..e5ce174350 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 4b20e76d49..bbb62269cc 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 230718 +%define release 230719 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 77d690bdfc..0e62343d30 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 230718 +%define release 230719 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 856ee2d2ce..56562ff7ce 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230718" +PI_BUILD="230719" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 73e9ba3a8b..f75db8462f 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 230718"; +my $version = "7.0NG.772 Build 230719"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ac754cac92..6c5062c309 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 230718"; +my $version = "7.0NG.772 Build 230719"; # save program name for logging my $progname = basename($0); From 018bfe12887de38a81c18961f0245a32955847ce Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 19 Jul 2023 10:36:30 +0200 Subject: [PATCH 42/66] #10696 fixed resize circular mesh --- pandora_console/include/functions_graph.php | 5 ++++- pandora_console/include/functions_netflow.php | 7 ++++++- pandora_console/include/graphs/functions_d3.php | 4 ++-- pandora_console/include/graphs/pandora.d3.js | 13 ++++++++----- .../include/lib/Dashboard/Widgets/netflow.php | 8 +++++++- pandora_console/include/styles/netflow_widget.css | 4 ++++ 6 files changed, 31 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index d1702ef9d6..5be8dc1233 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -4618,7 +4618,10 @@ function graph_netflow_circular_mesh($data) include_once $config['homedir'].'/include/graphs/functions_d3.php'; - return d3_relationship_graph($data['elements'], $data['matrix'], 900, true); + $width = (empty($data['width']) === false) ? $data['width'] : 900; + $height = (empty($data['height']) === false) ? $data['height'] : 900; + + return d3_relationship_graph($data['elements'], $data['matrix'], $width, true, $height); } diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index 66e1ad1a9f..9d0c492971 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -1233,7 +1233,9 @@ function netflow_draw_item( $max_aggregates, $connection_name='', $output='HTML', - $address_resolution=false + $address_resolution=false, + $width_content=false, + $height_content=false ) { $aggregate = $filter['aggregate']; $interval = ($end_date - $start_date); @@ -1432,6 +1434,9 @@ function netflow_draw_item( netflow_aggregate_is_ip($aggregate) ); + $data_circular['width'] = $width_content; + $data_circular['height'] = $height_content; + $html = '
'; $html .= graph_netflow_circular_mesh($data_circular); $html .= '
'; diff --git a/pandora_console/include/graphs/functions_d3.php b/pandora_console/include/graphs/functions_d3.php index acb675423a..baa957acc9 100644 --- a/pandora_console/include/graphs/functions_d3.php +++ b/pandora_console/include/graphs/functions_d3.php @@ -57,7 +57,7 @@ function include_javascript_d3($return=false) } -function d3_relationship_graph($elements, $matrix, $width=700, $return=false) +function d3_relationship_graph($elements, $matrix, $width=700, $return=false, $height=700) { global $config; @@ -72,7 +72,7 @@ function d3_relationship_graph($elements, $matrix, $width=700, $return=false) $output = '
'; $output .= include_javascript_d3(true); $output .= ""; if (!$return) { diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js index 5c8b59013b..64313904bc 100644 --- a/pandora_console/include/graphs/pandora.d3.js +++ b/pandora_console/include/graphs/pandora.d3.js @@ -22,7 +22,7 @@ // matrix = [[0, 0, 2], // a[a => a, a => b, a => c] // [5, 0, 1], // b[b => a, b => b, b => c] // [2, 3, 0]]; // c[c => a, c => b, c => c] -function chordDiagram(recipient, elements, matrix, width) { +function chordDiagram(recipient, elements, matrix, width, height) { d3.chart = d3.chart || {}; d3.chart.chordWheel = function(options) { // Default values @@ -59,10 +59,13 @@ function chordDiagram(recipient, elements, matrix, width) { .enter() .append("svg:svg") .attr("width", width) - .attr("height", width) + .attr("height", height) .attr("class", "dependencyWheel") .append("g") - .attr("transform", "translate(" + width / 2 + "," + width / 2 + ")"); + .attr( + "transform", + "translate(" + width / 2 + "," + height / 2 + ") scale(1.2)" + ); var arc = d3.svg .arc() @@ -206,8 +209,8 @@ function chordDiagram(recipient, elements, matrix, width) { .on("mousemove", move_tooltip); function move_tooltip(d) { - x = d3.event.pageX + 10; - y = d3.event.pageY + 10; + x = d3.event.layerX + 10; + y = d3.event.layerY + 10; $("#tooltip").css("left", x + "px"); $("#tooltip").css("top", y + "px"); diff --git a/pandora_console/include/lib/Dashboard/Widgets/netflow.php b/pandora_console/include/lib/Dashboard/Widgets/netflow.php index 6af2e78bab..be603e452b 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/netflow.php +++ b/pandora_console/include/lib/Dashboard/Widgets/netflow.php @@ -339,6 +339,10 @@ class Netflow extends Widget $style .= ' width: 95%;'; } + if ($size['width'] > $size['height']) { + $size['width'] = $size['height']; + } + // Draw the netflow chart. $output .= html_print_div( [ @@ -353,7 +357,9 @@ class Netflow extends Widget $this->values['max_values'], '', 'HTML', - 0 + 0, + ($size['width'] - 50), + ($size['height'] - 20), ), ], true diff --git a/pandora_console/include/styles/netflow_widget.css b/pandora_console/include/styles/netflow_widget.css index 04b093c989..c7be7fe90d 100644 --- a/pandora_console/include/styles/netflow_widget.css +++ b/pandora_console/include/styles/netflow_widget.css @@ -7,3 +7,7 @@ #image_hide_show_labels { display: none !important; } + +.select2-search--dropdown .select2-search__field { + padding: 0px !important; +} From a9ae04cdc4edf1aa3bb3cef2ca7681bbd9f8c8bf Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Wed, 19 Jul 2023 10:46:10 +0200 Subject: [PATCH 43/66] Added systemd and sysvinit startup for pandora_agent_daemon --- pandora_agents/unix/pandora_agent_installer | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 90b464d570..df34f29400 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -541,8 +541,17 @@ install () { then echo "Define 'pandora_agent=\"YES\"' in /etc/rc.conf to enable the daemon." else - echo "Check your startup configuration to be sure Pandora FMS Agent is ready " - echo "to start automatically when system restarts": + # Enable startup service + if [ `command -v systemctl` ] + then + systemctl enable pandora_agent_daemon + elif [ `command -v chkconfig` ] + then + chkconfig pandora_agent_daemon on + else + echo "Check your startup configuration to be sure Pandora FMS Agent is ready " + echo "to start automatically when system restarts": + fi fi # Restore the daemon script From 1f722998e639f8bd146ab0e47ec236cd4495eb4d Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 20 Jul 2023 01:01:06 +0200 Subject: [PATCH 44/66] 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 6e5a9ccc64..befff3be5c 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-230719 +Version: 7.0NG.772-230720 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 75850e3771..0f507262b8 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-230719" +pandora_version="7.0NG.772-230720" 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 37f16c658f..066c703237 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 => '230719'; +use constant AGENT_BUILD => '230720'; # 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 be1df542a1..b6b857863e 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 230719 +%define release 230720 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 1713a34f17..7df3b5fca9 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 230719 +%define release 230720 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 90b464d570..14939dc1e0 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="230719" +PI_BUILD="230720" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index a147da9939..656dff5ec3 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230719} +{230720} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8172d41f25..8cb58c7095 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 230719") +#define PANDORA_VERSION ("7.0NG.772 Build 230720") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 3878d891d0..009659b454 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 230719))" + VALUE "ProductVersion", "(7.0NG.772(Build 230720))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 964bb752d0..66c16b35b1 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230719 +Version: 7.0NG.772-230720 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 5342ae5725..a2c66fff09 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-230719" +pandora_version="7.0NG.772-230720" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 20d3363e68..99d33b658e 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 = 'PC230719'; +$build_version = 'PC230720'; $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 e5ce174350..548f57b24b 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 bbb62269cc..a77349551b 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 230719 +%define release 230720 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 0e62343d30..659b1dfcd1 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 230719 +%define release 230720 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 56562ff7ce..84d3f238e1 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230719" +PI_BUILD="230720" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index f75db8462f..fbe7655596 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 230719"; +my $version = "7.0NG.772 Build 230720"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 6c5062c309..79b4d5a020 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 230719"; +my $version = "7.0NG.772 Build 230720"; # save program name for logging my $progname = basename($0); From 9978bbe64584ba2f2e5081f536c0927a943df288 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 20 Jul 2023 09:42:09 +0200 Subject: [PATCH 45/66] #11754 Add pagination --- pandora_console/godmode/reporting/graphs.php | 32 +++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/reporting/graphs.php b/pandora_console/godmode/reporting/graphs.php index 6e66c886fb..1a5fbb4283 100644 --- a/pandora_console/godmode/reporting/graphs.php +++ b/pandora_console/godmode/reporting/graphs.php @@ -488,14 +488,38 @@ if (!empty($graphs)) { true ); $ActionButtons[] = ''; + + $offset = (int) get_parameter('offset', 0); + $block_size = (int) $config['block_size']; + + $tablePagination = ui_pagination( + count($graphs), + false, + $offset, + $block_size, + true, + 'offset', + false + ); } // FALTA METER EL PRINT TABLE. html_print_table($table); - html_print_action_buttons( - implode('', $ActionButtons), - ['type' => 'form_action'] - ); + + if (is_metaconsole() === true) { + html_print_action_buttons( + implode('', $ActionButtons), + ['type' => 'form_action'] + ); + } else { + html_print_action_buttons( + implode('', $ActionButtons), + [ + 'type' => 'form_action', + 'right_content' => $tablePagination, + ] + ); + } } echo '
'; From 4d83071f1cd90da67da36adb5f4721d7326d38f4 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 20 Jul 2023 11:02:02 +0000 Subject: [PATCH 46/66] Add new directory --- pandora_server/util/load/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pandora_server/util/load/.gitkeep diff --git a/pandora_server/util/load/.gitkeep b/pandora_server/util/load/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 From 8a66b41280f5de38552f5aed17f1fd32005b9f09 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 20 Jul 2023 11:17:06 +0000 Subject: [PATCH 47/66] Upload New File --- .../util/load/create_usersandgroups.sh | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 pandora_server/util/load/create_usersandgroups.sh diff --git a/pandora_server/util/load/create_usersandgroups.sh b/pandora_server/util/load/create_usersandgroups.sh new file mode 100644 index 0000000000..36534bbf0b --- /dev/null +++ b/pandora_server/util/load/create_usersandgroups.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# (c) 2023 Pandora FMS, by Sancho Lerena +# This script is used to create a huge load of data +# It creates a group from each item in groupnames.txt +# It creates an user from each item in usernames.txt +# It gives an association to each user for a random group using a Read Only operator profile +# It moves each agent to a primary group, randomly from groupname.txt + +if [ ! -e usernames.txt ] +then + echo "Error, I cannot find usernames.txt" + exit +fi + +if [ ! -e groupnames.txt ] +then + echo "Error, I cannot find groupnames.txt" + exit +fi + +# Create users from usernames.txt +for a in `cat usernames.txt` +do + /usr/share/pandora_server/util/pandora_manage.pl /etc/pandora/pandora_server.conf --create_user $a $a 0 "Created by CLI" +done + + +# Create groups from groupnames.txt +for a in `cat groupnames.txt` +do + /usr/share/pandora_server/util/pandora_manage.pl /etc/pandora/pandora_server.conf --create_group $a +done + +# Associate a group to each user +TOTAL_GROUPS=`cat groupnames.txt | wc -l` +for username in `cat usernames.txt` +do + RAN=`echo $RANDOM % $TOTAL_GROUPS + 1 | bc` + GROUP_NAME=`cat groupnames.txt | tail -$RAN | head -1` + + /usr/share/pandora_server/util/pandora_manage.pl /etc/pandora/pandora_server.conf --add_profile $username "Operator (Read)" $GROUP_NAME +done + +# Move each agent to a random group +TOTAL_GROUPS=`cat groupnames.txt | wc -l` +for agentname in `/usr/share/pandora_server/util/pandora_manage.pl /etc/pandora/pandora_server.conf --get_agents | cut -f 2 -d ","` +do + RAN=`echo $RANDOM % $TOTAL_GROUPS + 1 | bc` + GROUP_NAME=`cat groupnames.txt | tail -$RAN | head -1` + /usr/share/pandora_server/util/pandora_manage.pl /etc/pandora/pandora_server.conf --update_agent $agentname group_name $GROUP_NAME +done From 86b91c48d74edcef6b4a42522de85e15f0f90aad Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 20 Jul 2023 11:17:30 +0000 Subject: [PATCH 48/66] Upload New File --- pandora_server/util/load/README.MD | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pandora_server/util/load/README.MD diff --git a/pandora_server/util/load/README.MD b/pandora_server/util/load/README.MD new file mode 100644 index 0000000000..d042cb1503 --- /dev/null +++ b/pandora_server/util/load/README.MD @@ -0,0 +1,36 @@ +### Purpose of this toolkit + +This directory contains configuration files and small scripts to generate an environment with simulated data for testing purposes. + +### Generation of XML files to simulate agent load + +There is a tool that comes configured with Pandora FMS to generate test data (pandora_xml_stress) and that generates XML. It has different options and in this directory is provided a configuration file and all the dictionaries and additional files to generate data of 300 agents, with pseudo-random names (like for example "7fb8a1a734c24cc22a5c75eb"). + +These agents are defined in the "pandora_xml_stress.agents" file. If you want less agents, you can delete elements in this file. + +To execute the XML generation manually from the code repository: + + cd pandorafms/pandora_server/util/load + perl ../pandora_xml_stress.pl pandora_xml_stress.conf + +This will generate 300 XML in the /var/spool/pandora/data_in directory. + +If you create a scheduled execution of this command every 5 minutes (e.g. through cron), keep in mind that if the PandoraFMS server stops, it could have hundreds of thousands of XML files pending to be processed. + +Create /etc/cron.d/pandora_stress with this content: + + */5 * * * * root + + +### Generation of groups and users + +The script 'create_usersandgroups.sh' will take a list of names from the file 'usernames.txt' and through CLI will create those users in the local Pandora FMS. + +On the other hand, it will also create a series of groups, taking as source the names of the file 'groupnames.txt'. It will associate to each user a group of the existing ones with the profile "Operator (Read"). + +Finally, it will take all the agents available in Pandora FMS and it will distribute them in an equal and random way among the available groups. + +You should only run it once: + + cd pandorafms/pandora_server/util/load + ./create_userandgroups.sh From 7f3a90df375e6a57ad5edd46f1b31f87424a6cb0 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 20 Jul 2023 11:17:45 +0000 Subject: [PATCH 49/66] Upload New File --- pandora_server/util/load/groupnames.txt | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 pandora_server/util/load/groupnames.txt diff --git a/pandora_server/util/load/groupnames.txt b/pandora_server/util/load/groupnames.txt new file mode 100644 index 0000000000..86c1426a88 --- /dev/null +++ b/pandora_server/util/load/groupnames.txt @@ -0,0 +1,44 @@ +Ali +Alisha +Amado +Angeline +Arlen +Arline +Barbra +Beth +Bette +Bradly +Brenton +Candace +Candy +Carroll +Cecelia +Chance +Chang +Chase +Chasity +Tracey +Vincent +Ward +Wiley +Willie +Winnie +zurc +Grasstongue +Khung +Mudblood +Grosk +Grumblehammer +Snun +Emberfang +Zotvind +Stormfist +Knigbrur +Rockclaw +Skalbrusk +Rivergut +Vitrurk +Coldpelt +Doddosk +Fistbasher +Skikkin \ No newline at end of file From 6cb4709539c3f6fd180caa8ad933dfda19c0f499 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 20 Jul 2023 11:18:03 +0000 Subject: [PATCH 50/66] Upload New File --- .../load/pandora_xml_stress_module_source.txt | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 pandora_server/util/load/pandora_xml_stress_module_source.txt diff --git a/pandora_server/util/load/pandora_xml_stress_module_source.txt b/pandora_server/util/load/pandora_xml_stress_module_source.txt new file mode 100644 index 0000000000..aa442fdc93 --- /dev/null +++ b/pandora_server/util/load/pandora_xml_stress_module_source.txt @@ -0,0 +1,38 @@ +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +0 +1 +12 +13 +12 +14 +12 +14 \ No newline at end of file From 42f23e667b11db0f6238be15c9a0c109c7b9ea07 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 20 Jul 2023 11:18:18 +0000 Subject: [PATCH 51/66] Upload New File --- .../util/load/pandora_xml_stress.agents | 300 ++++++++++++++++++ 1 file changed, 300 insertions(+) create mode 100644 pandora_server/util/load/pandora_xml_stress.agents diff --git a/pandora_server/util/load/pandora_xml_stress.agents b/pandora_server/util/load/pandora_xml_stress.agents new file mode 100644 index 0000000000..da718018e0 --- /dev/null +++ b/pandora_server/util/load/pandora_xml_stress.agents @@ -0,0 +1,300 @@ +bf78e4acf01eb3144b5f3cf5 +83c2b346af90edc2fa0de4e1 +602ef1ca527c0bb7d144bf0a +4012470edc77bc97f58b3f80 +9daa3ecee84ed039bcf2efdc +3dae00ce55f6985ac26a4402 +3a8ae8e8d417712166f6df48 +257f378d433124706d442bbb +fa2025fd2f64462a43d94fae +d17d6fd3720184cb5a7d199d +4d9977b96f3b4e006e47112a +6242411ed2d7f324b70c86d9 +92ed7a8b9e1e786172ca02e1 +50aca7828dabff6449740082 +e7c7487ef15715ee44cc7844 +0f0d005d0d9f31afcf979437 +51ced8d82e7e851d61b93670 +824a318186adb6603b4b804a +387f85fe94caf0ebdfd15d63 +65833ad4e353ad573a14ef21 +3a276db7e3af8aa95872946f +df6b8c060d9f385db4e53bd8 +8999734b6f54032df4465189 +bec95961964493dbca9cf544 +34957a75a1e362783e3de10f +64ab08385a39067b8161cb68 +689544d5ec6199304feec7d1 +e926306ca1a952827d788828 +4ed79bf195c8287c443c86d2 +5094261d922982b388137a1f +f90f364975c489b465092a04 +6fc797c7f3918310af9e9afa +1c2be64167c08109c69e1130 +fea477977db6ac0d8021637f +4939f84a23aff2a97b412ada +385a5f99e3970b52f92c5b9e +6176e5d648b335db3b79322e +bf4d03212ee1eeeaa53cac26 +b7d0acbc714b76095a523286 +e3eb2fc6f548bbc8f7ac2f0c +93c08fcfe26a5cc9be667bb7 +c6120aa7367523294dd8cb94 +07548491524ec76d96db5e26 +29bc64bd950f74b678d45e57 +8733dcfbb5d8832ee9319bc1 +16b9e5a78847d99ca636e90c +4c9a17935849675164a7460b +6c47aa0691ca8447bd7690d9 +b1ec5a21f332b3d3c5b7e35e +3a0ff6da7e9c3ed12a8f9246 +ac823076dc634e47c51d3d67 +a0f7d6d23d0f6ad87889fdb2 +093c29ab1ff212ac9139b821 +6b5fc978a68a98e5c39d8e86 +334af374b4dee25929244b1e +ffa507c102d330433ff15b9e +89b03af9ca3428e7877fc6f2 +f10d7455b7386248e3b65acc +07e37df13934913378ae9aa0 +6b261e22ae3882a928d7e0b5 +f96c558c07671ac8d52cec6c +6be22d5bb4b2ba0751551ca1 +706fbe25372d5779225e2651 +eedc80256ab4d68cd477bcbe +6e2e97c594245092c5f9fc3e +3aa4e556f361196dc7c6102a +091fd7bfa2b8b7bb81b20ea4 +9ad434c3e7796273d7d1d8b5 +9e8f16f56ff86d1161196430 +17a3b7ce50bcb52325126aeb +edf98dbbeb2a5cf4d3baf70c +8de575ca92807d1652a9fa73 +33faeb45a5a04e410056585d +a8437131fa7d2ccfa015caf2 +7b478c40169b6bd1bd3fef83 +77a17435ca19143c7c18a490 +56bf42c56c42fb5334da25af +f646df9f903178fcffada9b8 +a390ec6c1d641f44a5b76d9a +deed99c701a0f4f2eaa551a4 +15197674acb20c324923d247 +e2517b8b94207380fa110334 +d62a50e795be6bd07c1f44c9 +0fd5b2606cb0e7a25e8a1370 +4f57d5b32737f75aff5fe8ed +ebcfdb50f0f1a6d3c0c059dc +dab99715dfe459bb357335c0 +aac40b9a6c4a9984adb09b14 +18f06ba95abb048598e865ab +0eff987eb95e5a438c4c8018 +fb5c6d027180ab974b0b7675 +a8e2cdea5a3df0c42f11fc24 +3ffa5c21a78d67d7ae358099 +16f9280e03f99e432db79b84 +a8e28177ffb5aeda7f474fdf +134ed984989a755e3dae8233 +70d364db21c5e85073e5b17e +ce2196095062f09ae9569c54 +6965e3eb85c3431e22a3d199 +f76187d491c04c130cfa96d2 +3af29cc38e85351595f2a513 +d4dfbc5f347ff7985e8eb232 +add60e5dff9a33115b996a70 +8519bf76f1c1cb8da26e270d +cb117a019377c03839dbb667 +c56e9ea3c4d373cdc301b423 +4f6afb90cbeeaf09756f7283 +a80172931917bcb8647edc96 +4a6f07d5d075bef6bf794db1 +5a0bbd407c6e224084987e88 +a325a700c253294582cf2546 +28197bd3d8c6ff0747deaf3d +23719c710abf2d43dc0061b8 +19640261e5cde16ee8484f20 +247a72fa19ac7e52955b1ac6 +882cf1711c2c463eb4389b9a +b9434493637d85cd4ae05ce6 +eafb645f5aae3b3d45eac64c +4944420fba4c2ed3a5eebda9 +fa9f5d02a4e6e0a9c09b1a05 +3411890bc1237a086f5d4532 +f50c455cbd5fb84566f3c3d1 +b1b9783f6345b4732dc35887 +722d8ba0f5ebc313c98a8c82 +be2a4afbab53363815416730 +4440b997bd12750c15baac3c +72ae565db9ea0b4686eacf6b +88e70d097307fe10d46d922a +5fcdfcd43be6e235ee8ae140 +8ba16c7ec192e2d93d3826db +79d1c21a40baa3bae9d38c60 +28f4a1897afbc8db42ddb3bd +b96aebdee9a0aa681c41f951 +28e63e948e80ef9351de678c +c0d69c65c6544abb90b0be4e +212d9e6df8d1cf8aa7e51979 +abf8c4265b09990aeddc0101 +c0cf6680054f443d0eb50a26 +2ce89791ce40e902ae9f3507 +4ce8e01633c1affb78fc238e +b4f152dc64a3daa63fd0055f +a56c545d8c4817fc6836fc96 +e4e91209ac4a94f6f9e5eed2 +31f7373460d648f208b677a4 +20fe6b8dbaedc3e1f7c86908 +be67e5298c830c0bb582556f +63f5d1404aea4377779edf35 +b03831cce718125cb9612c07 +5465b26fd45d86b059066cc2 +5351de84d2fd638b138ba27b +6c63000157aed37fa8c0c022 +8d3c18c7fbe518694c6bdb22 +615ec092b6f63bb14a2bb42e +61de25cf8e12926c28aeffdc +2b96bc1c8f6f81a5437b61bf +ba1f4fcf3954e0efe5d68c83 +ee5bd3e1a937b90562677f1d +0cf18ae18b0c680d00cb4d2e +abf72b0d66f90bd6e67c43c6 +f263d033bb07e0b8cd405224 +418ddf02720649b40db2dd67 +01d1a735aa980326d385ea65 +0cc3860bb0a3fd5822b25ea4 +b0b89dbebfab05fafd6cf9dd +2fcbb999444db5c0c77c2ec2 +f49a97b3531b8ab8d487c7a7 +ffb66d5003620e2fa47ef8ea +04da742ab6c99b5c44f9f0cc +dc310a9d42d7c367671ffbf9 +b0f5c4ee8d327449ef2103e6 +5bd2ce604ed7c820169f0ac2 +57f874a6e41baa5a1196b15f +b43142736205ad1011f4a5a6 +50cf8523e5090251516eecb0 +ebad61d47be209696f9d41aa +66bc5976a98266560d1867ff +3c37fc452e9ad36cd7adcb1a +4ac8c3db63a69ce883f3fcf5 +6c89e2bb90b9ab95f4adde3c +917de5ece0a5ef663a8f44e7 +b50eba76cf29aca3cf696d7e +74264c913ac1e141db78708a +2b6c93011f62cffb5c085886 +700617c377952010272b9522 +dac10c8ddf7c45e55d8028af +053328a6ff4f2773eebe76fe +2d7390260285c272688ae1e8 +fa30c9ee6fb1e2f00d7ccb77 +0ca6db378a05246f30c8b820 +9ad6f959de166cc1475040ea +23b4702f4dfb350085e77482 +4198a8ab80780c5d9b0d82d5 +baebd530dfc47ac77ea42d2a +636d2ab4e018b5542e429f5e +40ae44193af360eea68b6f0b +dd47b39e494a62a4f5b6bef8 +240339c9dcd159595c1edbf3 +0f11840efe364ca6bbb17f43 +8522e203fb4b53e2bd6d6f82 +f134d9b501fa40b17993beee +d0483306f2f972aacfb4fcea +926ee4e0a80455cfee517f8b +c188a327bc66df4878cb3e8b +c874083c1d932bb4ade6d028 +be2271d8da327f97e05c1c60 +9ca7451d3f261682ec717547 +9eb46e2a5fd072c5267d7432 +41e8f3f7733f87e16b773bad +f642220cd19f84154e4dd972 +fe3d9f6433883332b464b7ca +3e9648ccf60b1fa712ea8590 +b7da7292e9418889bc957bd7 +fb4a392d386eca19eec9215e +34188e4a6590877b2dbb67b0 +e233cb364659dea13dee1fd8 +757b8330465df34879414b7d +5e0f80102fee69d0742934b2 +d72124afc78e9b3f91550497 +21c77bfe67c6e99f73323f42 +afa8ce345db6300882858f93 +886cc8b32ed80f4c69edb990 +64ea275ce73ef4070cefca19 +c676f1ffe5bdce4e1d3643ed +baca61ab59568605e3ec8899 +1610892c53a071ed02d20c75 +3321fb7111d74e532932d262 +29583747ac9fbf0bf21c1574 +f51210b47a6e847dcfb52f94 +63c95735ba96c65d2d45b23d +679c4e3acb15ebec6ecc7529 +42da0760b02d50c6587a8c31 +e42de775dcfcc3c950c1cff5 +ae5791cf265badebd39c78d9 +f66c123309525eeb81b47e92 +7cddc2b9ed6b4df83c72fcbe +e69cc74632fdaa06f76f708a +7cfd19c2eeaef2c0537332be +d27cdcea69f4e49fbae06f4d +bdfaa2ec52319f0e6533e826 +d59452cdfce11e21682a791f +cbb74f2d35d54557abdbc2da +369a4e6f128475bc9f87ef42 +90bf992a98d0b768cbc50520 +1fea663421dae7b418b9b15f +f9fc5505565c43cebc1545f9 +d02a8f77fbb2b7f384a99949 +279ff35e17c7f6b6a043fde7 +9cf7725d3a97d9aa9e529ce6 +1f465b328b349502c0953b2d +283fad60fa48ea2075a0e516 +ef5d9e841a02665c54d8fa7f +b6023425cb4a1503726b3135 +7fb8a1a734c24cc22a5c75eb +da38d78e83c9288e4cd60cca +2a928a6498ae8e0b29675c25 +d2194ab5b0e48c2c1f213860 +53acafcd86a61ce55688ebef +65608eeebc7d9fe2912635ed +fafb0273e3b04deb1edb2628 +baf07d1f28416da065b6771f +c2ee8e58209102fdd0bb341c +f8e92e00670f65c29c4617c9 +a83661705134029ae344176d +fc02c24e172d12a29b17eede +2632f143ffe3f64e63e4ba32 +847120de4b72f59263d160f1 +5be36ff5b668eb93823974b2 +cdd8fe5081225519b5fc28af +53569cbaedb9265839290a6c +decca89ea0e8944fd93fcd24 +4b10511d840b7f5129ed6190 +5c4a1904de5f90f4d5dd749a +49c47514c3308df82fcd6b79 +15af3e182c00000eea12f8e5 +a9645c4a43ad211d9ae9a406 +dcffa4e5eee8f966b1edcdaf +75b25f796f1e392f45c3a737 +0ad5f0b96946ebcabd0457e9 +2f9128177cab74e0bad61189 +49ed14b81e0a166ccf335b4a +dfe100788326c45dfb84579c +2616f38caef9decae47e5023 +99b2d0eb14ac19d1cfedd86e +fb1d4c42ea70fad330b5c5ee +b6c560867faa3b41b1f5d4fa +1167fb22e86098ef684eb702 +a2e2c2ee8ec87d4e5d59eb22 +b228beac094e16a0fa3cb528 +ea0de9aad68deed0a4df3e71 +e50cb420497d928ef9827800 +3bb39890ca4a6da941e01782 +73391f2914465c3f2335e24a +f8b2f512cc0cbc024e2cd377 +4f816b0d36c934b44dbd5bc0 +817edf1e2637fef229752a5f +4466f97959df7247f7410fbe +cc85c727080e9d6eb75ef513 +7e27f012167ed8bedc4bd635 +98a445ff41a81a0a752aff25 +3b339e213dd613c4efd878c1 \ No newline at end of file From eb70d6502718efcab4f27aa88cee70bb83adc9be Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 20 Jul 2023 11:18:32 +0000 Subject: [PATCH 52/66] Upload New File --- .../util/load/pandora_xml_stress.conf | 200 ++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 pandora_server/util/load/pandora_xml_stress.conf diff --git a/pandora_server/util/load/pandora_xml_stress.conf b/pandora_server/util/load/pandora_xml_stress.conf new file mode 100644 index 0000000000..0dd2894e6a --- /dev/null +++ b/pandora_server/util/load/pandora_xml_stress.conf @@ -0,0 +1,200 @@ +# Sample configuration file for pandora_xmlstress +# (c) 2012, http://pandorafms.org +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Maximum number of threads, by default 5 +max_threads 4 + +# File containing a list of agent names (one per line). +agent_file pandora_xml_stress.agents + +# Directory where XML data files will be placed, by default /tmp. +# When sending files to a local Tentacle server make sure this directory +# and Pandora FMS Server's incomingdir are different. +temporal /tmp + +# Pandora FMS XML Stress log file, logs to stdout by default. +log_file pandora_xml_stress.log + +# XML version, by default 1.0. +xml_version 1.0 + +# XML encoding, by default UTF-8. +encoding UTF-8 + +# Operating system (shared by all agents), by default Linux. +os_name Linux + +# Operating system version (shared by all agents), by default 2.6. +os_version 2.6 + +# Agent group, by default Servers. +#group Servers + +# Agent interval, by default 300. +agent_interval 300 + +# Data file generation start date, by default now. +#time_from 2023-03-01 00:00:00 + +# Data file generation end date, by default now. +#time_to 2023-03-02 00:00:00 + +# Get conf from Pandora Server +get_and_send_agent_conf 0 + +# The directory to store the files conf agent (not in the server). +# directory_confs . + +# The directory to generate the next files conf agent for to send. +#directory_temp /tmp + +# Delay after generating the first data file for each agent to avoid +# race conditions when auto-creating the agent, by default 2. +startup_delay 0 + +# Timezone offset: Difference with the server timezone +timezone_offset 0 + +# Timezone offset range (to set a randomnuber of hours of difference with the +# server so timezone_offset can go from timezone_offset-timezone_offset_range +# to timezone_offset+timezone_offset_range +timezone_offset_range 0 + +# Agent position paramters +# Those parameters define the center and the zone where the agents will be +# randomly located. +# The base parameters define the central point of the sistem and the radius +# defines how far from that point the agents will be placed in any direction + +# Base latitude reference for all agents +latitude_base 40.42056 +# Base longitude reference for all agents +longitude_base -3.708187 +# Base altitude reference for all agents +altitude_base 0 +# This amount divided by 100 defines how far from each reference coordinate +# the agents will go +position_radius 10 + +# Address of the Tentacle server where XML files will be sent (optional). +server_ip 127.0.0.1 + +# Local copy XML files, by default 0 +local_copy 1 + +# Local dir for to copy XML files in local send method, by defaul /var/spool/pandora/data_in +local_dir /var/spool/pandora/data_in + +# Port of the Tentacle server, by default 41121. +# server_port 41121 + +# Module definitions. Similar to pandora_agent.conf. + +module_begin +module_name Connections opened +module_type generic_data +module_description Network connections used in this machine +module_exec type=RANDOM;variation=20;min=50;max=500 +module_unit conns +module_min_critical 450 +module_min_warning 400 +module_attenuation 0.33 +module_attenuation_wdays 0 6 +module_end + +module_begin +module_name Dropped Bits of nothing +module_type generic_data +module_description Simulation of big number with absolute nosense, real like life itself. +module_exec type=RANDOM;variation=5;min=-5000;max=500000000 +module_unit gamusins +module_end + +module_begin +module_name Network Traffic (Incoming) +module_type generic_data +module_description Network throughtput for incoming data +module_exec type=RANDOM;variation=50;min=0;max=1000000 +module_unit kbit/sec +module_min_critical 900000 +module_attenuation 0.5 +module_attenuation_wdays 0 6 +module_end + +module_begin +module_name Network Traffic (Outgoing) +module_type generic_data +module_description Network throughtput for Outgoing data +module_exec type=RANDOM;variation=50;min=0;max=1000000 +module_unit kbit/sec +module_min_critical 900000 +module_attenuation 0.1 +module_attenuation_wdays 0 6 +module_end + +module_begin +module_name Server Status A +module_type generic_proc +module_description Status of my super-important daemon / service / process +module_exec type=RANDOM;variation=1;min=0;max=500 +module_end + +module_begin +module_name Server Status B +module_type generic_proc +module_description Status of my super-important daemon / service / process +module_exec type=RANDOM;variation=1;min=0;max=300 +module_end + +module_begin +module_name Server Status C +module_type generic_proc +module_description Status of my super-important daemon / service / process +module_exec type=RANDOM;variation=1;min=0;max=1000 +module_end + +module_begin +module_name CPU Usage +module_type generic_data +module_description % of CPU usage in this machine +module_unit % +module_exec type=SCATTER;prob=5;avg=10;min=0;max=80 +module_min_critical 90 +module_min_warning 60 +module_end + +module_begin +module_name Disk_Free +module_type generic_data +module_description Disk space available in MB. +module_unit MB +module_exec type=CURVE;min=20;max=80;time_wave_length=3600;time_offset=0 +module_min_critical 0 +module_max_critical 10 +module_max_warning 20 +module_min_warning 10 +module_end + +module_begin +module_name Memory_free +module_type generic_data +module_unit MB +module_exec type=CURVE;min=5;max=8000;time_wave_length=360000;time_offset=0 +module_min_critical 0 +module_max_critical 50 +module_end + +module_begin +module_name System Log File +module_type generic_data_string +module_description Messages from the system in logfile format +module_exec type=RANDOM;variation=60;min=40;max=40 +module_end + +module_begin +module_name Module source +module_type generic_data +module_description Module data generated from source +module_exec type=SOURCE;src=pandora_xml_stress_module_source.txt +module_end \ No newline at end of file From a1dcd52631ac9f21c5c43c35c985ef76c34ede1a Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 20 Jul 2023 11:18:45 +0000 Subject: [PATCH 53/66] Upload New File --- pandora_server/util/load/usernames.txt | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pandora_server/util/load/usernames.txt diff --git a/pandora_server/util/load/usernames.txt b/pandora_server/util/load/usernames.txt new file mode 100644 index 0000000000..c1709cf5ae --- /dev/null +++ b/pandora_server/util/load/usernames.txt @@ -0,0 +1,34 @@ +Martyna +Niklas +Murugan +Martin +Celeste +Agi +Yeshua +Lemminkainen +Xabier +Dominga +Moric +Gernot +Nia +Gurpreet +Khristofor +Ndubuisi +Kleopatra +Voestaae +Melba +Manish +Tóki +Pio +Jeong +Helena +Plácido +Djehutimesu +Tauno +Iordanus +Ragnar +Lucinde +Kailash +Artemio +Victorina +Sakine \ No newline at end of file From 6da7520dd15d66e07073ae067027c091e315e970 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 21 Jul 2023 01:00:53 +0200 Subject: [PATCH 54/66] 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 befff3be5c..d8cce649f8 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-230720 +Version: 7.0NG.772-230721 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 0f507262b8..1be2913ab7 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-230720" +pandora_version="7.0NG.772-230721" 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 066c703237..7e707482c6 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 => '230720'; +use constant AGENT_BUILD => '230721'; # 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 b6b857863e..944f3b80eb 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 230720 +%define release 230721 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 7df3b5fca9..6c96bf9e2a 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 230720 +%define release 230721 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 7ad2b9f219..fe18ba285c 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="230720" +PI_BUILD="230721" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 656dff5ec3..de76a216ed 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230720} +{230721} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8cb58c7095..1616463a5a 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 230720") +#define PANDORA_VERSION ("7.0NG.772 Build 230721") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 009659b454..319833dcb9 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 230720))" + VALUE "ProductVersion", "(7.0NG.772(Build 230721))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 66c16b35b1..6275863643 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230720 +Version: 7.0NG.772-230721 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 a2c66fff09..03a59890a7 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-230720" +pandora_version="7.0NG.772-230721" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 99d33b658e..d3bf8bfe91 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 = 'PC230720'; +$build_version = 'PC230721'; $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 548f57b24b..5d42d4b911 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 a77349551b..def75f2c46 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 230720 +%define release 230721 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 659b1dfcd1..3c67baac48 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 230720 +%define release 230721 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 84d3f238e1..68310cf659 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230720" +PI_BUILD="230721" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index fbe7655596..098c3f8134 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 230720"; +my $version = "7.0NG.772 Build 230721"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 79b4d5a020..8a295763c1 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 230720"; +my $version = "7.0NG.772 Build 230721"; # save program name for logging my $progname = basename($0); From e979403a54179c8280686a87ebbaa5ab33dc911c Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Fri, 21 Jul 2023 15:33:50 +0200 Subject: [PATCH 55/66] #11218 Fixed the icons of the policies adopted to the module --- pandora_console/godmode/agentes/module_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index b5a9c21611..1c6126467f 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -842,7 +842,7 @@ if ($modules !== false) { if ((bool) $linked !== false) { if ((bool) $adopt === true) { - $img = 'images/policies_not_brick.png'; + $img = 'images/policies_brick.png'; $title = '('.__('Adopted').') '.$policyInfo['name_policy']; } else { $img = 'images/policies_mc.png'; From 13552e74f10a0273ccb268c7336858d4d047b30e Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 22 Jul 2023 01:00:52 +0200 Subject: [PATCH 56/66] 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 d8cce649f8..45f24638bc 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-230721 +Version: 7.0NG.772-230722 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 1be2913ab7..c803c6ce75 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-230721" +pandora_version="7.0NG.772-230722" 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 7e707482c6..428a33337f 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 => '230721'; +use constant AGENT_BUILD => '230722'; # 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 944f3b80eb..31824de0aa 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 230721 +%define release 230722 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 6c96bf9e2a..edb93d17fe 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 230721 +%define release 230722 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 fe18ba285c..c4999037e7 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="230721" +PI_BUILD="230722" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index de76a216ed..b5769316b0 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230721} +{230722} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 1616463a5a..7c4b6ad51d 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 230721") +#define PANDORA_VERSION ("7.0NG.772 Build 230722") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 319833dcb9..70d875a9c0 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 230721))" + VALUE "ProductVersion", "(7.0NG.772(Build 230722))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 6275863643..a6aaa0d368 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230721 +Version: 7.0NG.772-230722 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 03a59890a7..7ece2ac5f0 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-230721" +pandora_version="7.0NG.772-230722" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d3bf8bfe91..56bec96c69 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 = 'PC230721'; +$build_version = 'PC230722'; $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 5d42d4b911..ebcfd30c2c 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 def75f2c46..bb0aafc081 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 230721 +%define release 230722 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 3c67baac48..a31ebf7948 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 230721 +%define release 230722 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 68310cf659..aa89d789e0 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230721" +PI_BUILD="230722" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 098c3f8134..13b4d2f0d9 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 230721"; +my $version = "7.0NG.772 Build 230722"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 8a295763c1..6dd53a8ee6 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 230721"; +my $version = "7.0NG.772 Build 230722"; # save program name for logging my $progname = basename($0); From 3e6f88e812d9c4f589fef27c6f05f3bc5c84d03c Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 23 Jul 2023 01:00:51 +0200 Subject: [PATCH 57/66] 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 45f24638bc..bbba255bab 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-230722 +Version: 7.0NG.772-230723 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 c803c6ce75..a5f526297e 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-230722" +pandora_version="7.0NG.772-230723" 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 428a33337f..100b2b859c 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 => '230722'; +use constant AGENT_BUILD => '230723'; # 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 31824de0aa..99c1b847e1 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 230722 +%define release 230723 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 edb93d17fe..2f5ae5fba9 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 230722 +%define release 230723 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 c4999037e7..65c526a5d4 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="230722" +PI_BUILD="230723" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index b5769316b0..97afef570a 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230722} +{230723} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 7c4b6ad51d..78cd04ff84 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 230722") +#define PANDORA_VERSION ("7.0NG.772 Build 230723") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 70d875a9c0..fda2c028d5 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 230722))" + VALUE "ProductVersion", "(7.0NG.772(Build 230723))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index a6aaa0d368..4562cb3e95 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230722 +Version: 7.0NG.772-230723 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 7ece2ac5f0..2bc2f3ab4d 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-230722" +pandora_version="7.0NG.772-230723" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 56bec96c69..13b19da488 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 = 'PC230722'; +$build_version = 'PC230723'; $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 ebcfd30c2c..eacac65142 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 bb0aafc081..6a1613e349 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 230722 +%define release 230723 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a31ebf7948..a8fba05acb 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 230722 +%define release 230723 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index aa89d789e0..2607fab007 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230722" +PI_BUILD="230723" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 13b4d2f0d9..72028a47a9 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 230722"; +my $version = "7.0NG.772 Build 230723"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 6dd53a8ee6..f123132979 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 230722"; +my $version = "7.0NG.772 Build 230723"; # save program name for logging my $progname = basename($0); From c57fb14bc26f35f07f9bbfd1892462e622b8f126 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 24 Jul 2023 01:00:48 +0200 Subject: [PATCH 58/66] 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 bbba255bab..2aa960e9e7 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-230723 +Version: 7.0NG.772-230724 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 a5f526297e..f79387b3d0 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-230723" +pandora_version="7.0NG.772-230724" 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 100b2b859c..e149a0a0f5 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 => '230723'; +use constant AGENT_BUILD => '230724'; # 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 99c1b847e1..7fab994392 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 230723 +%define release 230724 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 2f5ae5fba9..c042b957e3 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 230723 +%define release 230724 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 65c526a5d4..cc3d79d2fd 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="230723" +PI_BUILD="230724" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 97afef570a..dee4dd1e49 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230723} +{230724} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 78cd04ff84..8a91448bf0 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 230723") +#define PANDORA_VERSION ("7.0NG.772 Build 230724") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index fda2c028d5..629c349733 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 230723))" + VALUE "ProductVersion", "(7.0NG.772(Build 230724))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 4562cb3e95..f8361ed03d 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230723 +Version: 7.0NG.772-230724 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 2bc2f3ab4d..33216ccf44 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-230723" +pandora_version="7.0NG.772-230724" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 13b19da488..2f00645f00 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 = 'PC230723'; +$build_version = 'PC230724'; $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 eacac65142..5a934350c7 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 6a1613e349..876784ad7f 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 230723 +%define release 230724 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a8fba05acb..3698a44a03 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 230723 +%define release 230724 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 2607fab007..da59fdd8ff 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230723" +PI_BUILD="230724" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 72028a47a9..2ef1276890 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 230723"; +my $version = "7.0NG.772 Build 230724"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index f123132979..91f3cb2327 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 230723"; +my $version = "7.0NG.772 Build 230724"; # save program name for logging my $progname = basename($0); From 1fc1c0e9a499837813b920bd52e0f9291cebc052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Sun, 23 Jul 2023 17:02:26 -0600 Subject: [PATCH 59/66] Add current date to error logs without date --- pandora_server/util/pandora_db.pl | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 72028a47a9..75be937da0 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -25,6 +25,8 @@ use DBI; # DB interface with MySQL use POSIX qw(strftime); use File::Path qw(rmtree); use Time::HiRes qw(usleep); +use IO::Handle; +use File::Copy; # Default lib dir for RPM and DEB packages BEGIN { push @INC, '/usr/lib/perl5'; } @@ -1252,6 +1254,9 @@ sub pandoradb_main { # Maintain Referential integrity and other stuff pandora_checkdb_integrity ($conf, $dbh); + # Update error logs + update_err_logs($conf); + # Move old data to the history DB if (defined ($history_dbh)) { undef ($history_dbh) unless defined (enterprise_hook ('pandora_historydb', [$dbh, $history_dbh, $conf->{'_history_db_days'}, $conf->{'_history_db_step'}, $conf->{'_history_db_delay'}, $conf->{'_history_db_string_days'}, $conf->{'_history_db_adv'}])); @@ -1327,6 +1332,36 @@ sub pandora_check_forgotten_discovery_tasks { log_message('FORGOTTEN DISCOVERY TASKS', 'Step ended'); } +############################################################################### +# Update error logs that do not have a date +############################################################################### +sub update_err_logs { + + my ($conf) = @_; + my $file = $conf{'errorlog_file'}; + my $temp_file = substr($file, 0, rindex($file, '.')) . '_temp.txt'; + my $date_str = strftime("%Y-%m-%d %H:%M:%S ", localtime); + + open(my $in_fh, '<', $file) or die "Unable to open error log file to read: $!"; + open(my $out_fh, '>', $temp_file) or die "Unable to open the temporary file for writing: $!"; + + while (my $line = <$in_fh>) { + chomp $line; + if ($line !~ /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/) { + $line = $date_str . $line; + } + print $out_fh "$line\n"; + } + + close($in_fh); + close($out_fh); + + if (!copy($temp_file, $file)) { + die "Could not copy temporary file: $!"; + } + + unlink($temp_file) or warn "Could not delete temporary file: $!"; +} # Init pandora_init_pdb(\%conf); From 2a89a494cc98cc16ac51d5cd232e8bbb2eee444a Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 24 Jul 2023 10:06:43 +0200 Subject: [PATCH 60/66] 10640-Report task. Resolve conflict --- pandora_console/godmode/reporting/reporting_builder.php | 5 ++++- pandora_console/godmode/wizards/DiscoveryTaskList.class.php | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 10266290c7..00bc80f234 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -116,6 +116,7 @@ if (!$report_r && !$report_w && !$report_m) { } require_once $config['homedir'].'/include/functions_reports.php'; +require_once $config['homedir'].'/godmode/wizards/DiscoveryTaskList.class.php'; // Load enterprise extensions. enterprise_include('operation/reporting/custom_reporting.php'); @@ -1277,7 +1278,9 @@ switch ($action) { ); } - $report_task_data = enterprise_hook('tasklist_showListConsoleTask', [$object, true]); + $discovery_tasklist = new DiscoveryTaskList(); + $report_task_data = $discovery_tasklist->showListConsoleTask(true); + if (is_array($report_task_data) === true || strpos($report_task_data, 'class="nf"') === false) { $task_table = '
'; $task_table .= ''.__('Report tasks'); diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 9f2eb408b3..0fefe0739e 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -1109,9 +1109,9 @@ class DiscoveryTaskList extends HTML * * @return boolean Success or not. */ - public function showListConsoleTask() + public function showListConsoleTask($report_task=false) { - return enterprise_hook('tasklist_showListConsoleTask', [$this]); + return enterprise_hook('tasklist_showListConsoleTask', [$this, $report_task]); } From 93eb93b3480cdcfea2d633c809f676533054350f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Mon, 24 Jul 2023 12:27:27 -0600 Subject: [PATCH 61/66] Change to handle as log blocks --- pandora_server/util/pandora_db.pl | 43 +++++++++++-------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 75be937da0..90f572f3a1 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -1254,8 +1254,8 @@ sub pandoradb_main { # Maintain Referential integrity and other stuff pandora_checkdb_integrity ($conf, $dbh); - # Update error logs - update_err_logs($conf); + # Close and open error log blocks + handle_error_log_block($conf, $dbh); # Move old data to the history DB if (defined ($history_dbh)) { @@ -1333,34 +1333,21 @@ sub pandora_check_forgotten_discovery_tasks { } ############################################################################### -# Update error logs that do not have a date +# Opening and closing of error log blocks ############################################################################### -sub update_err_logs { +sub handle_error_log_block { + my ($conf, $dbh) = @_; + my $is_open = get_db_value ($dbh,"SELECT `value` FROM `tconfig` WHERE `token` = 'open_error_log'"); + open (STDERR, ">> " . $conf->{'errorlog_file'}) or die " [ERROR] " . pandora_get_initial_product_name() . " can't write to Errorlog. Aborting : \n $! \n"; + + if (!defined ($is_open)) { + db_do($dbh, "INSERT INTO `tconfig`(`token`, `value`) VALUES ('open_error_log', 1)"); + } elsif ($is_open eq 1){ + print STDERR strftime ("%Y-%m-%d %H:%M:%S", localtime()) . ' - ' . $conf->{'servername'} . " pandora_db: pandora_db maintenance tasks ends\n"; + } - my ($conf) = @_; - my $file = $conf{'errorlog_file'}; - my $temp_file = substr($file, 0, rindex($file, '.')) . '_temp.txt'; - my $date_str = strftime("%Y-%m-%d %H:%M:%S ", localtime); - - open(my $in_fh, '<', $file) or die "Unable to open error log file to read: $!"; - open(my $out_fh, '>', $temp_file) or die "Unable to open the temporary file for writing: $!"; - - while (my $line = <$in_fh>) { - chomp $line; - if ($line !~ /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/) { - $line = $date_str . $line; - } - print $out_fh "$line\n"; - } - - close($in_fh); - close($out_fh); - - if (!copy($temp_file, $file)) { - die "Could not copy temporary file: $!"; - } - - unlink($temp_file) or warn "Could not delete temporary file: $!"; + print STDERR strftime ("%Y-%m-%d %H:%M:%S", localtime()) . ' - ' . $conf->{'servername'} . " pandora_db: pandora_db maintenance tasks starts\n"; + close (STDERR); } # Init From 60ed07dc1f52bc8889386c31ab2212c522b5d5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Mon, 24 Jul 2023 12:32:25 -0600 Subject: [PATCH 62/66] Remove unused imports --- pandora_server/util/pandora_db.pl | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 90f572f3a1..01e9bb82a2 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -25,8 +25,6 @@ use DBI; # DB interface with MySQL use POSIX qw(strftime); use File::Path qw(rmtree); use Time::HiRes qw(usleep); -use IO::Handle; -use File::Copy; # Default lib dir for RPM and DEB packages BEGIN { push @INC, '/usr/lib/perl5'; } From 1de2fe9898032c9e8110256dc9d41119a9e7ed14 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 25 Jul 2023 01:02:35 +0200 Subject: [PATCH 63/66] 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 2aa960e9e7..b89942a30a 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-230724 +Version: 7.0NG.772-230725 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 f79387b3d0..02c76b2b91 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-230724" +pandora_version="7.0NG.772-230725" 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 e149a0a0f5..9a60bb703a 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 => '230724'; +use constant AGENT_BUILD => '230725'; # 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 7fab994392..4020ef1af9 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 230724 +%define release 230725 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 c042b957e3..b53c4fda44 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 230724 +%define release 230725 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 cc3d79d2fd..986aa5fb71 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="230724" +PI_BUILD="230725" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index dee4dd1e49..ae716f04f7 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230724} +{230725} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8a91448bf0..cc14099dca 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 230724") +#define PANDORA_VERSION ("7.0NG.772 Build 230725") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 629c349733..a2f51b4261 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 230724))" + VALUE "ProductVersion", "(7.0NG.772(Build 230725))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index f8361ed03d..8cb57eca05 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230724 +Version: 7.0NG.772-230725 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 33216ccf44..fced147a35 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-230724" +pandora_version="7.0NG.772-230725" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 2f00645f00..26884786de 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 = 'PC230724'; +$build_version = 'PC230725'; $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 5a934350c7..1a0748ec97 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 876784ad7f..3eab84dadc 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 230724 +%define release 230725 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 3698a44a03..a8d8a4c426 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 230724 +%define release 230725 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index da59fdd8ff..0b32c9ef6a 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230724" +PI_BUILD="230725" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 2ef1276890..d7bbcdffd3 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 230724"; +my $version = "7.0NG.772 Build 230725"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 91f3cb2327..d9000f8541 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 230724"; +my $version = "7.0NG.772 Build 230725"; # save program name for logging my $progname = basename($0); From f0271738626495bc2acfb4b37d950e2db40ddad4 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Tue, 25 Jul 2023 09:26:58 +0200 Subject: [PATCH 64/66] fixed error with new implementation of datatables --- pandora_console/include/javascript/datatablesFunction.js | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/include/javascript/datatablesFunction.js b/pandora_console/include/javascript/datatablesFunction.js index e292838bfe..41f0bbf1e2 100644 --- a/pandora_console/include/javascript/datatablesFunction.js +++ b/pandora_console/include/javascript/datatablesFunction.js @@ -4,6 +4,7 @@ var config = config; var datacolumns = []; var datacolumnsTemp = []; dt.datacolumns.forEach(column => { + if (column === null) return; if (typeof column !== "string") { datacolumnsTemp = { data: column.text, className: column.class }; datacolumns.push(datacolumnsTemp); From 5732997d4a50b184cbf499e061d4bb6d2220adb2 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Tue, 25 Jul 2023 12:26:40 +0200 Subject: [PATCH 65/66] 11764-Log viewer, view agent --- pandora_console/include/styles/pandora.css | 46 ++++++---------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index a6bea61fe1..5d4ed27320 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -4210,13 +4210,6 @@ div.simple_value > a > span.text p { } .modalokbutton { - transition-property: background-color, color; - transition-duration: 1s; - transition-timing-function: ease-out; - -webkit-transition-property: background-color, color; - -webkit-transition-duration: 1s; - -o-transition-property: background-color, color; - -o-transition-duration: 1s; cursor: pointer; text-align: center; margin-right: 45px; @@ -4227,44 +4220,24 @@ div.simple_value > a > span.text p { border-radius: 3px; width: 90px; height: 30px; - background-color: white; - border: 1px solid #82b92e; + background-color: var(--primary-color); + border: 1px solid var(--primary-color); + border-radius: 6px; } .modalokbuttontext { - transition-property: background-color, color; - transition-duration: 1s; - transition-timing-function: ease-out; - -webkit-transition-property: background-color, color; - -webkit-transition-duration: 1s; - -o-transition-property: background-color, color; - -o-transition-duration: 1s; - color: #82b92e; + color: #fff; font-size: 10pt; position: relative; top: 6px; } .modalokbutton:hover { - transition-property: background-color, color; - transition-duration: 1s; - transition-timing-function: ease-out; - -webkit-transition-property: background-color, color; - -webkit-transition-duration: 1s; - -o-transition-property: background-color, color; - -o-transition-duration: 1s; - background-color: #82b92e; + background-color: var(--primary-color); } .modalokbutton:hover .modalokbuttontext { - transition-property: background-color, color; - transition-duration: 1s; - transition-timing-function: ease-out; - -webkit-transition-property: background-color, color; - -webkit-transition-duration: 1s; - -o-transition-property: background-color, color; - -o-transition-duration: 1s; - color: white; + color: #fff; } .modaldeletebutton { @@ -12342,3 +12315,10 @@ tr[id^="network_component-plugin-wmi-fields-dynamicMacroRow-"] input, tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input { width: 100% !important; } + +.start-end-date-log-viewer { + display: flex; + flex-direction: row !important; + flex-wrap: nowrap; + justify-content: flex-start !important; +} From 244c7173556239839a168c360fcb0759a2f39d92 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 26 Jul 2023 01:00:54 +0200 Subject: [PATCH 66/66] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- .../PandoraFMS agent uninstaller.app/Contents/Info.plist | 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 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 9c0d0f0465..cdba617dc7 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-230725 +Version: 7.0NG.772-230726 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 02c76b2b91..1c4a099eb3 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-230725" +pandora_version="7.0NG.772-230726" 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/Darwin/dmg/files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/Info.plist b/pandora_agents/unix/Darwin/dmg/files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/Info.plist index 1edb91b81a..e7c5fa5a91 100644 --- a/pandora_agents/unix/Darwin/dmg/files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/Info.plist +++ b/pandora_agents/unix/Darwin/dmg/files/pandorafms_uninstall/PandoraFMS agent uninstaller.app/Contents/Info.plist @@ -6,7 +6,7 @@ CFBundleIdentifier com.pandorafms.pandorafms_uninstall CFBundleVersion 7.0NG.772 - CFBundleGetInfoString 7.0NG.772 Pandora FMS Agent uninstaller for MacOS by Pandora FMS on Aug 2020 + CFBundleGetInfoString 7.0NG.772 Pandora FMS on Aug 2020 CFBundleShortVersionString 7.0NG.772 NSPrincipalClassNSApplication diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 9a60bb703a..b3b0b5e5f9 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 => '230725'; +use constant AGENT_BUILD => '230726'; # 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 4020ef1af9..2a2c9f1a53 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 230725 +%define release 230726 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 b53c4fda44..ef756d4b5a 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 230725 +%define release 230726 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 986aa5fb71..19d33080bd 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="230725" +PI_BUILD="230726" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index ae716f04f7..6065031cee 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230725} +{230726} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index cc14099dca..0ae3b79415 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 230725") +#define PANDORA_VERSION ("7.0NG.772 Build 230726") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 3c6e52cd0f..ccdbb6478c 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.772(Build 230725))" + VALUE "ProductVersion", "(7.0NG.772(Build 230726))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c69c7f5e2e..95c2d9adf0 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.772-230725 +Version: 7.0NG.772-230726 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 d162aab8f8..28ec2b6efd 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-230725" +pandora_version="7.0NG.772-230726" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 26884786de..a7824b21fe 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 = 'PC230725'; +$build_version = 'PC230726'; $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 1a0748ec97..ddae36bfe8 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 3eab84dadc..cb01d80b18 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 230725 +%define release 230726 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a8d8a4c426..a43e558426 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 230725 +%define release 230726 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 0b32c9ef6a..359caa1778 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.772" -PI_BUILD="230725" +PI_BUILD="230726" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index d7bbcdffd3..e78293fc01 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 230725"; +my $version = "7.0NG.772 Build 230726"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index d9000f8541..1dfb93b30e 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 230725"; +my $version = "7.0NG.772 Build 230726"; # save program name for logging my $progname = basename($0);