From 10a5cd496f0f5059b6eb72fff5408446cc0f21e5 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Fri, 14 Jul 2023 13:53:52 +0200 Subject: [PATCH 01/70] #11714 Fix external link --- pandora_console/godmode/users/configure_user.php | 12 ++++++++---- pandora_console/godmode/users/user_management.php | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 7227aaa09e..56f15ee0a8 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -349,8 +349,10 @@ if ($create_user === true) { $values['data_section'] = $dashboard; } else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) { $values['data_section'] = $visual_console; - } else if ($values['section'] === HOME_SCREEN_OTHER || io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) { - $values['data_section'] = get_parameter('data_section'); + } else if ($values['section'] === HOME_SCREEN_OTHER) { + $values['data_section'] = get_parameter('data_section_other'); + } else if (io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) { + $values['data_section'] = get_parameter('data_section_external'); } // $values['section'] = $homeScreenValues[$values['section']]; @@ -643,8 +645,10 @@ if ($update_user) { $values['data_section'] = $dashboard; } else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) { $values['data_section'] = $visual_console; - } else if ($values['section'] === HOME_SCREEN_OTHER || io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) { - $values['data_section'] = get_parameter('data_section'); + } else if ($values['section'] === HOME_SCREEN_OTHER) { + $values['data_section'] = get_parameter('data_section_other'); + } else if (io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) { + $values['data_section'] = get_parameter('data_section_external'); } // $values['section'] = $homeScreenValues[$values['section']]; diff --git a/pandora_console/godmode/users/user_management.php b/pandora_console/godmode/users/user_management.php index 241177f2a2..ec967c293d 100644 --- a/pandora_console/godmode/users/user_management.php +++ b/pandora_console/godmode/users/user_management.php @@ -52,8 +52,8 @@ $customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select($dashboards // Home screen. Visual consoles. $customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select($layouts_aux, 'visual_console', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%'); // Home screen. External link and Other. -$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true); -$customHomeScreenAddition[HOME_SCREEN_OTHER] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true); +$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section_external', $user_info['data_section'], '', 60, 255, true); +$customHomeScreenAddition[HOME_SCREEN_OTHER] = html_print_input_text('data_section_other', $user_info['data_section'], '', 60, 255, true); $customHomeScreenDataField = ''; foreach ($customHomeScreenAddition as $key => $customField) { From 6c41ccc0f3a8847514b59cc414bfa15824932bd2 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 17 Jul 2023 08:59:19 +0200 Subject: [PATCH 02/70] #11699 fix css filter --- pandora_console/include/styles/pandora_black.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index 652d777f72..999810c367 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -1464,6 +1464,10 @@ ul.datatable_filter:has(li > div.action-buttons) { background-color: #222 !important; } +ul.datatable_filter { + background-color: #222 !important; +} + span.ui-dialog-title { color: #fff !important; } From aead8d006e84f01f30607e32d7d4f7f5ea90631e Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 29 Aug 2023 14:11:32 +0200 Subject: [PATCH 03/70] #11894 Fixed links does not update the page when creating or deleting links --- pandora_console/godmode/setup/links.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/setup/links.php b/pandora_console/godmode/setup/links.php index fc27454b48..20e61e95b0 100644 --- a/pandora_console/godmode/setup/links.php +++ b/pandora_console/godmode/setup/links.php @@ -54,8 +54,12 @@ if (isset($_POST['create'])) { if (! $result) { ui_print_error_message(__('There was a problem creating link')); } else { - ui_print_success_message(__('Successfully created')); $id_link = $result; + ui_print_result_message( + $id_link, + __('Successfully created'), + __('Could not be created') + ); } } @@ -111,8 +115,8 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) { $link = ''; } - echo ''; echo ''; + echo '
'; if ($creation_mode == 1) { echo ""; } else { @@ -179,10 +183,10 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) { ) ); - echo '
'; + echo ''; } else { - // Main list view for Links editor - $rows = db_get_all_rows_in_table('tlink', 'name'); + // Main list view for Links editor. + $rows = db_get_all_fields_in_table('tlink', '', '', 'name'); if ($rows === false) { $rows = []; } From 98112d9ff3e51f286e7058d8a2c9518183d37b1b Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 1 Sep 2023 09:05:16 +0200 Subject: [PATCH 04/70] #11759 fix delete action snmp alert --- pandora_console/godmode/snmpconsole/snmp_alert.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index d23b65d7ea..0df4298d7a 100755 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -1952,6 +1952,7 @@ if ($create_alert || $update_alert) { [ 'border' => '0', 'alt' => __('Delete'), + 'class' => 'invert_filter main_menu_icon', ] ).' '; $data[1] .= ''; From 3960c2021a9f874b1c290b6d49d8937fc59bf595 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Fri, 1 Sep 2023 09:06:48 +0200 Subject: [PATCH 05/70] #11856 Fix view events tooltip --- pandora_console/include/styles/tables.css | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/include/styles/tables.css b/pandora_console/include/styles/tables.css index 7d93624dbb..bd68fe4358 100644 --- a/pandora_console/include/styles/tables.css +++ b/pandora_console/include/styles/tables.css @@ -652,6 +652,7 @@ div.advanced-options-events > div.filter_input { .vert-align-bottom { vertical-align: bottom; + font-size: 8pt; } label.vert-align-bottom > a.tip { From bf4ef92610de2730d8bdaad2da6c80d684eb2aca Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 4 Sep 2023 13:44:44 +0200 Subject: [PATCH 06/70] #11511 Move tools from operation to management --- pandora_console/godmode/menu.php | 13 +++++++++++++ pandora_console/operation/menu.php | 7 ------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 7cd504c8ac..9773a824ee 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -366,6 +366,8 @@ if ($access_console_node === true) { $sub['godmode/alerts/alert_list']['text'] = __('List of Alerts'); $sub['godmode/alerts/alert_list']['id'] = 'List_of_Alerts'; $sub['godmode/alerts/alert_list']['pages'] = ['godmode/alerts/alert_view']; + $sub['godmode/agentes/planned_downtime.list']['text'] = __('Scheduled downtime'); + $sub['godmode/agentes/planned_downtime.list']['id'] = 'scheduled_downtime'; if ((bool) check_acl($config['id_user'], 0, 'LM') === true) { $sub['godmode/alerts/alert_templates']['text'] = __('Templates'); @@ -706,6 +708,17 @@ if ($access_console_node === true) { } if ($access_console_node === true) { + // Tools + $menu_godmode['tools']['text'] = __('Tools'); + $menu_godmode['tools']['sec2'] = 'operation/extensions'; + $menu_godmode['tools']['id'] = 'oper-extensions'; + $sub = []; + $sub['operation/agentes/exportdata']['text'] = __('Export data'); + $sub['operation/agentes/exportdata']['id'] = 'export_data'; + $sub['extensions/files_repo']['text'] = __('File repository'); + $sub['extensions/files_repo']['id'] = 'file_repository'; + $menu_godmode['tools']['sub'] = $sub; + // About. $menu_godmode['about']['text'] = __('About'); $menu_godmode['about']['id'] = 'about'; diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index e64dbe30c7..6a12b5542f 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -802,13 +802,6 @@ if ($access_console_node === true) { } } } - - if (!empty($sub)) { - $menu_operation['extensions']['text'] = __('Tools'); - $menu_operation['extensions']['sec2'] = 'operation/extensions'; - $menu_operation['extensions']['id'] = 'oper-extensions'; - $menu_operation['extensions']['sub'] = $sub; - } } // ~ } From d48cd703bc28fb050d5d747622f0373cda493b01 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 7 Sep 2023 10:25:09 +0200 Subject: [PATCH 07/70] Added distro information in About and Diagnostic info --- pandora_console/include/class/Diagnostics.class.php | 6 +++++- pandora_console/include/functions_menu.php | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index 2c00a6b328..2ce5b54170 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -728,7 +728,7 @@ class Diagnostics extends Wizard $cpuModelName = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"'; $cpuProcessor = 'cat /proc/cpuinfo | grep "processor" | wc -l'; $ramMemTotal = 'cat /proc/meminfo | grep "MemTotal"'; - + $distroInfo = 'cat /etc/os-release | grep "PRETTY_NAME" | cut -f 2 -d "="'; exec( "ifconfig | awk '{ print $2}' | grep -E -o '([0-9]{1,3}[\.]){3}[0-9]{1,3}'", $output @@ -747,6 +747,10 @@ class Diagnostics extends Wizard 'name' => __('RAM'), 'value' => exec($ramMemTotal), ], + 'distroInfo' => [ + 'name' => __('Distro'), + 'value' => str_replace('"', '', exec($distroInfo)), + ], 'osInfo' => [ 'name' => __('Os'), 'value' => exec('uname -a'), diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index a1927bb60a..231d084bae 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -1164,6 +1164,14 @@ if (is_ajax()) {

'.$sys_info->data->ramInfo->value.'

+ + +

'.$sys_info->data->distroInfo->name.'

+ + +

'.$sys_info->data->distroInfo->value.'

+ +

'.$sys_info->data->osInfo->name.'

From f445066d134da812c8670eb208cabe2b5bce56b6 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 7 Sep 2023 16:29:18 +0200 Subject: [PATCH 08/70] #11679 Fix linked module name --- pandora_console/include/ajax/module.php | 2 ++ .../operation/search_modules.getdata.php | 26 ++++++++++++------- pandora_console/operation/search_modules.php | 10 ++++--- pandora_console/operation/search_results.php | 2 +- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 1e529c487c..278774b8cd 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -1155,7 +1155,9 @@ if (check_login()) { ); } + $data[2] .= ''; $data[2] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '…', 'font-size: 9pt;'); + $data[2] .= ''; if (empty($module['extended_info']) === false) { $data[2] .= ui_print_help_tip($module['extended_info'], true, '/images/default_list.png'); } diff --git a/pandora_console/operation/search_modules.getdata.php b/pandora_console/operation/search_modules.getdata.php index e83c6035ef..a278ca8cd0 100644 --- a/pandora_console/operation/search_modules.getdata.php +++ b/pandora_console/operation/search_modules.getdata.php @@ -19,17 +19,25 @@ require_once $config['homedir'].'/include/functions_users.php'; $searchModules = check_acl($config['id_user'], 0, 'AR'); -$selectModuleNameUp = ''; -$selectModuleNameDown = ''; -$selectAgentNameUp = ''; -$selectAgentNameDown = ''; +if ($config['style'] === 'pandora_black') { + $selectModuleNameUp = ''; + $selectModuleNameDown = ''; + $selectAgentNameUp = ''; + $selectAgentNameDown = ''; +} else { + $selectModuleNameUp = '_black'; + $selectModuleNameDown = '_black'; + $selectAgentNameUp = '_black'; + $selectAgentNameDown = '_black'; +} + $is_admin = (bool) db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']); switch ($sortField) { case 'module_name': switch ($sort) { case 'up': - $selectModuleNameUp = $selected; + $selectModuleNameUp = $selected_module; $order = [ 'field' => 'module_name', 'order' => 'ASC', @@ -37,7 +45,7 @@ switch ($sortField) { break; case 'down': - $selectModuleNameDown = $selected; + $selectModuleNameDown = $selected_module; $order = [ 'field' => 'module_name', 'order' => 'DESC', @@ -49,7 +57,7 @@ switch ($sortField) { case 'agent_name': switch ($sort) { case 'up': - $selectAgentNameUp = $selected; + $selectAgentNameUp = $selected_module; $order = [ 'field' => 'agent_name', 'order' => 'ASC', @@ -57,7 +65,7 @@ switch ($sortField) { break; case 'down': - $selectAgentNameDown = $selected; + $selectAgentNameDown = $selected_module; $order = [ 'field' => 'agent_name', 'order' => 'DESC', @@ -67,7 +75,7 @@ switch ($sortField) { break; default: - $selectModuleNameUp = $selected; + $selectModuleNameUp = $selected_module; $order = [ 'field' => 'module_name', 'order' => 'ASC', diff --git a/pandora_console/operation/search_modules.php b/pandora_console/operation/search_modules.php index 6d35064b68..41d545928f 100644 --- a/pandora_console/operation/search_modules.php +++ b/pandora_console/operation/search_modules.php @@ -30,10 +30,9 @@ if (!$modules || !$searchModules) { $table->cellspacing = 4; $table->width = '98%'; $table->class = 'info_table'; - $table->head = []; - $table->head[0] = __('Module').' '.html_print_image('images/sort_up.png', true, ['style' => $selectModuleNameUp]).''.html_print_image('images/sort_down.png', true, ['style' => $selectModuleNameDown]).''; - $table->head[1] = __('Agent').' '.html_print_image('images/sort_up.png', true, ['style' => $selectAgentNameUp]).''.html_print_image('images/sort_down.png', true, ['style' => $selectAgentNameDown]).''; + $table->head[0] = __('Module').' '.html_print_image('images/sort_up'.$selectModuleNameUp.'.png', true).''.html_print_image('images/sort_down'.$selectModuleNameDown.'.png', true).''; + $table->head[1] = __('Agent').' '.html_print_image('images/sort_up'.$selectAgentNameUp.'.png', true).''.html_print_image('images/sort_down'.$selectAgentNameDown.'.png', true).''; $table->head[2] = __('Type'); $table->head[3] = __('Interval'); $table->head[4] = __('Status'); @@ -80,6 +79,9 @@ if (!$modules || !$searchModules) { $module['datos'] = modules_get_last_value($module['id_agente_modulo']); $module['module_name'] = $module['nombre']; + $linked_module_name = ''; + $linked_module_name .= $module['module_name']; + $linked_module_name .= ''; // To search the monitor status $status_sql = sprintf('SELECT estado from tagente_estado where id_agente_modulo ='.$module['id_agente_modulo']); $status_sql = db_process_sql($status_sql); @@ -226,7 +228,7 @@ if (!$modules || !$searchModules) { array_push( $table->data, [ - $module['module_name'], + $linked_module_name, $agentCell, $typeCell, $intervalCell, diff --git a/pandora_console/operation/search_results.php b/pandora_console/operation/search_results.php index cef9788be0..76638e3525 100644 --- a/pandora_console/operation/search_results.php +++ b/pandora_console/operation/search_results.php @@ -60,7 +60,7 @@ $order = null; $sortField = get_parameter('sort_field'); $sort = get_parameter('sort', 'none'); $selected = 'border: 1px solid black;'; - +$selected_module = '_green'; if ($searchMain) { $main_tab = [ 'text' => "".html_print_image( From 46142e37023f82652fffab83325fa5532444b9be Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Fri, 8 Sep 2023 12:12:24 +0200 Subject: [PATCH 09/70] fixed Graph container icon --- pandora_console/godmode/reporting/graph_container.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/graph_container.php b/pandora_console/godmode/reporting/graph_container.php index b4fdcf521d..d7e0aefb78 100644 --- a/pandora_console/godmode/reporting/graph_container.php +++ b/pandora_console/godmode/reporting/graph_container.php @@ -95,7 +95,7 @@ $subsection = reporting_enterprise_add_graph_template_subsection('', $buttons); $buttons['graph_container'] = [ 'active' => true, 'text' => ''.html_print_image( - 'images/graph-container.svg@svg', + 'images/graph-container@svg.svg', true, [ 'title' => __('Graph container'), From c3184cecd161b26164e059dce5a9f92a0bde6fcd Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 11 Sep 2023 11:38:25 +0200 Subject: [PATCH 10/70] #11832 Fixed domain name change in pandoradb_data.sql file --- pandora_console/pandoradb_data.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 1962582965..b47990b6ff 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1183,7 +1183,7 @@ INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALU INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (2, 'Discovery.Cloud', 'Discovery Cloud script to monitor Cloud technologies (AWS.EC2, AWS.S3, AWS.RDS, RDS,ȊWS.EKS)', '/usr/share/pandora_server/util/recon_scripts/pcm_client.pl', '{"1":{"macro":"_field1_","desc":"Configuration file","help":"","value":"","hide":""}}'); -- IPAM is 3. -INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (4, 'IPMI Recon','Specific Pandora FMS Intel DCM Discovery (c) Artica ST 2011 <info@artica.es> Usage: ./ipmi-recon.pl <task_id> <group_id> <custom_field1> <custom_field2> <custom_field3> <custom_field4> * custom_field1 = Network i.e.: 192.168.100.0/24 * custom_field2 = Username * custom_field3 = Password * custom_field4 = Additional parameters i.e.: -D LAN_2_0','/usr/share/pandora_server/util/recon_scripts/ipmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.: 192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional parameters\",\"help\":\"Optional additional parameters such as -D LAN_2_0 to use IPMI ver 2.0 instead of 1.5. These options will also be passed to the IPMI plugin when the current values are read.\",\"value\":\"\",\"hide\":\"\"}}'); +INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (4, 'IPMI Recon','Specific Pandora FMS Intel DCM Discovery (c) Artica ST 2011 <info@pandorafms.com> Usage: ./ipmi-recon.pl <task_id> <group_id> <custom_field1> <custom_field2> <custom_field3> <custom_field4> * custom_field1 = Network i.e.: 192.168.100.0/24 * custom_field2 = Username * custom_field3 = Password * custom_field4 = Additional parameters i.e.: -D LAN_2_0','/usr/share/pandora_server/util/recon_scripts/ipmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.: 192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional parameters\",\"help\":\"Optional additional parameters such as -D LAN_2_0 to use IPMI ver 2.0 instead of 1.5. These options will also be passed to the IPMI plugin when the current values are read.\",\"value\":\"\",\"hide\":\"\"}}'); INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (3, 'IPAM Recon', 'This script is used to automatically detect network hosts availability and name, used as Recon Custom Script in the recon task. Parameters used are:\n\n* custom_field1 = network. i.e.: 192.168.100.0/24\n* custom_field2 = associated IPAM network id. i.e.: 4. Please do not change this value, it is assigned automatically in IPAM management.\n\nSee documentation for more information.', '/usr/share/pandora_server/util/recon_scripts/IPAMrecon.pl', '{"1":{"macro":"_field1_","desc":"Network","help":"i.e.: 192.168.100.0/24","value":"","hide":""}}'); @@ -1203,7 +1203,7 @@ INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries` INSERT INTO `tagent_custom_fields` VALUES (1,'Serial Number',0,0,'',0),(2,'Department',0,0,'',0),(3,'Additional ID',0,0,'',0),(4,'eHorusID',0,0,'',0); -INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://artica.es','','',''),(2,'critical','Critical modules','','','',''),(3,'dmz','DMZ Network Zone','','','',''),(4,'performance','Performance anda capacity modules','','','',''),(5,'configuration','','','','',''); +INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://pandorafms.com','','',''),(2,'critical','Critical modules','','','',''),(3,'dmz','DMZ Network Zone','','','',''),(4,'performance','Performance anda capacity modules','','','',''),(5,'configuration','','','','',''); INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,'',0,90,0),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,'',0,90,0),(5,'Restart agent','Restart the agent with using UDP protocol. To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,'',0,90,0),(6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _module_address_','command',0,620,500,0,'',0,90,0); From 24b8937b113c7e90808d64ae81039bc6d2731dc9 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 11 Sep 2023 13:21:44 +0200 Subject: [PATCH 11/70] The hint is added to the module field. --- pandora_console/include/lib/Dashboard/Widgets/single_graph.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/single_graph.php b/pandora_console/include/lib/Dashboard/Widgets/single_graph.php index 957159824c..0f3ccddff1 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/single_graph.php +++ b/pandora_console/include/lib/Dashboard/Widgets/single_graph.php @@ -324,7 +324,7 @@ class SingleGraphWidget extends Widget // Autocomplete module. $inputs[] = [ - 'label' => __('Module'), + 'label' => __('Module').ui_print_help_tip(__('Warning, this requires to have data for a mid-term (days/weeks) of the source data, if not, projection will not be reliable.'), true), 'arguments' => [ 'type' => 'autocomplete_module', 'name' => 'moduleId', From 2c430929cbba7f9d6ee70a5e956d81c5a3009920 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 11 Sep 2023 16:53:52 +0200 Subject: [PATCH 12/70] #11831 Fixed menu option literals --- pandora_console/extensions/dbmanager.php | 2 +- pandora_console/godmode/setup/setup.php | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pandora_console/extensions/dbmanager.php b/pandora_console/extensions/dbmanager.php index 983e208bef..acaaadd12c 100644 --- a/pandora_console/extensions/dbmanager.php +++ b/pandora_console/extensions/dbmanager.php @@ -90,7 +90,7 @@ function dbmgr_extension_main() // Header. ui_print_standard_header( - __('Database interface'), + __('DB interface'), 'images/gm_db.png', false, '', diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 7e17f9fe4c..e6ae8d7bab 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -93,7 +93,7 @@ $buttons['general'] = [ 'images/setup.png', true, [ - 'title' => __('General'), + 'title' => __('General setup'), 'class' => 'invert_filter', ] @@ -265,7 +265,7 @@ if (enterprise_installed()) { switch ($section) { case 'general': $buttons['general']['active'] = true; - $subpage = __('General'); + $subpage = __('General setup'); $help_header = 'setup_general_tab'; break; @@ -377,7 +377,7 @@ switch ($section) { // Header. ui_print_standard_header( - $subpage, + __('Setup').' » '.$subpage, '', false, $help_header, @@ -388,6 +388,10 @@ ui_print_standard_header( 'link' => '', 'label' => __('Setup'), ], + [ + 'link' => '', + 'label' => $subpage, + ], ] ); From 50351c6ff466899030cfe7c3b7c6fdeedab18d5b Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 12 Sep 2023 10:38:22 +0200 Subject: [PATCH 13/70] #11911 fixed Item Default mail to send alerts from the Welcome dialog --- pandora_console/include/class/WelcomeWindow.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/class/WelcomeWindow.class.php b/pandora_console/include/class/WelcomeWindow.class.php index 5e66268403..897417a9f3 100644 --- a/pandora_console/include/class/WelcomeWindow.class.php +++ b/pandora_console/include/class/WelcomeWindow.class.php @@ -372,7 +372,7 @@ class WelcomeWindow extends Wizard $flag_um = true; } - if (empty($config['welcome_mail_configured']) === false) { + if (empty($config['email_username']) === false && empty($config['email_password']) === false) { $btn_configure_mail_class = ''; $li_configure_mail_class = 'row_green'; $flag_cm = true; @@ -1136,7 +1136,7 @@ class WelcomeWindow extends Wizard } function configureEmail() { - window.location = ''; + window.location = ''; } function serversUp() { From 2c98ee5628b03ba42ae38bff44a944aa0a085910 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 18 Sep 2023 09:09:52 +0200 Subject: [PATCH 14/70] #12036 Fix duplicate widget --- .../include/javascript/pandora_dashboards.js | 25 ++++++-------- .../include/lib/Dashboard/Manager.php | 34 ++++++++++++++++--- pandora_console/views/dashboard/cell.php | 14 +++++--- 3 files changed, 50 insertions(+), 23 deletions(-) diff --git a/pandora_console/include/javascript/pandora_dashboards.js b/pandora_console/include/javascript/pandora_dashboards.js index 79fde538b4..471adc877a 100644 --- a/pandora_console/include/javascript/pandora_dashboards.js +++ b/pandora_console/include/javascript/pandora_dashboards.js @@ -310,8 +310,6 @@ function initialiceLayout(data) { } function duplicateWidget(original_cellId, original_widgetId) { - let duplicate_cellId = insertCellLayoutForDuplicate(); - $.ajax({ method: "post", url: data.url, @@ -320,16 +318,14 @@ function initialiceLayout(data) { method: "duplicateWidget", dashboardId: data.dashboardId, widgetId: original_widgetId, - cellId: original_cellId, - duplicateCellId: duplicate_cellId + cellId: original_cellId }, dataType: "json", - success: function(success) { - console.log(success); + success: function(data) { + addCell(data.cellId, 0, 0, 4, 4, true, 0, 2000, 0, 2000, 0, true); }, - error: function(error) { - console.log(error); - return []; + error: function(xhr, textStatus, errorMessage) { + console.log("ERROR" + errorMessage + textStatus + xhr); } }); } @@ -428,8 +424,8 @@ function initialiceLayout(data) { } }); } - - function insertCellLayoutForDuplicate() { + /* + function insertCellLayoutForDuplicate(original_cell_id) { let duplicateCellId = 0; $.ajax({ async: false, @@ -441,7 +437,8 @@ function initialiceLayout(data) { dashboardId: data.dashboardId, auth_class: data.auth.class, auth_hash: data.auth.hash, - id_user: data.auth.user + id_user: data.auth.user, + copy: original_cell_id }, dataType: "json", success: function(data) { @@ -449,7 +446,7 @@ function initialiceLayout(data) { // width and height = 4 // position auto = true. if (data.cellId !== 0) { - addCell(data.cellId, 0, 0, 4, 4, true, 0, 2000, 0, 2000, 0, true); + addCell(data.cellId, 0, 0, 4, 4, true, 0, 2000, 0, 2000, 0, true, original_cell_id); duplicateCellId = data.cellId; } }, @@ -458,7 +455,7 @@ function initialiceLayout(data) { } }); return duplicateCellId; - } + }*/ function configurationWidget(cellId, widgetId, size) { load_modal({ diff --git a/pandora_console/include/lib/Dashboard/Manager.php b/pandora_console/include/lib/Dashboard/Manager.php index 40b6d2d1a0..dfcdfe0238 100644 --- a/pandora_console/include/lib/Dashboard/Manager.php +++ b/pandora_console/include/lib/Dashboard/Manager.php @@ -609,10 +609,25 @@ class Manager implements PublicLogin /** * Duplicate widget. * - * @return integer + * @return void */ - public function duplicateWidget():int + public function duplicateWidget():void { + global $config; + + $return = false; + + $position = [ + 'x' => 0, + 'y' => 0, + 'width' => 4, + 'height' => 4, + ]; + + $cellClass = new Cell($position, $this->dashboardId); + $dataCell = $cellClass->get(); + + // $result = ['cellId' => $dataCell['id']]; $original_widget = []; $original_cellId = $this->cellId; @@ -632,12 +647,23 @@ class Manager implements PublicLogin 'options' => $options_json, 'id_widget' => $original_widget['id_widget'], ]; + $res = \db_process_sql_update( 'twidget_dashboard', $values, - ['id' => $this->duplicateCellId] + ['id' => $dataCell['id']] ); - return $res; + + if ($res === 1) { + $return = [ + 'cellId' => $dataCell['id'], + 'widgetId' => $original_widget['id_widget'], + ]; + + $json_return = json_encode($return); + } + + echo $json_return; } diff --git a/pandora_console/views/dashboard/cell.php b/pandora_console/views/dashboard/cell.php index 919ce9e07e..7816f79351 100644 --- a/pandora_console/views/dashboard/cell.php +++ b/pandora_console/views/dashboard/cell.php @@ -34,9 +34,8 @@ if ($redraw === false) { $output .= '
'; $output .= '
'; - -if ((int) $cellData['id_widget'] !== 0) { - $options = json_decode($cellData['options'], true); +$options = json_decode($cellData['options'], true); +if ($cellData['id_widget'] !== '0') { $output .= $options['title']; } else { $output .= __('New widget'); @@ -44,10 +43,15 @@ if ((int) $cellData['id_widget'] !== 0) { $output .= '
'; $output .= '
'; - if ($manageDashboards !== 0 || $writeDashboards !== 0) { if ((int) $cellData['id_widget'] !== 0) { - $output .= ''; + $count_options = count(json_decode($cellData['options'], true)); + $invisible = ''; + if ($count_options <= 2 && $options['copy'] == 0) { + $invisible = 'invisible'; + } + + $output .= ''; $output .= html_print_image( 'images/copy.svg', true, From f2f17de6433de51bee29a80401c7f73544de14b2 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 18 Sep 2023 16:33:47 +0200 Subject: [PATCH 15/70] #12023 Fix write access group in reports --- .../godmode/reporting/reporting_builder.main.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.main.php b/pandora_console/godmode/reporting/reporting_builder.main.php index c0381acca2..d4914d2b58 100755 --- a/pandora_console/godmode/reporting/reporting_builder.main.php +++ b/pandora_console/godmode/reporting/reporting_builder.main.php @@ -180,8 +180,8 @@ if ($report_id_user == $config['id_user'] $options['div_class'] = ''; } - $table->data[2][1] = html_print_label_input_block( - __('Group'), + $table->data[3][0] = html_print_label_input_block( + __('Write Access Group'), html_print_select_groups( false, 'RW', @@ -216,7 +216,7 @@ if ($enterpriseEnable) { if (enterprise_installed() === true) { - $table->data[3][0] = html_print_label_input_block( + $table->data[4][0] = html_print_label_input_block( __('Generate cover page in PDF render'), html_print_checkbox_switch( 'cover_page_render', @@ -226,7 +226,7 @@ if (enterprise_installed() === true) { ) ); - $table->data[3][1] = html_print_label_input_block( + $table->data[4][1] = html_print_label_input_block( __('Generate index in PDF render'), html_print_checkbox_switch( 'index_render', From 98bdee70373bd6ac1d331ce8f5140b413463d2b0 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 21 Sep 2023 09:24:35 +0200 Subject: [PATCH 16/70] #12079 Apply the filter automatic --- pandora_console/operation/agentes/alerts_status.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 176ac6bce8..7cdd41ec77 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -509,6 +509,9 @@ if ($agent_view_page === true) { echo $html_content; } +// Filter control. +echo ''; + // Strict user hidden. echo '