From a0b02670fb4028a5a6752463a5aceb4fa37b23ee Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 31 Aug 2023 10:45:27 +0200 Subject: [PATCH 01/94] #11954 Fix pagination --- pandora_console/godmode/agentes/fields_manager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php index 25b06e2f5a..53b4995d20 100644 --- a/pandora_console/godmode/agentes/fields_manager.php +++ b/pandora_console/godmode/agentes/fields_manager.php @@ -217,6 +217,7 @@ foreach ($fields as $field) { array_push($table->data, $data); } +$tablePagination = ''; if ($fields) { html_print_table($table); $tablePagination = ui_pagination($count_fields, false, $offset, 0, true, 'offset', false); @@ -231,6 +232,9 @@ html_print_action_buttons( [ 'icon' => 'next' ], true ), - ['type' => 'form_action'] + [ + 'type' => 'form_action', + 'right_content' => $tablePagination, + ], ); echo ''; From eab6a00300d97a1ef5ab8da2097f14af712c90c4 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 31 Aug 2023 10:49:59 +0200 Subject: [PATCH 02/94] #11945 Amend changes --- pandora_console/godmode/agentes/fields_manager.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php index 53b4995d20..25b06e2f5a 100644 --- a/pandora_console/godmode/agentes/fields_manager.php +++ b/pandora_console/godmode/agentes/fields_manager.php @@ -217,7 +217,6 @@ foreach ($fields as $field) { array_push($table->data, $data); } -$tablePagination = ''; if ($fields) { html_print_table($table); $tablePagination = ui_pagination($count_fields, false, $offset, 0, true, 'offset', false); @@ -232,9 +231,6 @@ html_print_action_buttons( [ 'icon' => 'next' ], true ), - [ - 'type' => 'form_action', - 'right_content' => $tablePagination, - ], + ['type' => 'form_action'] ); echo ''; From 9ae34fae404fa1bc7c324448cd67fc275cd92020 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 31 Aug 2023 12:35:32 +0200 Subject: [PATCH 03/94] #11954 Fix delete alerts action in bulk --- .../godmode/massive/massive_delete_action_alerts.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/massive/massive_delete_action_alerts.php b/pandora_console/godmode/massive/massive_delete_action_alerts.php index cad37a3a29..0cd712e124 100644 --- a/pandora_console/godmode/massive/massive_delete_action_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_action_alerts.php @@ -111,7 +111,8 @@ if ($delete) { $alerts_agent_modules = []; foreach ($agent_alerts['simple'] as $agent_alert) { if ((in_array($agent_alert['id_alert_template'], $id_alert_templates)) && (in_array($agent_alert['id_agent_module'], $modules_id))) { - $alerts_agent_modules = array_merge($alerts_agent_modules, alerts_get_alerts_agent_module($agent_alert['id_agent_module'], true, false, 'id')); + // $alerts_agent_modules = array_merge($alerts_agent_modules, alerts_get_alerts_agent_module($agent_alert['id_agent_module'], true, false, 'id')); + $alerts_agent_modules[] = $agent_alert['id']; } } @@ -126,7 +127,7 @@ if ($delete) { $agent_module_actions = []; foreach ($alerts_agent_modules as $alert_agent_module) { - $agent_module_actions = alerts_get_alert_agent_module_actions($alert_agent_module['id'], ['id', 'id_alert_action']); + $agent_module_actions = alerts_get_alert_agent_module_actions($alert_agent_module, ['id', 'id_alert_action']); foreach ($agent_module_actions as $agent_module_action) { foreach ($actions as $action) { From dac99b7a30be4960df2832e3cb420792a886fd62 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Fri, 1 Sep 2023 08:55:18 +0200 Subject: [PATCH 04/94] #11886 Fix minimun misprint --- pandora_console/include/functions_reporting_html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index eb7c555fb9..60e6e41a0c 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -4091,7 +4091,7 @@ function reporting_html_value( $table2->head = [ __('Agent'), __('Module'), - __('Minimun'), + __('Minimum'), ]; break; @@ -4162,7 +4162,7 @@ function reporting_html_value( case 'min_value': $table1->head = [ __('Lapse'), - __('Minimun'), + __('Minimum'), ]; break; From 94315147cfeb8d88daeeb53c1c062f9babd7b052 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 1 Sep 2023 10:12:03 +0200 Subject: [PATCH 05/94] #11750 module_data name file add module id --- pandora_console/include/functions_api.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 7e22befbee..95e3e47919 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -10299,8 +10299,7 @@ function api_set_module_data($id, $thrash2, $other, $trash1) modules_get_type_name($agentModule['id_tipo_modulo']), $data ); - - if (false === @file_put_contents($config['remote_config'].'/'.io_safe_output($agent['nombre']).'.'.$time.'.data', $xml)) { + if (false === @file_put_contents($config['remote_config'].'/'.io_safe_output($agent['nombre']).'.'.$idAgentModule.'.'.$time.'.data', $xml)) { returnError(sprintf('XML file could not be generated in path: %s', $config['remote_config'])); } else { echo __('XML file was generated successfully in path: ').$config['remote_config']; From 5a31621abfc33c93ee1c772f5b7e20d6c734c163 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Fri, 1 Sep 2023 13:15:42 +0200 Subject: [PATCH 06/94] #11903 Fix gis maps --- .../godmode/gis_maps/configure_gis_map.php | 14 +++++++++----- pandora_console/include/functions_gis.php | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pandora_console/godmode/gis_maps/configure_gis_map.php b/pandora_console/godmode/gis_maps/configure_gis_map.php index a6f282d2cf..fee2b9d723 100644 --- a/pandora_console/godmode/gis_maps/configure_gis_map.php +++ b/pandora_console/godmode/gis_maps/configure_gis_map.php @@ -243,10 +243,15 @@ switch ($action) { $map_default_altitude = get_parameter('map_default_altitude'); $map_group_id = get_parameter('map_group_id'); $map_levels_zoom = get_parameter('map_levels_zoom', 16); - $map_connection_list_temp = explode(',', get_parameter('map_connection_list')); + $map_connection_list_temp_string = implode(',', $map_connection_list_temp); + if (strlen($map_connection_list_temp_string) > 0) { + $where_map_connection = ' WHERE id_tmap_connection IN('.$map_connection_list_temp_string.')'; + } else { + $where_map_connection = ''; + } - $listConnectionTemp = db_get_all_rows_sql('SELECT id_tmap_connection, conection_name, group_id FROM tgis_map_connection'); + $listConnectionTemp = db_get_all_rows_sql('SELECT id_tmap_connection, conection_name, group_id FROM tgis_map_connection'.$where_map_connection); foreach ($map_connection_list_temp as $index => $value) { $cleanValue = trim($value); @@ -256,7 +261,6 @@ switch ($action) { } $map_connection_default = get_parameter('map_connection_default'); - $map_connection_list = []; foreach ($listConnectionTemp as $idMapConnection) { $default = 0; @@ -345,7 +349,7 @@ function deleteConnectionMap(idConnectionMap) { checked = $("#radiobtn0001", $("#map_connection_" + idConnectionMap)).attr('checked'); $("#map_connection_" + idConnectionMap).remove(); - + if (checked) { //Checked first, but not is index = 0 maybe. @@ -485,7 +489,7 @@ foreach ($listConnectionTemp as $connectionTemp) { $table->data[1][0] = __('Add Map connection').$iconError; $table->data[1][1] = " - - + diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index 986dcb423b..fc043228ed 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -78,6 +78,7 @@ $action = get_parameterBetweenListValues( 'update', 'delete', 'multiple_delete', + 'update_json', ], 'new' ); @@ -523,6 +524,110 @@ switch ($activeTab) { } break; + case 'update_json': + // Update background. + $background = get_parameter('background'); + $width = get_parameter('background_width'); + $height = get_parameter('background_height'); + + if ($width == 0 && $height == 0) { + $sizeBackground = getimagesize( + $config['homedir'].'/images/console/background/'.$background + ); + $width = $sizeBackground[0]; + $height = $sizeBackground[1]; + } + + db_process_sql_update( + 'tlayout', + [ + 'background' => $background, + 'width' => $width, + 'height' => $height, + ], + ['id' => $idVisualConsole] + ); + + // Return the updated visual console. + $visualConsole = db_get_row_filter( + 'tlayout', + ['id' => $idVisualConsole] + ); + + // Update elements in visual map. + $idsElements = db_get_all_rows_filter( + 'tlayout_data', + ['id_layout' => $idVisualConsole], + [ + 'id', + 'type', + ] + ); + + $array_update = json_decode(io_safe_output(get_parameter('array_update')), true); + + if (count($array_update)) { + foreach ($array_update as $row) { + $id = $row['id']; + $values = []; + $values['label'] = $row['label']; + $values['image'] = $row['image']; + $values['width'] = $row['width']; + $values['height'] = $row['height']; + $values['pos_x'] = $row['pos_x']; + $values['pos_y'] = $row['pos_y']; + + switch ($row['rowtype']) { + case NETWORK_LINK: + case LINE_ITEM: + continue 2; + + break; + + case SIMPLE_VALUE_MAX: + case SIMPLE_VALUE_MIN: + case SIMPLE_VALUE_AVG: + $values['period'] = $row['period']; + break; + + case MODULE_GRAPH: + $values['period'] = $row['period']; + unset($values['image']); + break; + + case GROUP_ITEM: + $values['id_group'] = $row['group']; + break; + + case CIRCULAR_PROGRESS_BAR: + case CIRCULAR_INTERIOR_PROGRESS_BAR: + case PERCENTILE_BUBBLE: + case PERCENTILE_BAR: + unset($values['height']); + break; + } + + if (defined('METACONSOLE')) { + $values['id_metaconsole'] = $row['id_server']; + } + + $values['id_agent'] = $row['agent']; + $values['id_agente_modulo'] = $row['module']; + $values['id_custom_graph'] = $row['custom_graph']; + $values['parent_item'] = $row['parent']; + $values['id_layout_linked'] = $row['map_linked']; + + if (enterprise_installed()) { + enterprise_visual_map_update_action_from_list_elements($row['rowtype'], $values, $id); + } + + db_process_sql_update('tlayout_data', $values, ['id' => $id]); + } + + return true; + } + break; + case 'delete': $id_element = get_parameter('id_element'); $result = db_process_sql_delete('tlayout_data', ['id' => $id_element]); From 08bccce67367b92acc1250d72d7d28e9279da755 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Tue, 17 Oct 2023 08:28:38 -0600 Subject: [PATCH 28/94] Remove root validation --- pandora_agents/pc/pandora_agent | 11 +---------- pandora_agents/unix/pandora_agent | 9 +-------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/pandora_agents/pc/pandora_agent b/pandora_agents/pc/pandora_agent index aa8208f5d0..04b7de51a5 100644 --- a/pandora_agents/pc/pandora_agent +++ b/pandora_agents/pc/pandora_agent @@ -2185,16 +2185,7 @@ sub configure ($) { #Launch tentacle server in proxy mode if configured if ($Conf{'proxy_mode'}) { - - #Check if user is root - if ($> != 0) { - if (launch_tentacle_proxy() != 0) { - return 1; - } - } else { - error ('Proxy mode can not be launched as root'); - return 1; - } + return 1 if (launch_tentacle_proxy() != 0); } # Add the plugins directory to the PATH diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index de7a2e6946..d0b7c22ede 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -4183,14 +4183,7 @@ my $PID = $$; #Launch tentacle server in proxy mode if configured if ($Conf{'proxy_mode'}) { - - #Check if user is root - if ($> != 0) { - launch_tentacle_proxy(); - } else { - log_message ('error', 'Proxy mode can not be launched as root'); - exit 1; - } + launch_tentacle_proxy(); } # Advice if YAML::Tiny is allowed in this system From ec8fed69b3f2ea9319bb554ccd01f12f655b22b5 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 19 Oct 2023 15:04:49 +0200 Subject: [PATCH 29/94] #12168 tree hierarchical filtering --- .../include/class/TreeService.class.php | 1 + .../include/javascript/tree/TreeController.js | 62 +++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/pandora_console/include/class/TreeService.class.php b/pandora_console/include/class/TreeService.class.php index d45ce50573..b218468de3 100644 --- a/pandora_console/include/class/TreeService.class.php +++ b/pandora_console/include/class/TreeService.class.php @@ -627,6 +627,7 @@ class TreeService extends Tree $tmp['type'] = 'services'; $tmp['rootType'] = 'services'; $tmp['children'] = []; + $tmp['servicesChildren'] = services_get_services_children($item->service()->id()); $tmp['serviceDetail'] = ui_get_full_url( 'index.php?sec=network&sec2=enterprise/operation/services/services&tab=service_map&id_service='.$item->service()->id() ); diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 9d28ec9641..d2aa9347a4 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -1486,6 +1486,11 @@ var TreeController = { return 0; }); + //Search service criterion + const searchFilter = controller.filter.searchService; + if (searchFilter && controller.finded !== 1) { + rawTree = _filterItems(rawTree, searchFilter); + } _.each(rawTree, function(element) { element.jqObject = _processNode($group, element); }); @@ -1551,6 +1556,63 @@ var TreeController = { // Add again the hover event to the 'force_callback' elements forced_title_callback(); + + /** + * Filter the tree based on a search criterion + */ + function _filterItems(rawTree, searched) { + const ancestors = []; + const father = []; + const newTree = []; + rawTree.map((raw, index) => { + if (raw.servicesChildren.length !== 0) { + // search at parent level + let findedPadre = raw.description.indexOf(searched); + if (findedPadre === -1) { + // search for children + raw.servicesChildren.map(child => { + let finded = child.description.indexOf(searched); + if (finded === 0) { + //we keep the father of the child that contains it + ancestors.push(child.ancestor); + } else if (findedPadre === -1 && finded === -1) { + //we save the father + father.push(raw.id); + } + }); + } else { + //we mark the father as found + controller.finded = 1; + } + } else { + let finded = raw.description.indexOf(searched); + if (finded === -1) { + delete rawTree[index]; + } + } + }); + + if (ancestors.length >= 1) { + ancestors.map(ancestor => { + newTree.push( + rawTree.filter(item => item.id === parseInt(ancestor)) + ); + }); + + return newTree[0]; + } + + if (father.length >= 1) { + let filterfather = [...new Set(father)]; + const newTree = rawTree.filter( + item => !filterfather.includes(item.id) + ); + + return newTree; + } + + return rawTree.filter(item => item); + } }, load: function() { this.reload(); From 13ba9aff39492865cb7704dbd40f168967b64253 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Fri, 20 Oct 2023 10:49:08 +0200 Subject: [PATCH 30/94] #12168 filtered only for services --- .../include/javascript/tree/TreeController.js | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index d2aa9347a4..d8a6daf468 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -1565,29 +1565,31 @@ var TreeController = { const father = []; const newTree = []; rawTree.map((raw, index) => { - if (raw.servicesChildren.length !== 0) { - // search at parent level - let findedPadre = raw.description.indexOf(searched); - if (findedPadre === -1) { - // search for children - raw.servicesChildren.map(child => { - let finded = child.description.indexOf(searched); - if (finded === 0) { - //we keep the father of the child that contains it - ancestors.push(child.ancestor); - } else if (findedPadre === -1 && finded === -1) { - //we save the father - father.push(raw.id); - } - }); + if (raw.type === "services") { + if (raw.servicesChildren.length !== 0) { + // search at parent level + let findedPadre = raw.description.indexOf(searched); + if (findedPadre === -1) { + // search for children + raw.servicesChildren.map(child => { + let finded = child.description.indexOf(searched); + if (finded === 0) { + //we keep the father of the child that contains it + ancestors.push(child.ancestor); + } else if (findedPadre === -1 && finded === -1) { + //we save the father + father.push(raw.id); + } + }); + } else { + //we mark the father as found + controller.finded = 1; + } } else { - //we mark the father as found - controller.finded = 1; - } - } else { - let finded = raw.description.indexOf(searched); - if (finded === -1) { - delete rawTree[index]; + let finded = raw.description.indexOf(searched); + if (finded === -1) { + delete rawTree[index]; + } } } }); From fdb800c712b44901bbf0a57c28542be998b7faf7 Mon Sep 17 00:00:00 2001 From: Calvo Date: Fri, 20 Oct 2023 13:43:28 +0200 Subject: [PATCH 31/94] Fix upload file function filter by extension. Fix mib uploader only upload .mib file --- .../include/functions_filemanager.php | 61 +++++++++++-------- .../snmpconsole/snmp_mib_uploader.php | 2 +- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index aee3d88730..a390ee2c1a 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -128,19 +128,18 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_ $extension = pathinfo($filename, PATHINFO_EXTENSION); $umask = io_safe_output((string) get_parameter('umask')); - $parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY)); - $parse_sec2_query = explode('=', $parse_all_queries[1]); - $check_extension = true; - if ($parse_sec2_query[1] === 'operation/snmpconsole/snmp_mib_uploader') { - if ((strtolower($extension) !== 'mib' && strtolower($extension) !== 'zip')) { - $check_extension = false; - } else { - $check_extension = true; - } - } - + // $parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY)); + // $parse_sec2_query = explode('=', $parse_all_queries[1]); + // $check_extension = true; + // if ($parse_sec2_query[1] === 'operation/snmpconsole/snmp_mib_uploader') { + // if ((strtolower($extension) !== 'mib' && strtolower($extension) !== 'zip')) { + // $check_extension = false; + // } else { + // $check_extension = true; + // } + // } // (strtolower($extension) !== 'mib' && strtolower($extension) !== 'zip') - if (strpos($real_directory, $default_real_directory) !== 0 || $check_extension === false) { + if (strpos($real_directory, $default_real_directory) !== 0) { // Perform security check to determine whether received upload // directory is part of the default path for caller uploader and // user is not trying to access an external path (avoid @@ -152,12 +151,12 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_ // Copy file to directory and change name. $nombre_archivo = sprintf('%s/%s', $real_directory, $filename); try { - $mimeContentType = mime_content_type($_FILES['file']['tmp_name']); - - if (empty($filterFilesType) === true || in_array($mimeContentType, $filterFilesType) === true) { + $ext = strtolower(pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION)); + if (empty($filterFilesType) === true || in_array($ext, $filterFilesType) === true) { $result = copy($_FILES['file']['tmp_name'], $nombre_archivo); } else { - $error_message = 'The uploaded file is not allowed. Only gif, png or jpg files can be uploaded.'; + $types_allowed = implode(', ', $filterFilesType); + $error_message = 'The uploaded file is not allowed. Only '.$types_allowed.' files can be uploaded.'; throw new Exception(__($error_message)); } } catch (Exception $ex) { @@ -199,19 +198,29 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_ $filepath = $_FILES['file']['tmp_name']; $real_directory = filemanager_safe_directory($destination_directory); $secure = true; - if ($parse_sec2_query[1] === 'operation/snmpconsole/snmp_mib_uploader') { - // Security control structure. - $zip = new \ZipArchive; - if ($zip->open($filepath) === true) { - for ($i = 0; $i < $zip->numFiles; $i++) { - $unzip_filename = $zip->getNameIndex($i); - $extension = pathinfo($unzip_filename, PATHINFO_EXTENSION); - if (strtolower($extension) !== 'mib') { - $secure = false; - break; + try { + $ext = strtolower(pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION)); + if (empty($filterFilesType) === true || in_array($ext, $filterFilesType) === true) { + // Security control structure. + $zip = new \ZipArchive; + if ($zip->open($filepath) === true) { + for ($i = 0; $i < $zip->numFiles; $i++) { + $unzip_filename = $zip->getNameIndex($i); + $extension = pathinfo($unzip_filename, PATHINFO_EXTENSION); + if (in_array(strtolower($extension), $filterFilesType) === false) { + $error_message = 'The uploaded file is not allowed. Only '.$types_allowed.' files can be uploaded.'; + $secure = false; + throw new Exception(__($error_message)); + } } } } + } catch (Exception $ex) { + db_pandora_audit( + AUDIT_LOG_FILE_MANAGER, + 'Error Uploading files: '.$ex->getMessage() + ); + $config['filemanager']['message'] = ui_print_error_message(__('Upload error').': '.$ex->getMessage()); } if (strpos($real_directory, $default_real_directory) !== 0 || $secure === false) { diff --git a/pandora_console/operation/snmpconsole/snmp_mib_uploader.php b/pandora_console/operation/snmpconsole/snmp_mib_uploader.php index 32db1d6b1b..2523e32b13 100644 --- a/pandora_console/operation/snmpconsole/snmp_mib_uploader.php +++ b/pandora_console/operation/snmpconsole/snmp_mib_uploader.php @@ -91,7 +91,7 @@ $create_text_file = (bool) get_parameter('create_text_file'); $default_real_directory = realpath($config['homedir'].'/'.$fallback_directory); if ($upload_file_or_zip === true) { - upload_file($upload_file_or_zip, $default_real_directory, $real_directory); + upload_file($upload_file_or_zip, $default_real_directory, $real_directory, ['mib', 'zip']); } if ($create_text_file === true) { From 48e903897f4dfa526ef00eccd582765faf79af4f Mon Sep 17 00:00:00 2001 From: Calvo Date: Fri, 20 Oct 2023 19:15:07 +0200 Subject: [PATCH 32/94] Fix _moduledata_x when data is a b64 image --- pandora_server/lib/PandoraFMS/Core.pm | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 58815a4ff9..0874e3f3ed 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1770,6 +1770,34 @@ sub pandora_execute_action ($$$$$$$$$;$$) { . $base64_data . "\n"; } + # Image that comes from module macro substitution. + if ($field3 =~ /cid:moduledata_/) { + $content_type = 'multipart/related; boundary="'.$boundary.'"'; + $boundary = "--" . $boundary; + + $field3 = $boundary . "\n" + . "Content-Type: " . $html_content_type . "\n\n" + # "Content-Transfer-Encoding: quoted-printable\n\n" + . $field3 . "\n"; + my @matches = ($field3 =~ /cid:moduledata_(\d+)/g); + foreach my $module_id (@matches) { + # Get base64 Image for the module. + my $module_data = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $module_id); + my $base64_data = substr($module_data, 23); # remove first 23 characters: 'data:image/png;base64, ' + + $cid = 'moduledata_'.$module_id; + my $filename = $cid . ".png"; + + $field3 .= $boundary . "\n" + . "Content-Type: image/png; name=\"" . $filename . "\"\n" + . "Content-Disposition: inline; filename=\"" . $filename . "\"\n" + . "Content-Transfer-Encoding: base64\n" + . "Content-ID: <" . $cid . ">\n" + . "Content-Location: " . $filename . "\n\n" + . $base64_data . "\n"; + } + } + if ($pa_config->{"mail_in_separate"} != 0){ foreach my $address (split (',', $field1)) { # Remove blanks @@ -5113,6 +5141,11 @@ sub on_demand_macro($$$$$$;$) { elsif (defined($unit_mod) && $unit_mod ne '') { $field_value .= $unit_mod; } + + if ($field_value =~ /^data:image\/png;base64, /) { + # macro _data_ substitution in case is image. + $field_value = ''; + } return(defined($field_value)) ? $field_value : ''; } elsif ($macro eq '_secondarygroups_') { From fa39a975182eef8e60726240edf06c748b491c1b Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 27 Oct 2023 10:18:10 +0200 Subject: [PATCH 33/94] Module histogram only events pandora_enterprise#12209 --- pandora_console/include/functions_events.php | 52 +++ .../include/functions_reporting.php | 300 ++++++++---------- 2 files changed, 185 insertions(+), 167 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index f709fe2b4c..78a5a65bd2 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -127,6 +127,58 @@ function events_translate_event_type($event_type) } +/** + * Module status event_type into descriptive text. + * + * @param integer $event_type Event type. + * + * @return string Module status. + */ +function events_status_module_event_type($event_type) +{ + $module_status = ''; + switch ($event_type) { + case 'alert_fired': + case 'alert_recovered': + case 'alert_ceased': + case 'alert_manual_validation': + $module_status = AGENT_MODULE_STATUS_CRITICAL_ALERT; + break; + + case 'going_down_normal': + case 'going_up_normal': + $module_status = AGENT_MODULE_STATUS_NORMAL; + break; + + case 'going_unknown': + case 'unknown': + $module_status = AGENT_MODULE_STATUS_UNKNOWN; + break; + + case 'going_up_warning': + case 'going_down_warning': + $module_status = AGENT_MODULE_STATUS_WARNING; + break; + + case 'going_up_critical': + case 'going_down_critical': + $module_status = AGENT_MODULE_STATUS_CRITICAL_BAD; + break; + + case 'recon_host_detected': + case 'system': + case 'error': + case 'new_agent': + case 'configuration_change': + default: + $module_status = AGENT_MODULE_STATUS_NOT_INIT; + break; + } + + return $module_status; +} + + /** * Translates a numeric value event_status into descriptive text. * diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 39f1642fa0..d7dfef4b58 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -15920,171 +15920,153 @@ function reporting_module_histogram_graph($report, $content, $pdf=0) return false; } - $module_interval = modules_get_interval( - $content['id_agent_module'] - ); - $slice = ($content['period'] / $module_interval); + $filter = [ + 'id_agentmodule' => $content['id_agent_module'], + 'group_rep' => EVENT_GROUP_REP_ALL, + 'date_to' => date('Y-m-d', ($report['datetime'] - $content['period'])), + 'time_to' => date('H:i:s', ($report['datetime'] - $content['period'])), + ]; - $result_sla = reporting_advanced_sla( - $content['id_agent_module'], - ($report['datetime'] - $content['period']), - $report['datetime'], - null, - null, + $previous_event = events_get_all( + ['te.event_type, te.timestamp, te.utimestamp'], + $filter, 0, - null, - null, - null, - $slice, 1, + 'desc', + 'timestamp', true ); - // Select Warning and critical values. - $agentmodule_info = modules_get_agentmodule($content['id_agent_module']); - $min_value_critical = ($agentmodule_info['min_critical'] == 0) ? null : $agentmodule_info['min_critical']; + $status = ''; + if ($previous_event !== false) { + $previous_event = end($previous_event); + $status = $previous_event['event_type']; + } - // Check if module type is string. - $modules_is_string = modules_is_string($agentmodule_info['id_agente_modulo']); + $date_start = ($report['datetime'] - $content['period']); + $filter = [ + 'id_agentmodule' => $content['id_agent_module'], + 'group_rep' => EVENT_GROUP_REP_ALL, + 'date_from' => date('Y-m-d', $date_start), + 'date_to' => date('Y-m-d', $report['datetime']), + 'time_from' => date('H:i:s', $date_start), + 'time_to' => date('H:i:s', $report['datetime']), + ]; - if ($modules_is_string === false) { - if ($agentmodule_info['max_critical'] == 0) { - $max_value_critical = null; - if ($agentmodule_info['min_critical'] == 0) { - if ((bool) $content['dinamic_proc'] === true) { - $max_value_critical = 0.01; - } + $events = events_get_all( + ['te.event_type, te.timestamp, te.utimestamp'], + $filter, + null, + null, + null, + null, + true + ); + + $not_init_data = []; + $previous_data = [ + 'event_type' => $status, + 'utimestamp' => $date_start, + ]; + if (empty($status) === true) { + // Si viene de no iniciado busco el rpimer dato del modulo y si es de histórico. + $first_utimestamp = false; + $search_historydb = false; + $extract_first_data = modules_get_first_date($content['id_agent_module'], 0); + if (empty($extract_first_data) === false) { + $first_utimestamp = $extract_first_data['first_utimestamp']; + $search_historydb = (isset($extract_first_data['search_historydb']) === true) ? $extract_first_data['search_historydb'] : false; + } + + // Si se encuentra algun dato. + // Si no hay eventos, la fecha del primer dato no sea mayor al fin del report (seria un bloque completo de no iniciado). + // Se comprueba que si existen eventos el dato no sea previo al evento. + if ($first_utimestamp !== false + && (($events === false && $first_utimestamp < $report['datetime']) || ($events !== false && $first_utimestamp < $events[0]['utimestamp'])) + ) { + // Tenemos en cuenta si el modulo es de tipo string. + $module = modules_get_agentmodule($content['id_agent_module']); + $module_type = $module['id_tipo_modulo']; + $module_type_str = modules_get_type_name($module_type); + $table = 'tagente_datos'; + if (strstr($module_type_str, 'string') !== false) { + $table = 'tagente_datos_string'; + } + + $query = sprintf( + 'SELECT datos,utimestamp + FROM %s + WHERE id_agente_modulo = %d + AND utimestamp = %d + ', + $table, + $content['id_agent_module'], + $first_utimestamp + ); + + $data = db_get_all_rows_sql($query, $search_historydb); + if ($data !== false) { + $not_init_data = [ + 'event_type' => $status, + 'utimestamp' => $date_start, + ]; + $previous_data = [ + 'event_type' => 'going_up_normal', + 'utimestamp' => $data[0]['utimestamp'], + ]; } - } else { - $max_value_critical = $agentmodule_info['max_critical']; - } - } else { - if ($agentmodule_info['str_critical'] == '') { - $max_value_critical = null; - } else { - $max_value_critical = $agentmodule_info['str_critical']; } } - $inverse_critical = $agentmodule_info['critical_inverse']; - - $min_value_warning = ($agentmodule_info['min_warning'] == 0) ? null : $agentmodule_info['min_warning']; - - if ($modules_is_string === false) { - if ($agentmodule_info['max_warning'] == 0) { - $max_value_warning = null; - } else { - $max_value_warning = $agentmodule_info['max_warning']; - } - } else { - if ($agentmodule_info['str_warning'] == '') { - $max_value_warning = null; - } else { - $max_value_warning = $agentmodule_info['str_warning']; - } + $array_result = []; + $time_total = $content['period']; + $check_total = 0; + $check_ok = 0; + $time_ok = 0; + if (empty($events) === true) { + $events = []; } - $inverse_warning = $agentmodule_info['warning_inverse']; + // Añadimos el dato previo. + array_unshift($events, $previous_data); + if (empty($not_init_data) === false) { + // Añadimos si viene de no iniciado el no iniciado. + array_unshift($events, $not_init_data); + } - $data = []; - $data['time_total'] = 0; - $data['time_ok'] = 0; - $data['time_error'] = 0; - $data['time_warning'] = 0; - $data['time_unknown'] = 0; - $data['time_not_init'] = 0; - $data['time_downtime'] = 0; - $data['checks_total'] = 0; - $data['checks_ok'] = 0; - $data['checks_error'] = 0; - $data['checks_warning'] = 0; - $data['checks_unknown'] = 0; - $data['checks_not_init'] = 0; - - $array_graph = []; + $current_time = time(); $i = 0; - foreach ($result_sla as $value_sla) { - $data['time_total'] += $value_sla['time_total']; - $data['time_ok'] += $value_sla['time_ok']; - $data['time_error'] += $value_sla['time_error']; - $data['time_warning'] += $value_sla['time_warning']; - $data['time_unknown'] += $value_sla['time_unknown']; - $data['time_downtime'] += $value_sla['time_downtime']; - $data['time_not_init'] += $value_sla['time_not_init']; - $data['checks_total'] += $value_sla['checks_total']; - $data['checks_ok'] += $value_sla['checks_ok']; - $data['checks_error'] += $value_sla['checks_error']; - $data['checks_warning'] += $value_sla['checks_warning']; - $data['checks_unknown'] += $value_sla['checks_unknown']; - $data['checks_not_init'] += $value_sla['checks_not_init']; - - // Generate raw data for graph. - if ($value_sla['time_total'] != 0) { - if ($value_sla['time_error'] > 0) { - // ERR. - $array_graph[$i]['data'] = 3; - } else if ($value_sla['time_unknown'] > 0) { - // UNKNOWN. - $array_graph[$i]['data'] = 4; - } else if ($value_sla['time_warning'] > 0) { - // Warning. - $array_graph[$i]['data'] = 2; - } else if ($value_sla['time_not_init'] == $value_sla['time_total']) { - // NOT INIT. - $array_graph[$i]['data'] = 6; - } else { - $array_graph[$i]['data'] = 1; - } + foreach ($events as $event) { + $array_result[$i]['data'] = events_status_module_event_type($event['event_type']); + if (isset($events[($i + 1)]) === true) { + $period = ($events[($i + 1)]['utimestamp'] - $event['utimestamp']); + $array_result[$i]['utimestamp'] = $period; } else { - $array_graph[$i]['data'] = 7; + $period = ($report['datetime'] - $event['utimestamp']); + // El ultimo evento solo lo arrastramos hasta la fecha actual. + // Si pedimos mas fecha sera desconocido. + if ($report['datetime'] > $current_time) { + $period = ($current_time - $event['utimestamp']); + } + + $array_result[$i]['utimestamp'] = $period; } - $array_graph[$i]['utimestamp'] = ($value_sla['date_to'] - $value_sla['date_from']); + if ($array_result[$i]['data'] === AGENT_MODULE_STATUS_NORMAL) { + $check_ok++; + $time_ok += $period; + } + + $check_total++; $i++; } - $data['sla_value'] = reporting_sla_get_compliance_from_array( - $data - ); - - $data['sla_fixed'] = sla_truncate( - $data['sla_value'], - $config['graph_precision'] - ); - - $data_init = -1; - $acum = 0; - $sum = 0; - $array_result = []; - $i = 0; - foreach ($array_graph as $value) { - if ($data_init == -1) { - $data_init = $value['data']; - $acum = $value['utimestamp']; - } else { - if ($data_init == $value['data']) { - $acum = ($acum + $value['utimestamp']); - } else { - $array_result[$i]['data'] = $data_init; - $array_result[$i]['utimestamp'] = $acum; - $array_result[$i]['real_data'] = $sum; - $i++; - $data_init = $value['data']; - $acum = $value['utimestamp']; - } - } + // Bloque por si se pide mas fecha. + if ($report['datetime'] > $current_time) { + $array_result[$i]['data'] = AGENT_MODULE_STATUS_UNKNOWN; + $array_result[$i]['utimestamp'] = ($report['datetime'] - $current_time); } - if (count($array_result) == 0) { - $array_result = $array_graph; - } else { - $array_result[$i]['data'] = $data_init; - $array_result[$i]['utimestamp'] = $acum; - $array_result[$i]['real_data'] = $sum; - } - - $time_total = $data['time_total']; - // Slice graphs calculation. $return['agent'] = modules_get_agentmodule_agent_alias( $content['id_agent_module'] ); @@ -16092,37 +16074,21 @@ function reporting_module_histogram_graph($report, $content, $pdf=0) $content['id_agent_module'] ); - $return['max_critical'] = $max_value_critical; - $return['min_critical'] = $min_value_critical; - $return['critical_inverse'] = $inverse_critical; - $return['max_warning'] = $max_value_warning; - $return['min_warning'] = $min_value_warning; - $return['warning_inverse'] = $inverse_warning; - $return['data_not_init'] = $data['checks_not_init']; - $return['data_unknown'] = $data['checks_unknown']; - $return['data_critical'] = $data['checks_error']; - $return['data_warning'] = $data['checks_warning']; - $return['data_ok'] = $data['checks_ok']; - $return['data_total'] = $data['checks_total']; - $return['time_not_init'] = $data['time_not_init']; - $return['time_unknown'] = $data['time_unknown']; - $return['time_critical'] = $data['time_error']; - $return['time_warning'] = $data['time_warning']; - $return['time_ok'] = $data['time_ok']; - if ($data['checks_total'] > 0) { - $return['percent_ok'] = (($data['checks_ok'] * 100) / $data['checks_total']); + $return['data_ok'] = $check_ok; + $return['data_total'] = $check_total; + if ($check_total > 0) { + $return['percent_ok'] = (($time_ok * 100) / $content['period']); } else { $return['percent_ok'] = 0; } $colors = [ - 1 => COL_NORMAL, - 2 => COL_WARNING, - 3 => COL_CRITICAL, - 4 => COL_UNKNOWN, - 5 => COL_DOWNTIME, - 6 => COL_NOTINIT, - 7 => COL_IGNORED, + AGENT_MODULE_STATUS_CRITICAL_ALERT => COL_ALERTFIRED, + AGENT_MODULE_STATUS_NORMAL => COL_NORMAL, + AGENT_MODULE_STATUS_UNKNOWN => COL_UNKNOWN, + AGENT_MODULE_STATUS_WARNING => COL_WARNING, + AGENT_MODULE_STATUS_CRITICAL_BAD => COL_CRITICAL, + AGENT_MODULE_STATUS_NOT_INIT => COL_NOTINIT, ]; $width_graph = 100; From aaa590b65fd8ac0ee75e4b2e0ca52c9f7ecca8e6 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 7 Nov 2023 09:20:48 +0100 Subject: [PATCH 34/94] VC Public links pandora_enterprise#12329 --- pandora_console/ajax.php | 4 +- .../javascript/pandora_visual_console.js | 4 +- .../rest-api/models/VisualConsole/Item.php | 8 ++-- .../operation/visual_console/public_view.php | 48 +++++++++---------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index b3b9463ee6..a5dcf2cb0d 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -183,7 +183,9 @@ if (isset($config['force_instant_logout']) === true $_SESSION = []; session_destroy(); header_remove('Set-Cookie'); - setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); + if (isset($_COOKIE[session_name()]) === true) { + setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); + } if ($config['auth'] === 'saml' && empty($public_hash) === true) { include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php'; diff --git a/pandora_console/include/javascript/pandora_visual_console.js b/pandora_console/include/javascript/pandora_visual_console.js index adcbd3ce0c..0e16bb303f 100755 --- a/pandora_console/include/javascript/pandora_visual_console.js +++ b/pandora_console/include/javascript/pandora_visual_console.js @@ -808,8 +808,8 @@ function loadVisualConsoleData( getVisualConsoleItems: 1, size: size, visualConsoleId: vcId, - id_user: typeof id_user == undefined ? id_user : null, - auth_hash: typeof hash == undefined ? hash : null, + id_user: typeof id_user !== undefined ? id_user : null, + auth_hash: typeof hash !== undefined ? hash : null, mode: mode, widthScreen: widthScreen }, diff --git a/pandora_console/include/rest-api/models/VisualConsole/Item.php b/pandora_console/include/rest-api/models/VisualConsole/Item.php index 0db9d999c2..411d605c0e 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Item.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Item.php @@ -1196,7 +1196,7 @@ class Item extends CachedModel 'operation/visual_console/view', ['id' => $vcId], // No autologin from the public view. - !$config['public_view'], + !$config['public_access'], $mobile_navigation, [ 'page' => 'visualmap', @@ -1302,7 +1302,7 @@ class Item extends CachedModel 'enterprise/operation/services/services', ['id_service' => $serviceId], // No autologin from the public view. - !$config['public_view'] + !$config['public_access'] ); } else { // A regular module. @@ -1312,7 +1312,7 @@ class Item extends CachedModel 'operation/agentes/status_monitor', ['id_module' => $moduleId], // No autologin from the public view. - !((isset($config['public_view']) === true) ? $config['public_view'] : false), + !((isset($config['public_access']) === true) ? $config['public_access'] : false), $mobile_navigation, [ 'id' => $moduleId, @@ -1377,7 +1377,7 @@ class Item extends CachedModel 'operation/agentes/ver_agente', ['id_agente' => $agentId], // No autologin from the public view. - !$config['public_view'], + !$config['public_access'], $mobile_navigation, [ 'id' => $agentId, diff --git a/pandora_console/operation/visual_console/public_view.php b/pandora_console/operation/visual_console/public_view.php index 46dd4e43b4..64529133b4 100644 --- a/pandora_console/operation/visual_console/public_view.php +++ b/pandora_console/operation/visual_console/public_view.php @@ -33,7 +33,7 @@ require_once $config['homedir'].'/vendor/autoload.php'; ui_require_css_file('register', 'include/styles/', true); // Connection lost alert. -ui_require_javascript_file('connection_check', 'include/javascript/', true); +// ui_require_javascript_file('connection_check', 'include/javascript/', true); set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false)); $conn_title = __('Connection with console has been lost'); $conn_text = __('Connection to the console has been lost. Please check your internet connection.'); @@ -47,7 +47,7 @@ global $vc_public_view; global $config; $vc_public_view = true; -$config['public_view'] = true; +$config['public_access'] = true; // This starts the page head. In the call back function, // things from $page['head'] array will be processed into the head. @@ -62,12 +62,6 @@ require_once 'include/functions_visual_map.php'; $hash = (string) get_parameter('hash'); -// For public link issue. -$force_instant_logout = true; -if (isset($config['id_user']) === true) { - $force_instant_logout = false; -} - // Check input hash. // DO NOT move it after of get parameter user id. if (User::validatePublicHash($hash) !== true) { @@ -256,17 +250,17 @@ $visualConsoleItems = VisualConsole::getItemsFromDB( if (menuLinks !== null) { menuLinks.forEach(function (menuLink) { menuLink.href = menuLink.href.replace(regex, replacement); - menuLink.href = menuLink.href.replace( - regex_hash, - replacement_hash - ); + //menuLink.href = menuLink.href.replace( + // regex_hash, + // replacement_hash + //); }); } // Change the URL (if the browser has support). if ("history" in window) { var href = window.location.href.replace(regex, replacement); - href = href.replace(regex_hash, replacement_hash); + //href = href.replace(regex_hash, replacement_hash); window.history.replaceState({}, document.title, href); } } @@ -321,20 +315,24 @@ $visualConsoleItems = VisualConsole::getItemsFromDB( } } }); - - - // No click enabled when user not logged. - $( "a" ).on( "click", function( event ) { - event.preventDefault(); - $('#visual-console-container').removeClass('is-updating'); - $('.div-visual-console-spinner').remove(); - }); - 0) { + ob_end_flush(); } \ No newline at end of file From 14fff848760653ab06d9b61f2b65e99479dcf873 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 8 Nov 2023 11:56:32 +0100 Subject: [PATCH 35/94] queries remove field transactional_agent pandora_enterprise#12334 --- pandora_console/extras/mr/67.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 pandora_console/extras/mr/67.sql diff --git a/pandora_console/extras/mr/67.sql b/pandora_console/extras/mr/67.sql new file mode 100644 index 0000000000..0a5fcd9fb0 --- /dev/null +++ b/pandora_console/extras/mr/67.sql @@ -0,0 +1,13 @@ +START TRANSACTION; + +SET @exist = (SELECT count(*) FROM information_schema.columns WHERE TABLE_NAME='tmetaconsole_agent' AND COLUMN_NAME='transactional_agent' AND table_schema = DATABASE()); +SET @sqlstmt = IF (@exist>0, 'ALTER TABLE `tmetaconsole_agent` DROP COLUMN `transactional_agent`', 'SELECT ""'); +prepare stmt from @sqlstmt; +execute stmt; + +SET @exist = (SELECT count(*) FROM information_schema.columns WHERE TABLE_NAME='tagente' AND COLUMN_NAME='transactional_agent' AND table_schema = DATABASE()); +SET @sqlstmt = IF (@exist>0, 'ALTER TABLE `tagente` DROP COLUMN `transactional_agent`', 'SELECT ""'); +prepare stmt from @sqlstmt; +execute stmt; + +COMMIT; From 5eb5df61906cdf0f1e98aa6213af79660fa00eaf Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Fri, 10 Nov 2023 13:13:57 +0100 Subject: [PATCH 36/94] change url pandorarc name --- pandora_console/godmode/setup/setup.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 0fd6bebff8..c0d59fbde9 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -184,7 +184,7 @@ $buttons['ITSM'] = [ $buttons['ehorus'] = [ 'active' => false, - 'text' => ''.html_print_image( + 'text' => ''.html_print_image( 'images/RC.png', true, [ @@ -297,7 +297,7 @@ switch ($section) { $help_header = 'setup_flow_tab'; break; - case 'ehorus': + case 'pandorarc': $buttons['ehorus']['active'] = true; $subpage = __('Pandora RC'); $help_header = 'setup_ehorus_tab'; @@ -438,7 +438,7 @@ switch ($section) { include_once $config['homedir'].'/godmode/setup/setup_visuals.php'; break; - case 'ehorus': + case 'pandorarc': include_once $config['homedir'].'/godmode/setup/setup_ehorus.php'; break; From 04649dee00d8d0b25ffa8cab410d7f687a6768d3 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 13 Nov 2023 13:41:47 +0100 Subject: [PATCH 37/94] #12168 Fixed sql bringing main services --- .../include/class/TreeService.class.php | 16 ++++++---------- .../include/javascript/tree/TreeController.js | 1 + 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/class/TreeService.class.php b/pandora_console/include/class/TreeService.class.php index b218468de3..a627794f0e 100644 --- a/pandora_console/include/class/TreeService.class.php +++ b/pandora_console/include/class/TreeService.class.php @@ -738,19 +738,15 @@ class TreeService extends Tree $filterResult = db_get_all_rows_sql($sqlFilter); + $services = []; foreach ($filterResult as $key => $result) { - $ancestors = services_get_services_ancestors($result['id']); - $idAncestors = implode(',', $ancestors); - $numAncestors = count($ancestors); - if ($numAncestors > 1) { - $whereAncestors = ' AND tse.id_service_child in ('.$idAncestors.')'; - } else if ($numAncestors == 1) { - $whereAncestors = ' AND ts.id ='.$idAncestors; - } else { - $whereAncestors = ' AND ts.id ='.$result['id']; - } + $services_ancestors = services_get_services_ancestors($result['id']); + $services[] = array_pop($services_ancestors); } + $services_list = array_unique($services, SORT_NUMERIC); + $whereAncestors = ' AND tse.id_service IN ('.implode(',', $services_list).')'; + return $whereAncestors; } diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index d8a6daf468..4f850e32d5 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -1561,6 +1561,7 @@ var TreeController = { * Filter the tree based on a search criterion */ function _filterItems(rawTree, searched) { + console.log(rawTree); const ancestors = []; const father = []; const newTree = []; From d49c5e4954336fa79371fc7eb6a8e965bd4d6641 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 13 Nov 2023 15:12:55 +0100 Subject: [PATCH 38/94] delete agents pandora_db pandora_enterprise#12293 --- pandora_server/util/pandora_db.pl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 92c6c5f9ce..b68e71c469 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -142,10 +142,18 @@ sub pandora_purgedb ($$$) { # Delete manually disabled agents after some period if (defined ($conf->{'_delete_disabled_agents'}) && $conf->{'_delete_disabled_agents'} > 0) { log_message('PURGE', "Deleting old disabled agents (More than " . $conf->{'_delete_disabled_agents'} . " days)."); - db_do ($dbh, "DELETE FROM tagente - WHERE UNIX_TIMESTAMP(ultimo_contacto) + ? < UNIX_TIMESTAMP(NOW()) - AND disabled = 1 - AND modo != 2", $conf->{'_delete_disabled_agents'} * 8600); + my @agents_to_delete = get_db_rows ( + $dbh, + "SELECT id_agente FROM tagente + WHERE UNIX_TIMESTAMP(ultimo_contacto) + ? < UNIX_TIMESTAMP(NOW()) + AND disabled = 1 + AND modo != 2", + $conf->{'_delete_disabled_agents'} * 8600 + ); + + foreach my $agent_to_delete (@agents_to_delete) { + pandora_delete_agent($dbh, $agent_to_delete->{'id_agente'}); + } } # Delete old data From c2bf6e6bf52614c88448dd83e4035cfb65c93b40 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 13 Nov 2023 17:34:38 +0100 Subject: [PATCH 39/94] fix pgrep process in ubuntu --- pandora_console/include/functions_cron_task.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_cron_task.php b/pandora_console/include/functions_cron_task.php index 9de0520ccd..40a6e159cc 100644 --- a/pandora_console/include/functions_cron_task.php +++ b/pandora_console/include/functions_cron_task.php @@ -459,17 +459,17 @@ function cron_task_start_gotty(bool $restart_mode=true) // Check prev process running and kill it (only if port changed in setup params). if (empty($config['restart_gotty_next_cron_port']) === false) { - config_update_value('restart_gotty_next_cron_port', ''); - - $prevProcessRunning = shell_exec("pgrep -f 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."'"); + $prevProcessRunning = shell_exec("pgrep -af 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."' | grep -v 'pgrep'"); if (empty($prevProcessRunning) === false) { shell_exec("pkill -f 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."'"); } + + config_update_value('restart_gotty_next_cron_port', ''); } // Check if gotty is running on the configured port. - $processRunning = shell_exec("pgrep -f 'pandora_gotty.*-p ".$config['gotty_port']."'"); + $processRunning = shell_exec("pgrep -af 'pandora_gotty.*-p ".$config['gotty_port']."' | grep -v 'pgrep'"); $start_proc = true; From f725752f3201b52645c6360cddbad5a6e5d2b45e Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 14 Nov 2023 12:33:29 +0100 Subject: [PATCH 40/94] #12168 fixed filter in service tree genealogy --- .../include/javascript/tree/TreeController.js | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 4f850e32d5..06274600ed 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -1561,27 +1561,21 @@ var TreeController = { * Filter the tree based on a search criterion */ function _filterItems(rawTree, searched) { - console.log(rawTree); const ancestors = []; const father = []; const newTree = []; + const tmpTree = []; rawTree.map((raw, index) => { if (raw.type === "services") { if (raw.servicesChildren.length !== 0) { // search at parent level - let findedPadre = raw.description.indexOf(searched); + let descr = raw.description.toLowerCase(); + let sear = searched.toLowerCase(); + let findedPadre = descr.indexOf(sear); if (findedPadre === -1) { - // search for children - raw.servicesChildren.map(child => { - let finded = child.description.indexOf(searched); - if (finded === 0) { - //we keep the father of the child that contains it - ancestors.push(child.ancestor); - } else if (findedPadre === -1 && finded === -1) { - //we save the father - father.push(raw.id); - } - }); + father.push(raw.id); + } else if (findedPadre >= 0) { + ancestors.push(raw.id); } else { //we mark the father as found controller.finded = 1; @@ -1607,9 +1601,16 @@ var TreeController = { if (father.length >= 1) { let filterfather = [...new Set(father)]; - const newTree = rawTree.filter( - item => !filterfather.includes(item.id) - ); + + filterfather.map(father => { + tmpTree.push(rawTree.filter(raw => raw.id == father)); + }); + + let tree = [...new Set(tmpTree)]; + tree.map(item => { + let tmpItem = item[0]; + newTree.push(tmpItem); + }); return newTree; } From 78a5a3bfe8116b0c10b11b8c725301a0eaf102ae Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 14 Nov 2023 17:12:22 +0100 Subject: [PATCH 41/94] #12168 Hierarchy is added to the title of services --- .../include/class/TreeService.class.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/pandora_console/include/class/TreeService.class.php b/pandora_console/include/class/TreeService.class.php index a627794f0e..177a45a54f 100644 --- a/pandora_console/include/class/TreeService.class.php +++ b/pandora_console/include/class/TreeService.class.php @@ -333,6 +333,7 @@ class TreeService extends Tree $services[$service['id']]['id'] = $service['id']; $services[$service['id']]['description'] = $service['description']; $services[$service['id']]['serviceDetail'] = 'index.php?sec=network&sec2=enterprise/operation/services/services&tab=service_map&id_service='.(int) $service['id']; + $services[$service['id']]['title'] = services_get_parents_title((int) $service['id']); } return $services; @@ -732,20 +733,8 @@ class TreeService extends Tree if (isset($this->filter['searchService']) === true && empty($this->filter['searchService']) === false ) { - $sqlFilter = 'SELECT ts.id FROM tservice ts - where ts.name LIKE "%'.$this->filter['searchService'].'%" - OR ts.description LIKE "%'.$this->filter['searchService'].'%"'; - - $filterResult = db_get_all_rows_sql($sqlFilter); - - $services = []; - foreach ($filterResult as $key => $result) { - $services_ancestors = services_get_services_ancestors($result['id']); - $services[] = array_pop($services_ancestors); - } - - $services_list = array_unique($services, SORT_NUMERIC); - $whereAncestors = ' AND tse.id_service IN ('.implode(',', $services_list).')'; + $whereAncestors = ' AND ts.name LIKE "%'.$this->filter['searchService'].'%" + OR ts.description LIKE "%'.$this->filter['searchService'].'%"'; return $whereAncestors; } From 4579fe21d98e1215413afc262154542271e3deaa Mon Sep 17 00:00:00 2001 From: alejandro Date: Wed, 15 Nov 2023 14:24:42 +0100 Subject: [PATCH 42/94] update version in mr --- pandora_console/extras/mr/67.sql | 6 ++++++ pandora_console/pandoradb_data.sql | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 pandora_console/extras/mr/67.sql diff --git a/pandora_console/extras/mr/67.sql b/pandora_console/extras/mr/67.sql new file mode 100644 index 0000000000..48d44b6255 --- /dev/null +++ b/pandora_console/extras/mr/67.sql @@ -0,0 +1,6 @@ +START TRANSACTION; + +UPDATE `tdiscovery_apps` SET `version` = '1.2' WHERE `short_name` = 'pandorafms.vmware'; + +COMMIT; + diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 9ce5355361..6813173de7 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -2653,7 +2653,7 @@ SET @short_name = 'pandorafms.vmware'; SET @name = 'VMware'; SET @section = 'app'; SET @description = 'Monitor ESXi hosts, datastores and VMs from a specific datacenter'; -SET @version = '1.1'; +SET @version = '1.2'; INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; From 4b0e134fba568048df1cb7f897f136033b1edca8 Mon Sep 17 00:00:00 2001 From: alejandro Date: Wed, 15 Nov 2023 15:13:08 +0100 Subject: [PATCH 43/94] update md5 hash --- .../extras/discovery/DiscoveryApplicationsMigrateCodes.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini b/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini index 6323aec140..1ba02194d2 100644 --- a/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini +++ b/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini @@ -1,4 +1,4 @@ -pandorafms.vmware=9959cc3e5cc6bfcfadd6d05b56d4a11b +pandorafms.vmware=54251ae54994c55b478867cd35a98e6c pandorafms.mysql=fadb4750d18285c0eca34f47c6aa3cfe pandorafms.mssql=1cc215409741d19080269ffba112810e pandorafms.oracle=2d9320a514d1e48a0b2804e1653c31c6 From 804970719d502de1adb91f2b32a055a116830427 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 15 Nov 2023 16:32:02 +0100 Subject: [PATCH 44/94] #12385 Fixed group --- .../agentes/pandora_networkmap.view.php | 51 ------------------- 1 file changed, 51 deletions(-) diff --git a/pandora_console/operation/agentes/pandora_networkmap.view.php b/pandora_console/operation/agentes/pandora_networkmap.view.php index 5256c10871..3cbe53e815 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.view.php +++ b/pandora_console/operation/agentes/pandora_networkmap.view.php @@ -1205,57 +1205,6 @@ if (is_ajax() === true) { return; } - if ($get_agents_in_group) { - $id = (int) get_parameter('id', 0); - $group = (int) get_parameter('group', -1); - - $return = []; - $return['correct'] = false; - - if ($group != -1) { - $where_id_agente = ' 1=1 '; - - $agents_in_networkmap = db_get_all_rows_filter( - 'titem', - [ - 'id_map' => $id, - 'deleted' => 0, - ] - ); - if ($agents_in_networkmap !== false) { - $ids = []; - foreach ($agents_in_networkmap as $agent) { - if ($agent['type'] == 0) { - $ids[] = $agent['source_data']; - } - } - - $where_id_agente = ' id_agente NOT IN ('.implode(',', $ids).')'; - } - - - $sql = 'SELECT id_agente, alias - FROM tagente - WHERE id_grupo = '.$group.' AND '.$where_id_agente.' - ORDER BY alias ASC'; - - $agents = db_get_all_rows_sql($sql); - - if ($agents !== false) { - $return['agents'] = []; - foreach ($agents as $agent) { - $return['agents'][$agent['id_agente']] = $agent['alias']; - } - - $return['correct'] = true; - } - } - - echo json_encode($return); - - return; - } - if ($get_agent_info) { $id_agent = (int) get_parameter('id_agent'); From 1a931c71b4114d4f69aa12bd42cf615d56de676e Mon Sep 17 00:00:00 2001 From: alejandro Date: Thu, 16 Nov 2023 10:10:54 +0100 Subject: [PATCH 45/94] update vmwre md5 code --- .../extras/discovery/DiscoveryApplicationsMigrateCodes.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini b/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini index 1ba02194d2..c0cee7d03f 100644 --- a/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini +++ b/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini @@ -1,4 +1,4 @@ -pandorafms.vmware=54251ae54994c55b478867cd35a98e6c +pandorafms.vmware=248788e0fb2cd4e11623e4a52ee7d05b pandorafms.mysql=fadb4750d18285c0eca34f47c6aa3cfe pandorafms.mssql=1cc215409741d19080269ffba112810e pandorafms.oracle=2d9320a514d1e48a0b2804e1653c31c6 From 0f9facb99955d940572b06239a5a4be56043fd02 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 16 Nov 2023 13:17:25 +0100 Subject: [PATCH 46/94] fix chart_generator pdf pandora_enterprise#12382 --- .../extras/delete_files/delete_files.txt | 1 + pandora_console/include/chart_generator.php | 324 ------------------ pandora_console/include/functions.php | 263 +++++++++++--- pandora_console/include/functions_ui.php | 27 +- .../include/graphs/functions_d3.php | 4 +- .../include/graphs/functions_flot.php | 6 +- 6 files changed, 241 insertions(+), 384 deletions(-) delete mode 100644 pandora_console/include/chart_generator.php diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt index 234ec4e997..03db82db4e 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -1720,3 +1720,4 @@ include/functions_integriaims.php include/ajax/integria_incidents.ajax.php enterprise/operation/log/log_source.php enterprise/include/class/LogSource.class.php +include/chart_generator.php \ No newline at end of file diff --git a/pandora_console/include/chart_generator.php b/pandora_console/include/chart_generator.php deleted file mode 100644 index 529684569d..0000000000 --- a/pandora_console/include/chart_generator.php +++ /dev/null @@ -1,324 +0,0 @@ - 'api_password'] - ) - ); - - - if ($apiPassword === $data_decoded['apipass']) { - $bypassLogin = true; - } -} - -if (!isset($config[$slicebar])) { - $config[$slicebar] = $slicebar_value; -} - -// Try to initialize session using existing php session id. -$user = new PandoraFMS\User(['phpsessionid' => $session_id]); - -if (check_login(false) === false && $bypassLogin !== true) { - // Error handler. - ?> - - - - - Access denied - - - - - - - - - -

Access is not granted

-
".html_print_select($listConnection, 'map_connection_list', '', '', '', '0', true)." + ".html_print_select($listConnection, 'select-map_connection_list', '', '', '', '0', true)." ".html_print_image( diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index ba9116759b..b57ec9e9ff 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -1585,7 +1585,7 @@ function gis_add_conection_maps_in_form($map_connection_list)
'.html_print_input_text('map_connection_name_'.$mapConnection['id_conection'], $mapConnectionRowDB['conection_name'], '', 20, 40, true, true).' '.$radioButton.''.html_print_image('images/delete.svg', true, ['alt' => '', 'class' => 'invert_filter']).''.html_print_image('images/delete.svg', true, ['alt' => '', 'class' => 'invert_filter main_menu_icon']).'
+ + + + + + +
+ + logo + + +

'.$product_name.'

+

'.__('Version').' '.$pandora_version.$lts_name.' - '.(enterprise_installed() ? 'Enterprise' : 'Community').'

+

'.__('You are using the free, OpenSource version of Pandora FMS.').'

+

'.__('This version has no official support or warranty, you can purchase the Enterprise version, which offers support, warranty and additional features to the Opensource version.').'

+

'.__('Click on this link for more information.').'

+
+ + + + '; + + echo $dialog; + } } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index d8f7dd9416..6b35f1682d 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -8764,6 +8764,10 @@ div.graph div.legend table { text-decoration: underline; } +.underline-hover:hover { + text-decoration: underline; +} + .w105px { width: 105px; } From ffdf0d81b9f5740bada3d3647209bc100dbe68b0 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 12 Dec 2023 01:00:30 +0100 Subject: [PATCH 93/94] Auto-updated build strings. --- pandora_agents/pc/Win32/pandora_agent.conf | 2 +- 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.redhat_bin.el8.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.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 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf index b064eba730..27f0326da0 100644 --- a/pandora_agents/pc/Win32/pandora_agent.conf +++ b/pandora_agents/pc/Win32/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2023 Pandora FMS -# Version 7.0NG.774 +# Version 7.0NG.774 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software # Foundation; either version 2 of the Licence or any later version diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 4e0ddda275..54a176337b 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.774-231211 +Version: 7.0NG.774-231212 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 b9ad79a017..d051c72a6b 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.774-231211" +pandora_version="7.0NG.774-231212" 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 28221f797a..7eb214fc62 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.774'; -use constant AGENT_BUILD => '231211'; +use constant AGENT_BUILD => '231212'; # 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 00ca89e515..9f3291fdb9 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.774 -%define release 231211 +%define release 231212 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index ca9029cba0..a848441ad2 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231211 +%define release 231212 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index f47b8313f5..6abf503eaf 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231211 +%define release 231212 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 547fe315f0..d65d8d79ff 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231211 +%define release 231212 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index baec9b3b27..c97d33c59a 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.774 -%define release 231211 +%define release 231212 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 9f2d39b086..8c8824bfd5 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.774" -PI_BUILD="231211" +PI_BUILD="231212" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 26255617af..3b72f76b39 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{231211} +{231212} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b053ad9bda..efd6655451 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.774 Build 231211") +#define PANDORA_VERSION ("7.0NG.774 Build 231212") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 0a75f5df7d..324a4cac17 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.774(Build 231211))" + VALUE "ProductVersion", "(7.0NG.774(Build 231212))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 3f268e2383..d5a81b977a 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.774-231211 +Version: 7.0NG.774-231212 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 cbb2b91142..9e1c0f5a64 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.774-231211" +pandora_version="7.0NG.774-231212" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ccf7174e57..1cf4f577a5 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 = 'PC231211'; +$build_version = 'PC231212'; $pandora_version = 'v7.0NG.774'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index b9ac34794c..c54a0c974d 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 8aea06e829..2d0ed51620 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.774 -%define release 231211 +%define release 231212 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 24151d4685..07ac77eee2 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.774 -%define release 231211 +%define release 231212 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index e833bb1958..8fa24f1001 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.774" -PI_BUILD="231211" +PI_BUILD="231212" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 269e23f3eb..e8eb01d313 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.774 Build 231211"; +my $version = "7.0NG.774 Build 231212"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index aae2e87f8e..8ac11f20bc 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.774 Build 231211"; +my $version = "7.0NG.774 Build 231212"; # save program name for logging my $progname = basename($0); From 14f8deebcaef67ef2b5f7c15b91ef4b28746a1f5 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 13 Dec 2023 01:00:28 +0100 Subject: [PATCH 94/94] 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.redhat_bin.el8.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.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 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 54a176337b..f8b810d817 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.774-231212 +Version: 7.0NG.774-231213 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 d051c72a6b..fe934f5bb2 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.774-231212" +pandora_version="7.0NG.774-231213" 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 7eb214fc62..263b12b006 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.774'; -use constant AGENT_BUILD => '231212'; +use constant AGENT_BUILD => '231213'; # 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 9f3291fdb9..c8b79b5432 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.774 -%define release 231212 +%define release 231213 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index a848441ad2..e15c66a2b0 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231212 +%define release 231213 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index 6abf503eaf..c8b9c5bab9 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231212 +%define release 231213 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index d65d8d79ff..54311de34a 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231212 +%define release 231213 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index c97d33c59a..bfeb6b46be 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.774 -%define release 231212 +%define release 231213 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 8c8824bfd5..ccd8e1bbe9 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.774" -PI_BUILD="231212" +PI_BUILD="231213" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 3b72f76b39..af055f92d2 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{231212} +{231213} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index efd6655451..0c717e94de 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.774 Build 231212") +#define PANDORA_VERSION ("7.0NG.774 Build 231213") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 324a4cac17..d0c4b12420 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.774(Build 231212))" + VALUE "ProductVersion", "(7.0NG.774(Build 231213))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d5a81b977a..3db8b82868 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.774-231212 +Version: 7.0NG.774-231213 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 9e1c0f5a64..ed5bacf153 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.774-231212" +pandora_version="7.0NG.774-231213" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1cf4f577a5..a06a174ade 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 = 'PC231212'; +$build_version = 'PC231213'; $pandora_version = 'v7.0NG.774'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index c54a0c974d..91de00f8a8 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 2d0ed51620..3d44ddc426 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.774 -%define release 231212 +%define release 231213 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 07ac77eee2..0bad40c2b6 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.774 -%define release 231212 +%define release 231213 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 8fa24f1001..8dcdf85db0 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.774" -PI_BUILD="231212" +PI_BUILD="231213" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index e8eb01d313..0b74326632 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.774 Build 231212"; +my $version = "7.0NG.774 Build 231213"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 8ac11f20bc..afcf8b9199 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.774 Build 231212"; +my $version = "7.0NG.774 Build 231213"; # save program name for logging my $progname = basename($0);