From d769917dfc025fbc003eb5d2027a2ac19cca227d Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 15 Apr 2024 14:19:46 +0200 Subject: [PATCH 01/53] 13389-Add references in reports headers --- pandora_console/include/functions_reporting_html.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 4869343a84..03c920f577 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -112,8 +112,8 @@ function reporting_html_header( } $data[] = $title.$sizhfin; - $data[] = $sizh.$subtitle.$sizhfin; - $data[] = "
".$sizh.$date_text.$sizhfin.'
'; + $data[] = $sizh.__('Group').': '.$subtitle.$sizhfin; + $data[] = '
'.$sizh.__('Data time').': '.$sizhfin."
".$sizh.$date_text.$sizhfin.'
'; } array_push($table->data, $data); @@ -194,6 +194,9 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust $table->head = []; $table->colspan = []; $table->rowstyle = ['background-color: #686868']; + $table->size[0] = '33%'; + $table->size[1] = '33%'; + $table->size[2] = '33%'; if (isset($item['label']) && $item['label'] != '') { $id_agent = $item['id_agent']; From e3c842b36cc761c95a4fd1217236973605ef0d1a Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 18 Apr 2024 12:41:17 +0200 Subject: [PATCH 02/53] #13453 Fixed dark theme styles in Netflow Widgets --- pandora_console/include/functions_netflow.php | 14 +++++++++++--- .../include/lib/Dashboard/Widgets/netflow.php | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index e4d76387bc..3a87ea8be7 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -1389,6 +1389,7 @@ function netflow_draw_item( $show_summary=true, $show_table=true ) { + global $config; $aggregate = $filter['aggregate']; $interval = ($end_date - $start_date); if (is_metaconsole() === true) { @@ -1568,13 +1569,20 @@ function netflow_draw_item( $data_top_n ); + // Theme. + $theme = $config['style']; + $text_color = ($theme !== 'pandora_black') ? '#333' : '#fff'; + $graph_output = pie_graph( $pie_data, [ 'width' => 200, 'height' => 200, 'ttl' => ($output === 'PDF') ? 2 : 1, - 'dataLabel' => ['display' => 'auto'], + 'dataLabel' => [ + 'display' => 'auto', + 'color' => $text_color, + ], 'layout' => [ 'padding' => [ 'top' => 15, @@ -1650,8 +1658,8 @@ function netflow_draw_item( netflow_aggregate_is_ip($aggregate) ); - $data_circular['width'] = $width_content; - $data_circular['height'] = $height_content; + $data_circular['width'] = 390; + $data_circular['height'] = 390; $html = '
'; $html .= graph_netflow_circular_mesh($data_circular); diff --git a/pandora_console/include/lib/Dashboard/Widgets/netflow.php b/pandora_console/include/lib/Dashboard/Widgets/netflow.php index 6c0aa76eca..dccf1cffda 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/netflow.php +++ b/pandora_console/include/lib/Dashboard/Widgets/netflow.php @@ -462,7 +462,7 @@ class Netflow extends Widget public function getSizeModalConfiguration(): array { $size = [ - 'width' => 400, + 'width' => 600, 'height' => 530, ]; From 0e97e8dc2b8e7fe022ca34ddad06711f19e5d8ed Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 18 Apr 2024 20:12:01 +0200 Subject: [PATCH 03/53] Fix master detection for multiprocess mode. --- pandora_server/lib/PandoraFMS/Core.pm | 17 +++++++++++++++-- .../lib/PandoraFMS/DiscoveryServer.pm | 2 +- .../lib/PandoraFMS/InventoryServer.pm | 2 +- pandora_server/lib/PandoraFMS/NetworkServer.pm | 2 +- pandora_server/lib/PandoraFMS/PluginServer.pm | 2 +- .../lib/PandoraFMS/PredictionServer.pm | 2 +- pandora_server/lib/PandoraFMS/WMIServer.pm | 2 +- pandora_server/lib/PandoraFMS/WebServer.pm | 2 +- 8 files changed, 22 insertions(+), 9 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 1f78ab8079..7817a40167 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -7010,8 +7010,21 @@ Returns 1 if this server is the current master, 0 otherwise. =cut ########################################################################## -sub pandora_is_master ($) { - my ($pa_config) = @_; +sub pandora_is_master ($;$) { + my ($pa_config, $dbh) = @_; + + # When multiprocess is enabled the variable $Master is not shared between + # servers. + if (defined($dbh) && $pa_config->{'multiprocess'} == 1) { + my $current_master = get_db_value_limit ($dbh, 'SELECT name FROM tserver + WHERE master <> 0 AND status = 1 + ORDER BY master DESC', 1); + if (defined($current_master) && $current_master eq $pa_config->{'servername'}) { + return 1; + } + + return 0; + } if ($Master eq $pa_config->{'servername'}) { return 1; diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index 3dc3d44f17..cc9b8fe963 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -143,7 +143,7 @@ sub data_producer ($) { # By default, after create a tasks it takes the utimestamp to 0 # Status -1 means "done". my @rows; - if (pandora_is_master($pa_config) == 0) { + if (pandora_is_master($pa_config, $dbh) == 0) { @rows = get_db_rows ($dbh, 'SELECT * FROM trecon_task WHERE id_recon_server = ? AND disabled = 0 diff --git a/pandora_server/lib/PandoraFMS/InventoryServer.pm b/pandora_server/lib/PandoraFMS/InventoryServer.pm index e6b070f4d8..daab7f624f 100644 --- a/pandora_server/lib/PandoraFMS/InventoryServer.pm +++ b/pandora_server/lib/PandoraFMS/InventoryServer.pm @@ -83,7 +83,7 @@ sub data_producer ($) { my @tasks; my @rows; - if (pandora_is_master($pa_config) == 0) { + if (pandora_is_master($pa_config, $dbh) == 0) { if ($pa_config->{'dbengine'} ne 'oracle') { @rows = get_db_rows ($dbh, 'SELECT tagent_module_inventory.id_agent_module_inventory, tagent_module_inventory.flag, tagent_module_inventory.timestamp diff --git a/pandora_server/lib/PandoraFMS/NetworkServer.pm b/pandora_server/lib/PandoraFMS/NetworkServer.pm index 87ef0fe2c7..6d0b848fb1 100644 --- a/pandora_server/lib/PandoraFMS/NetworkServer.pm +++ b/pandora_server/lib/PandoraFMS/NetworkServer.pm @@ -96,7 +96,7 @@ sub data_producer ($) { my @rows; my $network_filter = enterprise_hook ('get_network_filter', [$pa_config]); - if (pandora_is_master($pa_config) == 0) { + if (pandora_is_master($pa_config, $dbh) == 0) { @rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try FROM tagente, tagente_modulo, tagente_estado WHERE server_name = ? diff --git a/pandora_server/lib/PandoraFMS/PluginServer.pm b/pandora_server/lib/PandoraFMS/PluginServer.pm index 9751372d04..a8cbd159b5 100644 --- a/pandora_server/lib/PandoraFMS/PluginServer.pm +++ b/pandora_server/lib/PandoraFMS/PluginServer.pm @@ -96,7 +96,7 @@ sub data_producer ($) { my @tasks; my @rows; - if (pandora_is_master($pa_config) == 0) { + if (pandora_is_master($pa_config, $dbh) == 0) { @rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try FROM tagente, tagente_modulo, tagente_estado WHERE server_name = ? diff --git a/pandora_server/lib/PandoraFMS/PredictionServer.pm b/pandora_server/lib/PandoraFMS/PredictionServer.pm index 282a8eeb20..dfa70f38db 100644 --- a/pandora_server/lib/PandoraFMS/PredictionServer.pm +++ b/pandora_server/lib/PandoraFMS/PredictionServer.pm @@ -93,7 +93,7 @@ sub data_producer ($) { my @tasks; my @rows; - if (pandora_is_master($pa_config) == 0) { + if (pandora_is_master($pa_config, $dbh) == 0) { @rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, last_execution_try FROM tagente, tagente_modulo, tagente_estado diff --git a/pandora_server/lib/PandoraFMS/WMIServer.pm b/pandora_server/lib/PandoraFMS/WMIServer.pm index 2b053c7ce0..2a01cf89dd 100644 --- a/pandora_server/lib/PandoraFMS/WMIServer.pm +++ b/pandora_server/lib/PandoraFMS/WMIServer.pm @@ -94,7 +94,7 @@ sub data_producer ($) { my @tasks; my @rows; - if (pandora_is_master($pa_config) == 0) { + if (pandora_is_master($pa_config, $dbh) == 0) { @rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try FROM tagente, tagente_modulo, tagente_estado WHERE server_name = ? diff --git a/pandora_server/lib/PandoraFMS/WebServer.pm b/pandora_server/lib/PandoraFMS/WebServer.pm index 7f66d8ad89..40b4af3073 100644 --- a/pandora_server/lib/PandoraFMS/WebServer.pm +++ b/pandora_server/lib/PandoraFMS/WebServer.pm @@ -124,7 +124,7 @@ sub data_producer ($) { my @tasks; my @rows; - if (pandora_is_master($pa_config) == 0) { + if (pandora_is_master($pa_config, $dbh) == 0) { @rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try FROM tagente, tagente_modulo, tagente_estado WHERE server_name = ? From d7c879862dc2c19fdf3757710549373948b33715 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Fri, 19 Apr 2024 09:49:32 +0200 Subject: [PATCH 04/53] 9940-Fix translation VC module deleted --- pandora_console/include/rest-api/models/VisualConsole/View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/rest-api/models/VisualConsole/View.php b/pandora_console/include/rest-api/models/VisualConsole/View.php index e2e28f419a..8f912a5375 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/View.php +++ b/pandora_console/include/rest-api/models/VisualConsole/View.php @@ -139,7 +139,7 @@ class View extends \HTML }); ui.jqXHR.fail(function () { ui.panel.html( - "Couldn\'t load Data. Plz Reload Page or Try Again Later." + "'.__('The data could not be loaded. Please reload the page or try again later.').'" ); }); }, From e1841ba04cf24024701f9c2dbb1fc300f8f55247 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 22 Apr 2024 09:50:46 +0200 Subject: [PATCH 05/53] #13178 Fixed Discovery app download modal styling --- .../include/class/ExtensionsDiscovery.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/class/ExtensionsDiscovery.class.php b/pandora_console/include/class/ExtensionsDiscovery.class.php index 9c9affaf77..c38fc95b06 100644 --- a/pandora_console/include/class/ExtensionsDiscovery.class.php +++ b/pandora_console/include/class/ExtensionsDiscovery.class.php @@ -234,18 +234,18 @@ class ExtensionsDiscovery extends Wizard url_str = `'.__('here').'`; } - var markup = "
    "; + var markup = "
      "; if (msgs_json.includes('.NOT_FOUND_MSG.')) { - markup += "
    •    '.__('The required files for the application were not found.').'
    • "; + markup += \'
    •    '.__('The required files for the application were not found.').'
    • \'; } if (msgs_json.includes('.ENTERPRISE_MSG.')) { - markup += "
    •    '.__('This discovery application is for Enterprise customers only.').'
    • "; + markup += \'
    •    '.__('This discovery application is for Enterprise customers only.').'
    • \'; } if (msgs_json.includes('.URL_MSG.')) { - markup += \'
    •    '.__('You can download this application from').' \'+url_str+\'.
    • \'; + markup += \'
    •    '.__('You can download this application from').' \'+url_str+\'.
    • \'; } markup += "
    "; From a75af90a6ea2824937e187822c7faa7a93ea118b Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 22 Apr 2024 15:31:37 +0200 Subject: [PATCH 06/53] 13616-Fix text color chartjs with dark theme --- pandora_console/include/graphs/fgraph.php | 5 +++ .../include/styles/pandora_black.css | 4 +++ .../vendor/artica/phpchartjs/src/Options.php | 33 ++++++++++++++++++- .../phpchartjs/src/Renderer/JavaScript.php | 32 +++++++++++++++--- 4 files changed, 69 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 0d872bc8ee..b7593b592c 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -547,6 +547,7 @@ function line_graph( function get_build_setup_charts($type, $options, $data) { global $config; + $user_info = get_user_info($config['id_user']); $factory = new Factory(); @@ -1294,6 +1295,10 @@ function get_build_setup_charts($type, $options, $data) } } + if (isset($user_info['id_skin']) === true) { + $chart->options()->setTheme($user_info['id_skin']); + } + // Add Datasets. $setData = $chart->createDataSet(); switch ($type) { diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index b1b404ae16..dde4085937 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -2094,3 +2094,7 @@ select option:checked { #horizontalBar > .labels > .label > div[style^="background"] { filter: invert(1); } + +.color_666 { + color: var(--text-color); +} diff --git a/pandora_console/vendor/artica/phpchartjs/src/Options.php b/pandora_console/vendor/artica/phpchartjs/src/Options.php index b1b5c91ad3..eecd8fa935 100644 --- a/pandora_console/vendor/artica/phpchartjs/src/Options.php +++ b/pandora_console/vendor/artica/phpchartjs/src/Options.php @@ -92,6 +92,11 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe */ protected $indexAxis; + /** + * @var string + */ + protected $theme; + /** * @return Layout @@ -194,7 +199,7 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe /** - * @return bool + * @return boolean */ public function disableAnimation() { @@ -323,6 +328,32 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe } + /** + * Get font color. + * + * @return string + */ + public function getTheme() + { + return $this->theme; + } + + + /** + * Set font color. + * + * @param string $Theme Global font color. + * + * @return $this + */ + public function setTheme($theme) + { + $this->theme = $theme; + + return $this; + } + + /** * @return array */ diff --git a/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php b/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php index 3a0144bd9a..6b4848cb00 100644 --- a/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php +++ b/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php @@ -30,7 +30,7 @@ class JavaScript extends Renderer // Watermark. if (empty($this->chart->defaults()->getWatermark()) === false) { - $script[] = 'const chart_watermark_'.$this->chart->getId().' = { + $script[] = 'const chart_watermark_'.$this->chart->getId().' = { id: "chart_watermark_'.$this->chart->getId().'", beforeDraw: (chart) => { if (Object.prototype.hasOwnProperty.call(chart, "config") && @@ -128,11 +128,9 @@ class JavaScript extends Renderer } } };'; - $script[] = 'Chart.register(chart_watermark_'.$this->chart->getId().');'; + $script[] = 'Chart.register(chart_watermark_'.$this->chart->getId().');'; } - - // Create chart. $script[] = 'try {'; $script[] = " var chart = new Chart( ctx, {$json} );"; @@ -143,6 +141,32 @@ class JavaScript extends Renderer $script[] = ' Chart.defaults.font.style = "'.($this->chart->defaults()->getFonts()->getStyle() ?? 'normal').'";'; $script[] = ' Chart.defaults.font.weight = "'.($this->chart->defaults()->getFonts()->getWeight() ?? '').'";'; + if ($this->chart->options()->getTheme() !== null) { + if ((int) $this->chart->options()->getTheme() === 2) { + $script[] = ' Chart.defaults.color = "#ffffff";'; + + $script[] = ' + if (chart.config.options.scales !== undefined + && chart.config.options.scales.x !== undefined + && chart.config.options.scales.x.ticks !== undefined + ) { + chart.config.options.scales.x.ticks.color = "#ffffff"; + } + + if (chart.config.options.scales !== undefined && + chart.config.options.scales.y !== undefined && + chart.config.options.scales.y.ticks !== undefined + ) { + chart.config.options.scales.y.ticks.color = "#ffffff"; + } + + if (chart.config.options.title !== undefined ) { + chart.config.options.title.fontColor = "#ffffff"; + } + '; + } + } + $script[] = '} catch (error) {'; $script[] = ' console.error(error);'; $script[] = '}'; From f26499152dae192fa93f5eec149d0049012bd94d Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 22 Apr 2024 15:39:36 +0200 Subject: [PATCH 07/53] #13552 Fixed time --- pandora_console/operation/reporting/reporting_viewer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index 011dc1c82f..81a4c19cfc 100755 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -94,6 +94,9 @@ if (empty($schedule_report) === false) { echo '
    '; } +if (empty($time) === true) { + $time = date(TIME_FORMAT); +} // ------------------- INIT HEADER -------------------------------------- $url = "index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=$id_report&date=$date&time=$time&pure=$pure"; From 215bddd8ced8c12a0c1fdb719c6273b43897c42a Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Tue, 23 Apr 2024 07:52:52 +0200 Subject: [PATCH 08/53] 13389-Fix chart Groups report in pdf --- pandora_console/include/functions_reporting_html.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 67415900b5..e240c8d047 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -3609,7 +3609,7 @@ function reporting_html_group_report($table, $item, $pdf=0) } $graph_width = 280; - $graph_height = 250; + $graph_height = 300; $out = ''; $out .= ''; @@ -3691,7 +3691,7 @@ function reporting_html_group_report($table, $item, $pdf=0) $out .= '
    '; if ((int) $ttl === 2) { - $out .= ''; } @@ -3733,7 +3733,7 @@ function reporting_html_group_report($table, $item, $pdf=0) $out .= '
    '; if ((int) $ttl === 2) { - $out .= ''; } From 9a4f2aa7c94b7a762ceae752d5659bf72b5d83e3 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Tue, 23 Apr 2024 08:29:08 +0200 Subject: [PATCH 09/53] 13287-Remove columns Options and Checkbox in Events for users without EW. Fix no_sorteable_columns in Events --- pandora_console/operation/events/events.php | 32 +++++++++++---------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 7c5f1b1210..bcc944fa9b 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -2666,20 +2666,22 @@ try { // Always add options column. - $fields = array_merge( - $fields, - [ + if ((bool) check_acl($config['id_user'], 0, 'EW') === true) { + $fields = array_merge( + $fields, [ - 'text' => 'options', - 'class' => 'table_action_buttons mw100px', - ], - [ - 'text' => 'm', - 'extra' => $checkbox_all, - 'class' => 'w20px no-text-imp', - ], - ] - ); + [ + 'text' => 'options', + 'class' => 'table_action_buttons mw100px', + ], + [ + 'text' => 'm', + 'extra' => $checkbox_all, + 'class' => 'w20px no-text-imp', + ], + ] + ); + } // Get column names. $column_names = events_get_column_names($fields, true); @@ -2890,8 +2892,8 @@ try { 'column_names' => $column_names, 'columns' => $fields, 'no_sortable_columns' => [ - -1, - -2, + 'options', + 'm', 'column-instructions', 'user_comment', ], From d10c4bfab2e54dcc5e92735f6d664071229cbcdc Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Tue, 23 Apr 2024 09:58:52 +0200 Subject: [PATCH 10/53] 13356-Fix vertical bar percentage label in pdf --- pandora_console/include/functions_graph.php | 7 ++++++- pandora_console/include/functions_reporting.php | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 83f47e00b9..b08267d2bf 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -3308,7 +3308,8 @@ function graph_custom_sql_graph( $only_image=false, $homeurl='', $ttl=1, - $max_num_elements=8 + $max_num_elements=8, + $layout=false ) { global $config; @@ -3509,6 +3510,10 @@ function graph_custom_sql_graph( if ((int) $ttl === 2) { $options['dataLabel'] = ['display' => 'auto']; + + if ($layout !== false && is_array($layout) === true) { + $options['layout'] = $layout; + } } $output .= vbar_graph( diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 71ac93dc19..476ba918ee 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -6686,6 +6686,7 @@ function reporting_sql_graph( $type_sql_graph ) { global $config; + $layout = false; switch ($type_sql_graph) { case 'sql_graph_hbar': @@ -6694,6 +6695,7 @@ function reporting_sql_graph( break; case 'sql_graph_vbar': + $layout = ['padding' => ['top' => '40']]; $return['type'] = 'sql_graph_vbar'; break; @@ -6768,7 +6770,8 @@ function reporting_sql_graph( $only_image, ui_get_full_url(false, false, false, false), $ttl, - $content['top_n_value'] + $content['top_n_value'], + $layout ); break; From d439aee1fd6f079d1e4627856ff1da8786666053 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 23 Apr 2024 09:59:43 +0200 Subject: [PATCH 11/53] #13554 profile aw servers and satellite --- pandora_console/godmode/menu.php | 9 +++++++++ pandora_console/godmode/servers/modificar_server.php | 2 +- pandora_console/godmode/servers/servers.build_table.php | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 3440719a89..742976c57a 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -473,6 +473,15 @@ if ($access_console_node === true) { enterprise_hook('translate_string_submenu'); $menu_godmode['gsetup']['sub'] = $sub; + } else if ((bool) check_acl($config['id_user'], 0, 'AW') === true) { + $menu_godmode['gservers']['text'] = __('Servers'); + $menu_godmode['gservers']['sec2'] = 'godmode/servers/modificar_server'; + $menu_godmode['gservers']['id'] = 'god-servers'; + $sub = []; + $sub['godmode/servers/modificar_server']['text'] = __('Manage servers'); + $sub['godmode/servers/modificar_server']['id'] = 'Manage_servers'; + enterprise_hook('manage_satellite_submenu'); + $menu_godmode['gservers']['sub'] = $sub; } } diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index 1c3e90c84e..e4c5d7aa09 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -34,7 +34,7 @@ require_once $config['homedir'].'/include/functions_graph.php'; check_login(); -if (! check_acl($config['id_user'], 0, 'PM')) { +if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( AUDIT_LOG_ACL_VIOLATION, 'Trying to access Server Management' diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index bbd77f7b14..1ce497131f 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -28,7 +28,9 @@ // Begin. require_once 'include/functions_clippy.php'; -require_once 'pending_alerts_list.php'; +if ((bool) check_acl($config['id_user'], 0, 'LM') === true) { + include 'pending_alerts_list.php'; +} global $config; From 6d453081111881db72be09cf615a2e04458f12df Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 23 Apr 2024 10:18:03 +0200 Subject: [PATCH 12/53] #13557 fixed dark style for NCM type item report - Configuration Changes --- pandora_console/include/functions_reporting_html.php | 12 +++++++++--- pandora_console/include/styles/pandora_black.css | 6 ++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index fc44b65910..a329517c30 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -4104,7 +4104,7 @@ function reporting_html_historical_data($table, $item, $pdf=0) // Center every row foreach ($table1->data[0] as $k => $v) { - for ($i = 0; $i < count($table1->data); $i++){ + for ($i = 0; $i < count($table1->data); $i++) { $table1->cellstyle[$i][$k] = 'text-align: center;'; } } @@ -4187,7 +4187,7 @@ function reporting_html_database_serialized($table, $item, $pdf=0) // Center every row foreach ($table1->data[0] as $k => $v) { - for ($i = 0; $i < count($table1->data); $i++){ + for ($i = 0; $i < count($table1->data); $i++) { $table1->cellstyle[$i][$k] = 'text-align: center;'; } } @@ -6432,7 +6432,7 @@ function reporting_html_sql($table, $item, $pdf=0) // Center every row foreach ($table2->data[0] as $k => $v) { - for ($i = 0; $i < count($table2->data); $i++){ + for ($i = 0; $i < count($table2->data); $i++) { $table2->cellstyle[$i][$k] = 'text-align: center;'; } } @@ -7883,6 +7883,12 @@ function reporting_html_ncm_list($table, $item, $pdf=0) */ function reporting_html_ncm_backups($table, $item, $pdf=0) { + global $config; + + if ($config['style'] === 'pandora_black') { + ui_require_css_file('pandora_black'); + } + ui_require_css_file('diff2html.min'); ui_require_css_file('highlight.min'); ui_require_css_file('highlight/vs.min'); diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index b1b404ae16..4dc5cff8f5 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -2094,3 +2094,9 @@ select option:checked { #horizontalBar > .labels > .label > div[style^="background"] { filter: invert(1); } + +.d2h-file-list-header, +.d2h-file-name-wrapper, +.d2h-file-collapse { + color: #333 !important; +} From 0c2209713a80fa2c80cd0e32cfc2d2237c6ebc37 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 23 Apr 2024 12:00:49 +0200 Subject: [PATCH 13/53] #13453 Fixed the size of the type graph as a parameter so as not to affect the function --- pandora_console/include/functions_netflow.php | 4 ++-- pandora_console/include/lib/Dashboard/Widgets/netflow.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index 3a87ea8be7..9f016ac88a 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -1658,8 +1658,8 @@ function netflow_draw_item( netflow_aggregate_is_ip($aggregate) ); - $data_circular['width'] = 390; - $data_circular['height'] = 390; + $data_circular['width'] = $width_content; + $data_circular['height'] = $height_content; $html = '
    '; $html .= graph_netflow_circular_mesh($data_circular); diff --git a/pandora_console/include/lib/Dashboard/Widgets/netflow.php b/pandora_console/include/lib/Dashboard/Widgets/netflow.php index dccf1cffda..f1c2123782 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/netflow.php +++ b/pandora_console/include/lib/Dashboard/Widgets/netflow.php @@ -366,8 +366,8 @@ class Netflow extends Widget '', 'HTML', 0, - ($size['width'] - 50), - ($size['height'] - 20), + ($size['width'] + 120), + ($size['height'] + 120), ), ], true From 18974ff4a9132074aea42aa63885e8e73cd5945e Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 23 Apr 2024 12:00:59 +0200 Subject: [PATCH 14/53] #13288 Fixed refresh --- .../operation/agentes/pandora_networkmap.view.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pandora_console/operation/agentes/pandora_networkmap.view.php b/pandora_console/operation/agentes/pandora_networkmap.view.php index e417f345fc..97c4f3918a 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.view.php +++ b/pandora_console/operation/agentes/pandora_networkmap.view.php @@ -1026,11 +1026,18 @@ if (is_ajax() === true) { return; } - $data = networkmap_refresh_holding_area($networkmap_id, $x, $y); + $filter = db_get_value('filter', 'tmap', 'id', $networkmap_id); + $filter = json_decode($filter, true); - if (!empty($data)) { - $return['correct'] = true; - $return['holding_area'] = $data; + if (isset($filter['empty_map']) === false + || (isset($filter['empty_map']) === true && $filter['empty_map'] !== 1) + ) { + $data = networkmap_refresh_holding_area($networkmap_id, $x, $y); + + if (!empty($data)) { + $return['correct'] = true; + $return['holding_area'] = $data; + } } ob_end_clean(); From ca70d5fdeb155b6379495d42af2dc6a764211d62 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Tue, 23 Apr 2024 13:56:56 +0200 Subject: [PATCH 15/53] 13608-Change interval selector to select2 WIP --- pandora_console/include/functions_html.php | 35 ++++++++++++++++--- .../lib/Dashboard/Widgets/BlockHistogram.php | 1 + pandora_console/include/styles/dashboards.css | 4 +++ pandora_console/include/styles/pandora.css | 4 +++ 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 6a92a99016..f9f21aaec5 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2505,7 +2505,8 @@ function html_print_extended_select_for_time( $no_change=false, $allow_zero=0, $units=null, - $script_input='' + $script_input='', + $units_select2=false ) { global $config; $admin = is_user_admin($config['id_user']); @@ -2595,7 +2596,19 @@ function html_print_extended_select_for_time( echo '
    '; echo '
    '; - html_print_input_text($uniq_name.'_text', $selected, '', $size, 255, false, $readonly, false, '', $class, $script_input); + html_print_input_text( + $uniq_name.'_text', + $selected, + '', + $size, + 255, + false, + $readonly, + false, + '', + $class.(($units_select2 === true) ? ' w100p' : ''), + $script_input + ); html_print_input_hidden($name, $selected, false, $uniq_name); html_print_select( @@ -2619,7 +2632,7 @@ function html_print_extended_select_for_time( false, false, false, - false + $units_select2 ); echo '  '.html_print_image( 'images/logs@svg.svg', @@ -2632,6 +2645,7 @@ function html_print_extended_select_for_time( ] ).''; echo '
    '; + echo ""; + + if ($units_select2 === true) { + echo ' + + '; + } + $returnString = ob_get_clean(); if ($return) { @@ -6335,7 +6361,8 @@ function html_print_input($data, $wrapper='div', $input_only=false) ((isset($data['no_change']) === true) ? $data['no_change'] : ''), ((isset($data['allow_zero']) === true) ? $data['allow_zero'] : ''), ((isset($data['units']) === true) ? $data['units'] : null), - ((isset($data['script_input']) === true) ? $data['script_input'] : '') + ((isset($data['script_input']) === true) ? $data['script_input'] : ''), + ((isset($data['units_select2']) === true) ? $data['units_select2'] : '') ); break; diff --git a/pandora_console/include/lib/Dashboard/Widgets/BlockHistogram.php b/pandora_console/include/lib/Dashboard/Widgets/BlockHistogram.php index 1484823518..1fceb77c3f 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/BlockHistogram.php +++ b/pandora_console/include/lib/Dashboard/Widgets/BlockHistogram.php @@ -306,6 +306,7 @@ class BlockHistogram extends Widget 'style_icon' => 'flex-grow: 0', 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', 'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'units_select2' => true, ], ]; diff --git a/pandora_console/include/styles/dashboards.css b/pandora_console/include/styles/dashboards.css index e94ce8f1d0..8a4f042b80 100644 --- a/pandora_console/include/styles/dashboards.css +++ b/pandora_console/include/styles/dashboards.css @@ -1017,3 +1017,7 @@ ul.select2-selection__rendered > li.select2-selection__choice { .select2-results__option { line-break: anywhere; } + +#period_manual > input[type="text"] { + box-sizing: border-box !important; +} diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index c28d3cc010..366c347cdd 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -7273,6 +7273,10 @@ div.graph div.legend table { margin-left: 10px; } +.mrgn_lft_10px_imp { + margin-left: 10px !important; +} + .mrgn_lft_15px { margin-left: 15px; } From 64013c04161f75c488a47b63ee67ce36b3643c68 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 23 Apr 2024 16:56:28 +0200 Subject: [PATCH 16/53] #13264 added regex in sql --- pandora_console/include/functions_events.php | 46 +++++++++++++------- pandora_console/operation/events/events.php | 31 +++---------- 2 files changed, 36 insertions(+), 41 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 6e6068f386..6e3d2e1f01 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1155,7 +1155,7 @@ function events_get_all( } // Free search. - if (empty($filter['search']) === false && (bool) $filter['regex'] === false) { + if (empty($filter['search']) === false) { if (isset($config['dbconnection']->server_version) === true && $config['dbconnection']->server_version > 50600 ) { @@ -1185,23 +1185,39 @@ function events_get_all( $array_search[] = 'lower(ta.alias)'; } - // Disregard repeated whitespaces when searching. - $collapsed_spaces_search = preg_replace('/( )+/', ' ', $filter['search']); + if ((bool) $filter['regex'] === true) { + $sql_search = ' AND ('; + foreach ($array_search as $key => $field) { + $sql_search .= sprintf( + '%s %s %s REGEXP "%s" ', + ($key === 0) ? '' : $nexo, + $field, + $not_search, + io_safe_output($filter['search']) + ); + $sql_search .= ' '; + } - $sql_search = ' AND ('; - foreach ($array_search as $key => $field) { - $sql_search .= sprintf( - '%s LOWER(REGEXP_REPLACE(%s, "( )+", " ")) %s like LOWER("%%%s%%")', - ($key === 0) ? '' : $nexo, - $field, - $not_search, - $collapsed_spaces_search - ); - $sql_search .= ' '; + $sql_search .= ' )'; + } else { + // Disregard repeated whitespaces when searching. + $collapsed_spaces_search = preg_replace('/( )+/', ' ', $filter['search']); + + $sql_search = ' AND ('; + foreach ($array_search as $key => $field) { + $sql_search .= sprintf( + '%s LOWER(REGEXP_REPLACE(%s, "( )+", " ")) %s like LOWER("%%%s%%")', + ($key === 0) ? '' : $nexo, + $field, + $not_search, + $collapsed_spaces_search + ); + $sql_search .= ' '; + } + + $sql_search .= ' )'; } - $sql_search .= ' )'; - $sql_filters[] = $sql_search; } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 7c5f1b1210..22f4908b07 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1249,27 +1249,7 @@ if (is_ajax() === true) { } } - $regex_validation = false; - if (empty($tmp) === false && $regex !== '') { - foreach (json_decode(json_encode($tmp), true) as $key => $field) { - if ($key === 'b64') { - continue; - } - - $field = strip_tags($field); - - if (preg_match('/'.io_safe_output($regex).'/', $field)) { - $regex_validation = true; - } - } - - if ($regex_validation === true) { - $carry[] = $tmp; - } - } else { - $carry[] = $tmp; - } - + $carry[] = $tmp; return $carry; } ); @@ -1289,11 +1269,10 @@ if (is_ajax() === true) { // RecordsTotal && recordsfiltered resultados totales. echo json_encode( [ - 'data' => ($data ?? []), - 'buffers' => $buffers, - 'recordsTotal' => $count, - 'recordsFiltered' => $count, - 'showAlwaysPagination' => (empty($regex) === false) ? true : false, + 'data' => ($data ?? []), + 'buffers' => $buffers, + 'recordsTotal' => $count, + 'recordsFiltered' => $count, ] ); } catch (Exception $e) { From 6d33c36cb08d952d22fc18fda31b62a955852b7e Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 23 Apr 2024 17:01:47 +0200 Subject: [PATCH 17/53] #13264 fixed sql injection --- pandora_console/include/functions_events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 6e3d2e1f01..54fdbec4bf 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1193,7 +1193,7 @@ function events_get_all( ($key === 0) ? '' : $nexo, $field, $not_search, - io_safe_output($filter['search']) + str_replace('"', '', io_safe_output($filter['search'])), ); $sql_search .= ' '; } From cacd05d667691c18da48443ff2300f95784632a9 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 23 Apr 2024 17:12:36 +0200 Subject: [PATCH 18/53] #13223 Fixed instructions dialog in events --- pandora_console/include/functions_events.php | 26 ++++++++++++++++++-- pandora_console/operation/events/events.php | 11 ++++++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 6e6068f386..823a46f35f 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -5888,6 +5888,12 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['unknown_instructions']) ); } + + $event_name = str_replace( + "'", + '', + io_safe_output($event['evento']) + ); break; case 'going_up_warning': @@ -5899,6 +5905,12 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['warning_instructions']) ); } + + $event_name = str_replace( + "'", + '', + io_safe_output($event['evento']) + ); break; case 'going_up_critical': @@ -5910,6 +5922,12 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['critical_instructions']) ); } + + $event_name = str_replace( + "'", + '', + io_safe_output($event['evento']) + ); break; default: @@ -5928,17 +5946,21 @@ function events_get_instructions($event, $max_text_length=300) return $value; } + $over_event_name = ui_print_truncate_text($event_name, 51, false, true, false); $output = '
    '; $output .= ''; - $output .= ''; + $output .= ''; $output .= html_print_image( 'images/default_list.png', true, - ['title' => $over_text] + [ + 'title' => $over_text, + 'class' => 'invert_filter', + ] ).''; return $output; diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 7c5f1b1210..f5da6c3020 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -3715,11 +3715,16 @@ function datetime_picker_callback() { datetime_picker_callback(); -function show_instructions(id){ +function show_instructions(id, title_event){ title = ""; $('#hidden_event_instructions_' + id).dialog({ - title: title, - width: 600 + title: `${title+' '+title_event}`, + width: 650, + draggable: false, + }); + + $(document).on('click','div', function(){ + $('#hidden_event_instructions_' + id).dialog('close'); }); } From d41e3d44a94002c4ebf9094df0a625f2bb384d11 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 23 Apr 2024 17:15:30 +0200 Subject: [PATCH 19/53] #13264 fixed injection " --- pandora_console/include/functions_events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 54fdbec4bf..9d45334828 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1193,7 +1193,7 @@ function events_get_all( ($key === 0) ? '' : $nexo, $field, $not_search, - str_replace('"', '', io_safe_output($filter['search'])), + preg_replace('/(? Date: Wed, 24 Apr 2024 01:00:06 +0200 Subject: [PATCH 20/53] 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 dc39cfc24b..78f474c03c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.776-240423 +Version: 7.0NG.776-240424 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 f0610328a3..ba36111bf4 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.776-240423" +pandora_version="7.0NG.776-240424" 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 4e5cdf4648..2971272471 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.776'; -use constant AGENT_BUILD => '240423'; +use constant AGENT_BUILD => '240424'; # 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 5e55531ea6..a3f2cb1be7 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.776 -%define release 240423 +%define release 240424 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 d5265d6628..6156fc9b5a 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.776 -%define release 240423 +%define release 240424 %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 326cc0ce03..e15570d0f9 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.776 -%define release 240423 +%define release 240424 %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 459397699e..77503e408b 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.776 -%define release 240423 +%define release 240424 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 3718053ee7..12081cec58 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.776 -%define release 240423 +%define release 240424 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 6ef156d08e..782badc69d 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240423" +PI_BUILD="240424" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2707a4c614..8a024a91ea 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240423} +{240424} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 097813d952..66e58934e5 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.776 Build 240423") +#define PANDORA_VERSION ("7.0NG.776 Build 240424") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e06b44d182..3ee21a8853 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.776(Build 240423))" + VALUE "ProductVersion", "(7.0NG.776(Build 240424))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 0bc9ced292..5e1b2a1205 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.776-240423 +Version: 7.0NG.776-240424 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 26096d98bd..be1ab5fe6e 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.776-240423" +pandora_version="7.0NG.776-240424" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d4928c2d05..91abccb973 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ use DI\ContainerBuilder; /* * Pandora build version and version */ -$build_version = 'PC240423'; +$build_version = 'PC240424'; $pandora_version = 'v7.0NG.776'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 5cebca051a..7db0f117c8 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 27d46670bf..94d1172518 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.776 -%define release 240423 +%define release 240424 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 1dd21d9eb3..b94b955715 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.776 -%define release 240423 +%define release 240424 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 0b79e11657..9d163b8d0c 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240423" +PI_BUILD="240424" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 75b1a8589a..0669fda75d 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.776 Build 240423"; +my $version = "7.0NG.776 Build 240424"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 3ccc5704a4..c65449e8f4 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.776 Build 240423"; +my $version = "7.0NG.776 Build 240424"; # save program name for logging my $progname = basename($0); From e0a16d3a1580807bf889c5affa589c7f86b907d3 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 24 Apr 2024 08:10:19 +0200 Subject: [PATCH 21/53] 13287-Remove Delete icon in Events for EW users --- pandora_console/include/functions_events.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 6e6068f386..a0c4a689cd 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1119,11 +1119,13 @@ function events_get_all( } } - if (!$user_is_admin && users_can_manage_group_all('ER') === false) { - $ER_groups = users_get_groups($config['id_user'], 'ER', true); + if (!$user_is_admin && users_can_manage_group_all('EM') === false) { $EM_groups = users_get_groups($config['id_user'], 'EM', true, true); $EW_groups = users_get_groups($config['id_user'], 'EW', true, true); + } + if (!$user_is_admin && users_can_manage_group_all('ER') === false) { + $ER_groups = users_get_groups($config['id_user'], 'ER', true); // Get groups where user have ER grants. if ((bool) $filter['search_secondary_groups'] === true) { $sql_filters[] = sprintf( @@ -1674,7 +1676,7 @@ function events_get_all( } } - if (!$user_is_admin && users_can_manage_group_all('ER') === false) { + if (!$user_is_admin && users_can_manage_group_all('EM') === false) { $exists_id_grupo = false; foreach ($fields as $field) { if (str_contains($field, 'te.id_grupo') === true || str_contains($field, 'te.*') === true) { @@ -1798,7 +1800,7 @@ function events_get_all( return $sql; } - if (!$user_is_admin && users_can_manage_group_all('ER') === false) { + if (!$user_is_admin && users_can_manage_group_all('EM') === false) { $can_manage = '0 as user_can_manage'; if (empty($EM_groups) === false) { $can_manage = sprintf( From 5c930c25899ef3fc26e3c7efa5d42036d94bcc34 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 24 Apr 2024 08:54:52 +0200 Subject: [PATCH 22/53] 13608-Change interval selector to select2 in widgets --- .../lib/Dashboard/Widgets/BasicChart.php | 1 + .../lib/Dashboard/Widgets/DataMatrix.php | 2 + .../lib/Dashboard/Widgets/custom_graph.php | 1 + .../Widgets/graph_module_histogram.php | 1 + .../include/lib/Dashboard/Widgets/netflow.php | 1 + .../lib/Dashboard/Widgets/single_graph.php | 179 +++++++++--------- .../lib/Dashboard/Widgets/sla_percent.php | 1 + .../include/lib/Dashboard/Widgets/top_n.php | 1 + 8 files changed, 99 insertions(+), 88 deletions(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php b/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php index cc25cb01cc..2b86e79d70 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php +++ b/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php @@ -423,6 +423,7 @@ class BasicChart extends Widget 'style_icon' => 'flex-grow: 0', 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', 'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'units_select2' => true, ], ]; diff --git a/pandora_console/include/lib/Dashboard/Widgets/DataMatrix.php b/pandora_console/include/lib/Dashboard/Widgets/DataMatrix.php index 337f33364e..9bf1c2d1bd 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/DataMatrix.php +++ b/pandora_console/include/lib/Dashboard/Widgets/DataMatrix.php @@ -317,6 +317,7 @@ class DataMatrix extends Widget 'style_icon' => 'flex-grow: 0', 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', 'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'units_select2' => true, ], ]; @@ -335,6 +336,7 @@ class DataMatrix extends Widget 'style_icon' => 'flex-grow: 0', 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', 'script_input' => 'check_period_warning_manual(\'slice\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'units_select2' => true, ], ]; diff --git a/pandora_console/include/lib/Dashboard/Widgets/custom_graph.php b/pandora_console/include/lib/Dashboard/Widgets/custom_graph.php index 29c5c17372..dc98622960 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/custom_graph.php +++ b/pandora_console/include/lib/Dashboard/Widgets/custom_graph.php @@ -394,6 +394,7 @@ class CustomGraphWidget extends Widget 'style_icon' => 'flex-grow: 0', 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', 'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'units_select2' => true, ], ]; diff --git a/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php b/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php index 51e2b89496..37cc1763ca 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php +++ b/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php @@ -373,6 +373,7 @@ class GraphModuleHistogramWidget extends Widget 'style_icon' => 'flex-grow: 0', 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', 'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'units_select2' => true, ], ]; diff --git a/pandora_console/include/lib/Dashboard/Widgets/netflow.php b/pandora_console/include/lib/Dashboard/Widgets/netflow.php index 6c0aa76eca..57cad05f49 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/netflow.php +++ b/pandora_console/include/lib/Dashboard/Widgets/netflow.php @@ -207,6 +207,7 @@ class Netflow extends Widget 'style_icon' => 'flex-grow: 0', 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', 'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'units_select2' => true, ], ]; $chart_types = netflow_get_chart_types(); diff --git a/pandora_console/include/lib/Dashboard/Widgets/single_graph.php b/pandora_console/include/lib/Dashboard/Widgets/single_graph.php index a9f242723d..ca8ca67205 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/single_graph.php +++ b/pandora_console/include/lib/Dashboard/Widgets/single_graph.php @@ -449,6 +449,7 @@ class SingleGraphWidget extends Widget 'style_icon' => 'flex-grow: 0', 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', 'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'units_select2' => true, ], ]; @@ -527,99 +528,101 @@ class SingleGraphWidget extends Widget 'id' => 'div_projection_period', 'style' => $display_projection, 'arguments' => [ - 'name' => 'period_projection', - 'type' => 'interval', - 'value' => $values['period_projection'], - 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', - 'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', - ], - ]; - - $inputs['inputs']['row2'][] = [ - 'label' => __('Maximum'), - 'id' => 'div_period_maximum', - 'style' => $display_periodicity_chart, - 'arguments' => [ - 'name' => 'period_maximum', - 'id' => 'period_maximum', - 'type' => 'switch', - 'value' => $values['period_maximum'], - ], - ]; - - $inputs['inputs']['row2'][] = [ - 'label' => __('Minimum'), - 'id' => 'div_period_minimum', - 'style' => $display_periodicity_chart, - 'arguments' => [ - 'name' => 'period_minimum', - 'id' => 'period_minimum', - 'type' => 'switch', - 'value' => $values['period_minimum'], - ], - ]; - - $inputs['inputs']['row2'][] = [ - 'label' => __('Average'), - 'id' => 'div_period_average', - 'style' => $display_periodicity_chart, - 'arguments' => [ - 'name' => 'period_average', - 'id' => 'period_average', - 'type' => 'switch', - 'value' => $values['period_average'], - ], - ]; - - $inputs['inputs']['row2'][] = [ - 'label' => __('Summatory'), - 'id' => 'div_period_summatory', - 'style' => $display_periodicity_chart, - 'arguments' => [ - 'name' => 'period_summatory', - 'id' => 'period_summatory', - 'type' => 'switch', - 'value' => $values['period_summatory'], - ], - ]; - - $inputs['inputs']['row2'][] = [ - 'label' => __('Slice period'), - 'id' => 'div_period_slice_chart', - 'style' => $display_periodicity_chart, - 'arguments' => [ - 'name' => 'period_slice_chart', + 'name' => 'period_projection', 'type' => 'interval', - 'value' => (string) $values['period_slice_chart'], - 'custom_fields' => [ - SECONDS_1HOUR => __('1 hour'), - SECONDS_1DAY => __('1 day'), - SECONDS_1WEEK => __('1 week'), - SECONDS_1MONTH => __('1 month'), + 'value' => $values['period_projection'], + 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'units_select2' => true, + ], + ]; + + $inputs['inputs']['row2'][] = [ + 'label' => __('Maximum'), + 'id' => 'div_period_maximum', + 'style' => $display_periodicity_chart, + 'arguments' => [ + 'name' => 'period_maximum', + 'id' => 'period_maximum', + 'type' => 'switch', + 'value' => $values['period_maximum'], ], - ], - ]; + ]; - $options_period_mode = [ - CUSTOM_GRAPH_AREA => __('Area'), - CUSTOM_GRAPH_LINE => __('Line'), - CUSTOM_GRAPH_VBARS => __('Vertical bars'), - ]; + $inputs['inputs']['row2'][] = [ + 'label' => __('Minimum'), + 'id' => 'div_period_minimum', + 'style' => $display_periodicity_chart, + 'arguments' => [ + 'name' => 'period_minimum', + 'id' => 'period_minimum', + 'type' => 'switch', + 'value' => $values['period_minimum'], + ], + ]; - $inputs['inputs']['row2'][] = [ - 'label' => __('Type chart'), - 'id' => 'div_period_mode', - 'style' => $display_periodicity_chart, - 'arguments' => [ - 'type' => 'select', - 'fields' => $options_period_mode, - 'name' => 'period_mode', - 'selected' => $values['period_mode'], - 'return' => true, - ], - ]; + $inputs['inputs']['row2'][] = [ + 'label' => __('Average'), + 'id' => 'div_period_average', + 'style' => $display_periodicity_chart, + 'arguments' => [ + 'name' => 'period_average', + 'id' => 'period_average', + 'type' => 'switch', + 'value' => $values['period_average'], + ], + ]; - return $inputs; + $inputs['inputs']['row2'][] = [ + 'label' => __('Summatory'), + 'id' => 'div_period_summatory', + 'style' => $display_periodicity_chart, + 'arguments' => [ + 'name' => 'period_summatory', + 'id' => 'period_summatory', + 'type' => 'switch', + 'value' => $values['period_summatory'], + ], + ]; + + $inputs['inputs']['row2'][] = [ + 'label' => __('Slice period'), + 'id' => 'div_period_slice_chart', + 'style' => $display_periodicity_chart, + 'arguments' => [ + 'name' => 'period_slice_chart', + 'type' => 'interval', + 'value' => (string) $values['period_slice_chart'], + 'custom_fields' => [ + SECONDS_1HOUR => __('1 hour'), + SECONDS_1DAY => __('1 day'), + SECONDS_1WEEK => __('1 week'), + SECONDS_1MONTH => __('1 month'), + ], + 'units_select2' => true, + ], + ]; + + $options_period_mode = [ + CUSTOM_GRAPH_AREA => __('Area'), + CUSTOM_GRAPH_LINE => __('Line'), + CUSTOM_GRAPH_VBARS => __('Vertical bars'), + ]; + + $inputs['inputs']['row2'][] = [ + 'label' => __('Type chart'), + 'id' => 'div_period_mode', + 'style' => $display_periodicity_chart, + 'arguments' => [ + 'type' => 'select', + 'fields' => $options_period_mode, + 'name' => 'period_mode', + 'selected' => $values['period_mode'], + 'return' => true, + ], + ]; + + return $inputs; } diff --git a/pandora_console/include/lib/Dashboard/Widgets/sla_percent.php b/pandora_console/include/lib/Dashboard/Widgets/sla_percent.php index f3c7fb826e..6b39939300 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/sla_percent.php +++ b/pandora_console/include/lib/Dashboard/Widgets/sla_percent.php @@ -383,6 +383,7 @@ class SLAPercentWidget extends Widget 'style_icon' => 'flex-grow: 0', 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', 'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'units_select2' => true, ], ]; diff --git a/pandora_console/include/lib/Dashboard/Widgets/top_n.php b/pandora_console/include/lib/Dashboard/Widgets/top_n.php index e48a7885fd..00691bed67 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/top_n.php +++ b/pandora_console/include/lib/Dashboard/Widgets/top_n.php @@ -262,6 +262,7 @@ class TopNWidget extends Widget 'style_icon' => 'flex-grow: 0', 'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', 'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', + 'units_select2' => true, ], ]; From ee349358c6f81d99990e82254e024f863f591e21 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 24 Apr 2024 09:46:22 +0200 Subject: [PATCH 23/53] 13601-Show servers icon in header only for PM users --- pandora_console/general/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 2d3d95a77e..a396964166 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -52,7 +52,7 @@ echo sprintf('
    ', $menuTypeClass); } // ======= Servers List =============================================== - if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) { + if ((bool) check_acl($config['id_user'], 0, 'PM') !== false) { $servers = []; $servers_info = servers_get_info(); From b011b746c0a643cf5adb6d18a6c2c5baabd42083 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 24 Apr 2024 09:49:03 +0200 Subject: [PATCH 24/53] #13591 public dashboard and visual console permisions user not logged --- .../include/lib/Dashboard/Manager.php | 27 +++++++++++++++++++ pandora_console/include/lib/User.php | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/lib/Dashboard/Manager.php b/pandora_console/include/lib/Dashboard/Manager.php index 36769c4338..e55cdd5d1e 100644 --- a/pandora_console/include/lib/Dashboard/Manager.php +++ b/pandora_console/include/lib/Dashboard/Manager.php @@ -411,6 +411,33 @@ class Manager implements PublicLogin $config['public_dashboard'] = true; $config['force_instant_logout'] = true; return true; + } else { + $dashboards = self::getDashboards(); + $dashboards = array_reduce( + $dashboards, + function ($carry, $item) { + $carry[$item['id']] = $item['name']; + return $carry; + }, + [] + ); + + foreach ($dashboards as $key => $layout) { + $hash_compare = self::generatePublicHash($key); + if (hash_equals($hash, $hash_compare)) { + // "Log" user in. + if (session_status() !== PHP_SESSION_ACTIVE) { + session_start(); + } + + $_SESSION['id_usuario'] = get_parameter('id_user'); + session_write_close(); + + $config['public_dashboard'] = true; + $config['force_instant_logout'] = true; + return true; + } + } } // Remove id user from config array if authentication has failed. diff --git a/pandora_console/include/lib/User.php b/pandora_console/include/lib/User.php index d11c92e22a..5baace3b12 100644 --- a/pandora_console/include/lib/User.php +++ b/pandora_console/include/lib/User.php @@ -230,7 +230,7 @@ class User extends Entity implements PublicLogin global $config; $str = $config['dbpass']; - $str .= $config['id_user']; + $str .= ($config['id_user'] ?? get_parameter('id_user')); $str .= $other_secret; return hash('sha256', $str); } From a41a1becfa0a3719712acdb8a01f75aa3ae598e4 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Wed, 24 Apr 2024 09:56:48 +0200 Subject: [PATCH 25/53] #13223 Fixed instructions dialog in events as a modal --- pandora_console/include/functions_events.php | 29 +++++++------------- pandora_console/operation/events/events.php | 15 ++++++---- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 823a46f35f..9718eca184 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -5888,12 +5888,6 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['unknown_instructions']) ); } - - $event_name = str_replace( - "'", - '', - io_safe_output($event['evento']) - ); break; case 'going_up_warning': @@ -5905,12 +5899,6 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['warning_instructions']) ); } - - $event_name = str_replace( - "'", - '', - io_safe_output($event['evento']) - ); break; case 'going_up_critical': @@ -5922,12 +5910,6 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['critical_instructions']) ); } - - $event_name = str_replace( - "'", - '', - io_safe_output($event['evento']) - ); break; default: @@ -5946,7 +5928,16 @@ function events_get_instructions($event, $max_text_length=300) return $value; } - $over_event_name = ui_print_truncate_text($event_name, 51, false, true, false); + $event_name = ui_print_truncate_text( + io_safe_output($event['evento']), + GENERIC_SIZE_TEXT, + false, + true, + false, + '...' + ); + + $over_event_name = base64_encode($event_name); $output = '
    Date: Wed, 24 Apr 2024 12:03:03 +0200 Subject: [PATCH 26/53] update execution in proxmox plugin --- pandora_console/extras/mr/69.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/extras/mr/69.sql b/pandora_console/extras/mr/69.sql index ea49c68624..aab53b96d7 100644 --- a/pandora_console/extras/mr/69.sql +++ b/pandora_console/extras/mr/69.sql @@ -7754,4 +7754,7 @@ ALTER TABLE `tdeployment_hosts` DROP COLUMN `arch`; -- Update all deployment recon tasks port UPDATE `trecon_task` SET `field4` = 41121 WHERE `type` = 9; +--Update execution in proxmox discovery plugin +UPDATE `tdiscovery_apps_executions` SET `execution` = ''_exec1_' --conf '_tempfileProxmox_'' WHERE `short_name` = 'pandorafms.proxmox'; + COMMIT; \ No newline at end of file From 113c92dde05c0f8c8e155763d9e8deb60548359a Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 24 Apr 2024 13:36:12 +0200 Subject: [PATCH 27/53] #12998 fix style message dashboard --- pandora_console/include/functions_ui.php | 3 +-- .../include/javascript/tree/TreeController.js | 2 +- .../include/lib/Dashboard/Widgets/tree_view.php | 2 +- pandora_console/include/styles/dashboards.css | 11 +++++++++++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index f60db0b560..f6a29c11a2 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -301,8 +301,7 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t if (empty($message['no_close']) === false) { // Workaround. - $no_close_bool = false; - // $no_close_bool = (bool) $message['no_close']; + $no_close_bool = (bool) $message['no_close']; } if (empty($message['force_style']) === false) { diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 06274600ed..fb930d9b08 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -1543,7 +1543,7 @@ var TreeController = { } else if (controller.tree.length == 0) { controller.recipient.empty(); controller.recipient.html( - "
    " + controller.emptyMessage + "
    " + "
    " + controller.emptyMessage + "
    " ); return; } diff --git a/pandora_console/include/lib/Dashboard/Widgets/tree_view.php b/pandora_console/include/lib/Dashboard/Widgets/tree_view.php index 12237ac6a9..18bc4f12c1 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/tree_view.php +++ b/pandora_console/include/lib/Dashboard/Widgets/tree_view.php @@ -684,7 +684,7 @@ class TreeViewWidget extends Widget 'dateFormat' => DATE_FORMAT_JS, 'userLanguage' => get_user_language(), 'translate' => [ - 'emptyMessage' => __('No data found'), + 'emptyMessage' => ui_print_info_message(['no_close' => true, 'message' => __('No data found.')], '', true), 'foundMessage' => $foundMessage, 'total' => [ 'agents' => __('Total agents'), diff --git a/pandora_console/include/styles/dashboards.css b/pandora_console/include/styles/dashboards.css index 8a4f042b80..58c11c4c00 100644 --- a/pandora_console/include/styles/dashboards.css +++ b/pandora_console/include/styles/dashboards.css @@ -954,6 +954,7 @@ input.resize_button { right: 6%; } +.recipent > div > table, .new-widget-message > div > table, .container-center > div > table { display: flex; @@ -961,6 +962,7 @@ input.resize_button { align-items: center; } +.recipent > div > table tr td > div, .new-widget-message > div > table tr td > div, .container-center > div > table tr td > div { position: absolute; @@ -1021,3 +1023,12 @@ ul.select2-selection__rendered > li.select2-selection__choice { #period_manual > input[type="text"] { box-sizing: border-box !important; } + +.recipent { + height: 100%; + width: 100%; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} From c6b28f506149c19a134a9d5900667e71de98c5c7 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Wed, 24 Apr 2024 13:46:01 +0200 Subject: [PATCH 28/53] #13313 Validations are added for the template field in goal alerts. It is not redirected in case of errors in the meta form --- pandora_console/godmode/alerts/alert_list.builder.php | 8 ++++++-- pandora_console/godmode/alerts/alert_list.php | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index 13151b4de9..7f1c225335 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -294,10 +294,14 @@ $(document).ready (function () { // configure your validation $("form.add_alert_form").validate({ rules: { - id_agent_module: { valueNotEquals: "0" } + id_agent_module: { valueNotEquals: "0" }, + template: { valueNotEquals: "0" }, + id_agent: { valueNotEquals: "" }, }, messages: { - id_agent_module: { valueNotEquals: "Please select an item!" } + id_agent_module: { valueNotEquals: "Please select an item!" }, + template: { valueNotEquals: "Please select a templete!" }, + id_agent: { valueNotEquals: "Please select an agent!" } } }); $("select#template").change (function () { diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 1dc32ba086..a89f871ebf 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -220,7 +220,6 @@ if ($create_alert) { if (is_metaconsole()) { // Restore db connection. metaconsole_restore_db(); - echo ''; } } From c3867e623bb3f9f5c45f8cfa4d3c45eeea713cdb Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 24 Apr 2024 15:18:57 +0200 Subject: [PATCH 29/53] #13591 no dashboarid enabled --- pandora_console/operation/dashboard/public_dashboard.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandora_console/operation/dashboard/public_dashboard.php b/pandora_console/operation/dashboard/public_dashboard.php index 7ef9f07d4a..b53c4b80b8 100644 --- a/pandora_console/operation/dashboard/public_dashboard.php +++ b/pandora_console/operation/dashboard/public_dashboard.php @@ -38,6 +38,13 @@ ob_start(); // Fullscreen by default. $config['pure'] = get_parameter('pure', 1); +$dashboardId = get_parameter('dashboardId', null); +if ($dashboardId !== null) { + include 'general/noaccess.php'; + return; +} + + require_once 'dashboard.php'; // Clean session to avoid direct access. From e3fe2b01a23df7fe580017e352422f6c26504f00 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 24 Apr 2024 15:28:20 +0200 Subject: [PATCH 30/53] #13591 no id_layout enabled --- pandora_console/operation/visual_console/public_view.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandora_console/operation/visual_console/public_view.php b/pandora_console/operation/visual_console/public_view.php index d7e85f88bc..ff6f7763e0 100644 --- a/pandora_console/operation/visual_console/public_view.php +++ b/pandora_console/operation/visual_console/public_view.php @@ -13,6 +13,12 @@ // GNU General Public License for more details. require_once '../../include/config.php'; +$id_layout = get_parameter('id_layout', null); +if ($id_layout !== null) { + include '../../general/noaccess.php'; + return; +} + use PandoraFMS\User; // Set root on homedir, as defined in setup. From ec7626dcf443f1f170d7b5569d8a68307090178d Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Wed, 24 Apr 2024 15:34:20 +0200 Subject: [PATCH 31/53] #13453 remove repetition of warning modal when a date greater than 30 days is selected --- pandora_console/include/javascript/pandora.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index ad17d670a2..ef5b48b982 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -2566,19 +2566,13 @@ function menuActionButtonResizing() { function check_period_warning(time, title, message) { var period = time.value; - var times = 0; + if (period >= 2592000 && period < 7776000) { WarningPeriodicityModal(title, message); } else if (period >= 7776000 && period < 15552000) { - do { - WarningPeriodicityModal(title, message); - times = times + 1; - } while (times < 2); + WarningPeriodicityModal(title, message); } else if (period >= 15552000) { - do { - WarningPeriodicityModal(title, message); - times = times + 1; - } while (times < 3); + WarningPeriodicityModal(title, message); } } From f634579103625aab2e92dcceb4e6e86dcfeef8b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Wed, 24 Apr 2024 08:08:47 -0600 Subject: [PATCH 32/53] Changes on Keep Alive --- pandora_server/lib/PandoraFMS/Core.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 1f78ab8079..60133ce524 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -3674,12 +3674,12 @@ Updates the keep_alive module for the given agent. sub pandora_module_keep_alive ($$$$$) { my ($pa_config, $id_agent, $agent_name, $server_id, $dbh) = @_; - logger($pa_config, "Updating keep_alive module for agent '" . safe_output($agent_name) . "'.", 10); + logger($pa_config, "Updating keep_alive modules for agent '" . safe_output($agent_name) . "'.", 10); - # Update keepalive module - my $module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente = ? AND delete_pending = 0 AND id_tipo_modulo = 100', $id_agent); - if (defined ($module)) { - my %data = ('data' => 1); + # Update keepalive modules + my @modules = get_db_rows($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente = ? AND delete_pending = 0 AND id_tipo_modulo = 100', $id_agent); + my %data = ('data' => 1); + foreach my $module (@modules) { pandora_process_module ($pa_config, \%data, '', $module, 'keep_alive', '', time(), $server_id, $dbh); } } From e3b064741ab4b677011288c0d3610a57e3109049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Wed, 24 Apr 2024 15:31:03 -0600 Subject: [PATCH 33/53] Fix escape characters on community --- pandora_server/util/plugin/pandora_snmp_bandwidth.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_server/util/plugin/pandora_snmp_bandwidth.pl b/pandora_server/util/plugin/pandora_snmp_bandwidth.pl index 15fcf58f73..579d7da716 100755 --- a/pandora_server/util/plugin/pandora_snmp_bandwidth.pl +++ b/pandora_server/util/plugin/pandora_snmp_bandwidth.pl @@ -165,7 +165,7 @@ sub prepare_tree { } else { $snmp_call{'oid'} = $config->{'oid_base'} . $config->{'x86_indexes'}{'__idx__'}.$ifIndex; } - + my $raw = snmp_walk(\%snmp_call); return $raw if (ref($raw) eq "HASH"); @@ -518,6 +518,9 @@ $filename =~ tr/./_/; $config->{'tmp_file'} = $filename.'.idx' if empty($config->{'tmp_file'}); $config->{'log'} = $filename.'.log' if empty($config->{'log'}); +# Escape special characters +$config->{'community'} =~ s/([^\/\w])/\\$1/g; + # Check snmp connectivity my $sysobjectid = snmp_get({%{$config}, 'oid' => '.1.3.6.1.2.1.1.2.0'}); From c43387f9fe719207732bd3456af9e57462488ba4 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 25 Apr 2024 01:00:29 +0200 Subject: [PATCH 34/53] 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 78f474c03c..97127595c6 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.776-240424 +Version: 7.0NG.776-240425 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 ba36111bf4..f1bab9e313 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.776-240424" +pandora_version="7.0NG.776-240425" 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 2971272471..845c0f6dad 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.776'; -use constant AGENT_BUILD => '240424'; +use constant AGENT_BUILD => '240425'; # 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 a3f2cb1be7..9d4799e151 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.776 -%define release 240424 +%define release 240425 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 6156fc9b5a..34d3587bea 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.776 -%define release 240424 +%define release 240425 %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 e15570d0f9..303e02bc9d 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.776 -%define release 240424 +%define release 240425 %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 77503e408b..132519c329 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.776 -%define release 240424 +%define release 240425 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 12081cec58..01c8527c18 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.776 -%define release 240424 +%define release 240425 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 782badc69d..5735720eeb 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240424" +PI_BUILD="240425" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 8a024a91ea..4bf744c992 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240424} +{240425} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 66e58934e5..aa67dc414b 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.776 Build 240424") +#define PANDORA_VERSION ("7.0NG.776 Build 240425") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 3ee21a8853..d895a6fae0 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.776(Build 240424))" + VALUE "ProductVersion", "(7.0NG.776(Build 240425))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 5e1b2a1205..13f9fe2275 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.776-240424 +Version: 7.0NG.776-240425 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 be1ab5fe6e..7089dd8c0f 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.776-240424" +pandora_version="7.0NG.776-240425" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 91abccb973..a3a79aa0f5 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ use DI\ContainerBuilder; /* * Pandora build version and version */ -$build_version = 'PC240424'; +$build_version = 'PC240425'; $pandora_version = 'v7.0NG.776'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 7db0f117c8..f7eae3e57b 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 94d1172518..53107d9127 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.776 -%define release 240424 +%define release 240425 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index b94b955715..25ddbd8b24 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.776 -%define release 240424 +%define release 240425 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 9d163b8d0c..34260a9b55 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240424" +PI_BUILD="240425" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 0669fda75d..eb69708ca8 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.776 Build 240424"; +my $version = "7.0NG.776 Build 240425"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index c65449e8f4..31b977cf51 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.776 Build 240424"; +my $version = "7.0NG.776 Build 240425"; # save program name for logging my $progname = basename($0); From 1bd9e14e8f4df5eb87ac0b51786d53c6ab404d08 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 25 Apr 2024 09:07:58 +0200 Subject: [PATCH 35/53] #13313 Fixed translation formatting --- pandora_console/godmode/alerts/alert_list.builder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index 7f1c225335..9ce18fd13c 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -299,9 +299,9 @@ $(document).ready (function () { id_agent: { valueNotEquals: "" }, }, messages: { - id_agent_module: { valueNotEquals: "Please select an item!" }, - template: { valueNotEquals: "Please select a templete!" }, - id_agent: { valueNotEquals: "Please select an agent!" } + id_agent_module: { valueNotEquals: "!"}, + template: { valueNotEquals: "!"}, + id_agent: { valueNotEquals: "!"}, } }); $("select#template").change (function () { From aaedce6d46fa8f4b19c6c5be29a414f4cf5e5788 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 25 Apr 2024 10:21:15 +0200 Subject: [PATCH 36/53] 13602-Fix report end time. Fix item Module event report in report templates --- pandora_console/include/functions_reporting.php | 8 +++++--- pandora_console/operation/reporting/reporting_viewer.php | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 476ba918ee..aa2567952b 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2736,7 +2736,8 @@ function reporting_event_report_module( $ttl, $id_server, $metaconsole_dbtable, - $filter_event_filter_exclude + $filter_event_filter_exclude, + $content['id_agent_module'] ); if (empty($data)) { @@ -11728,7 +11729,8 @@ function reporting_get_module_detailed_event( $ttl=1, $id_server=false, $metaconsole_dbtable=false, - $filter_event_filter_exclude=false + $filter_event_filter_exclude=false, + $id_agent=false ) { global $config; @@ -11751,7 +11753,7 @@ function reporting_get_module_detailed_event( foreach ($id_modules as $id_module) { $event['data'] = events_get_agent( - false, + $id_agent, (int) $period, (int) $date, $history, diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index 011dc1c82f..386a0e4ddb 100755 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -53,6 +53,8 @@ $time_start = date('H:i:s', $date_params['date_init']); $date_init = date('Y/m/d', $date_params['date_init']); $time_init = date('H:i:s', $date_params['date_init']); +$time = $time_end; + $custom_date_end = date('Y/m/d H:i:s', $date_params['date_end']); $period = $date_params['period']; From a209fc95ec16cf8709bb6bd3e5ded79ee79217a2 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 25 Apr 2024 12:57:47 +0200 Subject: [PATCH 37/53] 13614-Fix icon color dark theme in General search --- pandora_console/operation/search_main.php | 6 +-- pandora_console/operation/search_results.php | 42 +++++++++++++++----- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/pandora_console/operation/search_main.php b/pandora_console/operation/search_main.php index c565007e2f..099409bcf7 100644 --- a/pandora_console/operation/search_main.php +++ b/pandora_console/operation/search_main.php @@ -133,16 +133,16 @@ $table->data[0][3] = "" . // ~ sprintf(__("%s Found"), $totalAlerts) . ""; // --------------------------------------------------------------------- -$table->data[0][6] = html_print_image('images/input_user.png', true, ['title' => __('Users found'), 'class' => 'invert_filter']); +$table->data[0][6] = html_print_image('images/input_user.png', true, ['title' => __('Users found')]); $table->data[0][7] = "".sprintf(__('%s Found'), $totalUsers).''; $table->data[0][8] = html_print_image('images/chart_curve.png', true, ['title' => __('Graphs found'), 'class' => 'invert_filter']); $table->data[0][9] = "".sprintf(__('%s Found'), $totalGraphs).''; $table->data[0][10] = html_print_image('images/reporting.png', true, ['title' => __('Reports found'), 'class' => 'invert_filter']); $table->data[0][11] = "".sprintf(__('%s Found'), $totalReports).''; -$table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Visual consoles')]); +$table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Visual consoles'), 'class' => 'main_menu_icon invert_filter']); $table->data[0][13] = "".sprintf(__('%s Found'), $totalMaps).''; if (enterprise_installed()) { - $table->data[0][14] = html_print_image('images/policy@svg.svg', true, ['title' => __('Policies'), 'class' => 'main_menu_icon']); + $table->data[0][14] = html_print_image('images/policy@svg.svg', true, ['title' => __('Policies'), 'class' => 'main_menu_icon invert_filter']); $table->data[0][15] = "".sprintf(__('%s Found'), $totalPolicies).''; } diff --git a/pandora_console/operation/search_results.php b/pandora_console/operation/search_results.php index 38ae15be1c..6bf3e7766e 100644 --- a/pandora_console/operation/search_results.php +++ b/pandora_console/operation/search_results.php @@ -66,7 +66,10 @@ if ($searchMain) { 'text' => "".html_print_image( 'images/zoom_mc.png', true, - ['title' => __('Global search')] + [ + 'title' => __('Global search'), + 'class' => 'main_menu_icon invert_filter', + ] ).'', 'active' => $searchTab == 'main', ]; @@ -79,7 +82,10 @@ if ($searchAgents) { 'text' => "".html_print_image( 'images/op_monitoring.png', true, - ['title' => __('Agents')] + [ + 'title' => __('Agents'), + 'class' => 'main_menu_icon invert_filter', + ] ).'', 'active' => $searchTab == 'agents', ]; @@ -92,7 +98,10 @@ if ($searchUsers) { 'text' => "".html_print_image( 'images/op_workspace.png', true, - ['title' => __('Users')] + [ + 'title' => __('Users'), + 'class' => 'main_menu_icon invert_filter', + ] ).'', 'active' => $searchTab == 'users', ]; @@ -105,7 +114,10 @@ if ($searchAlerts) { 'text' => "".html_print_image( 'images/op_alerts.png', true, - ['title' => __('Alerts')] + [ + 'title' => __('Alerts'), + 'class' => 'main_menu_icon invert_filter', + ] ).'', 'active' => $searchTab == 'alerts', ]; @@ -118,7 +130,10 @@ if ($searchGraphs) { 'text' => "".html_print_image( 'images/chart.png', true, - ['title' => __('Graphs')] + [ + 'title' => __('Graphs'), + 'class' => 'main_menu_icon invert_filter', + ] ).'', 'active' => $searchTab == 'graphs', ]; @@ -131,7 +146,10 @@ if ($searchReports) { 'text' => "".html_print_image( 'images/op_reporting.png', true, - ['title' => __('Reports')] + [ + 'title' => __('Reports'), + 'class' => 'main_menu_icon invert_filter', + ] ).'', 'active' => $searchTab == 'reports', ]; @@ -144,7 +162,10 @@ if ($searchMaps) { 'text' => "".html_print_image( 'images/visual_console.png', true, - ['title' => __('Visual consoles')] + [ + 'title' => __('Visual consoles'), + 'class' => 'main_menu_icon invert_filter', + ] ).'', 'active' => $searchTab == 'maps', ]; @@ -157,7 +178,10 @@ if ($searchModules) { 'text' => "".html_print_image( 'images/brick.png', true, - ['title' => __('Modules')] + [ + 'title' => __('Modules'), + 'class' => 'main_menu_icon invert_filter', + ] ).'', 'active' => $searchTab == 'modules', ]; @@ -172,7 +196,7 @@ if ($searchPolicies) { true, [ 'title' => __('Policies'), - 'class' => 'main_menu_icon', + 'class' => 'main_menu_icon invert_filter', ] ).'', 'active' => $searchTab == 'policies', From 25063841e2d6ae64a3607a5be1a1dca14d3cfa6a Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 25 Apr 2024 13:27:27 +0200 Subject: [PATCH 38/53] 13539-Fix z-index tree view modal --- pandora_console/include/javascript/tree/TreeController.js | 4 ++++ pandora_console/include/styles/pandora.css | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 06274600ed..2fbbcd2264 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -625,6 +625,10 @@ var TreeController = { $("#fixed-bottom-box-head-title").html( $("#fixedBottomHeadTitle").html() ); + + $("#fixed-bottom-box-head-title") + .closest(".fixed-bottom-box") + .addClass("tree-view-bottom-modal"); }, error: function(xhr, textStatus, errorThrown) { callback(errorThrown); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 366c347cdd..98021c7afa 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -14272,3 +14272,8 @@ table.filter-table-adv td > div.row-flex label.custom_checkbox { table.filter-table-adv td > div.row-flex input { width: 100%; } + +div.fixed-bottom-box.tree-view-bottom-modal { + z-index: 1; + border: 1px solid var(--border-color); +} From 7131685be7f5ccc4a5676000062b906c9911ccc4 Mon Sep 17 00:00:00 2001 From: alejandro Date: Thu, 25 Apr 2024 14:18:41 +0200 Subject: [PATCH 39/53] update execution in proxmox plugin --- pandora_console/extras/mr/69.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/69.sql b/pandora_console/extras/mr/69.sql index aab53b96d7..f7f9e6f8e1 100644 --- a/pandora_console/extras/mr/69.sql +++ b/pandora_console/extras/mr/69.sql @@ -7755,6 +7755,8 @@ ALTER TABLE `tdeployment_hosts` DROP COLUMN `arch`; UPDATE `trecon_task` SET `field4` = 41121 WHERE `type` = 9; --Update execution in proxmox discovery plugin -UPDATE `tdiscovery_apps_executions` SET `execution` = ''_exec1_' --conf '_tempfileProxmox_'' WHERE `short_name` = 'pandorafms.proxmox'; +SET @short_name = 'pandorafms.proxmox'; +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; +UPDATE `tdiscovery_apps_executions` SET `execution` = ''_exec1_' --conf '_tempfileProxmox_'' WHERE `id_app` = @id_app; COMMIT; \ No newline at end of file From 60a7460b75dd72d5a42e6b51ef0f7008be885154 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 25 Apr 2024 14:33:58 +0200 Subject: [PATCH 40/53] #13554 AW satellite server view and edit --- pandora_console/godmode/menu.php | 2 -- .../godmode/servers/modificar_server.php | 26 ++++++++++--------- .../class/SatelliteCollection.class.php | 4 +-- pandora_console/include/functions_menu.php | 2 ++ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 742976c57a..ad1cf0f380 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -478,8 +478,6 @@ if ($access_console_node === true) { $menu_godmode['gservers']['sec2'] = 'godmode/servers/modificar_server'; $menu_godmode['gservers']['id'] = 'god-servers'; $sub = []; - $sub['godmode/servers/modificar_server']['text'] = __('Manage servers'); - $sub['godmode/servers/modificar_server']['id'] = 'Manage_servers'; enterprise_hook('manage_satellite_submenu'); $menu_godmode['gservers']['sub'] = $sub; } diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index e4c5d7aa09..43ab316364 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -34,7 +34,7 @@ require_once $config['homedir'].'/include/functions_graph.php'; check_login(); -if (! check_acl($config['id_user'], 0, 'AW')) { +if (! check_acl($config['id_user'], 0, 'PM') && ((bool) check_acl($config['id_user'], 0, 'AW') === true && $_GET['server_remote'] === null)) { db_pandora_audit( AUDIT_LOG_ACL_VIOLATION, 'Trying to access Server Management' @@ -286,19 +286,21 @@ if (isset($_GET['server']) === true) { $id_server ); - $buttons = ''; + $buttons = []; // Buttons. - $buttons = [ - 'standard_editor' => [ - 'active' => false, - 'text' => ''.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'', - ], - 'advanced_editor' => [ - 'active' => false, - 'text' => ''.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'', - ], - ]; + if ((bool) check_acl($config['id_user'], 0, 'PM') === true) { + $buttons = [ + 'standard_editor' => [ + 'active' => false, + 'text' => ''.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'', + ], + 'advanced_editor' => [ + 'active' => false, + 'text' => ''.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'', + ], + ]; + } if ($server_type === SERVER_TYPE_ENTERPRISE_SATELLITE) { $buttons['agent_editor'] = [ diff --git a/pandora_console/include/class/SatelliteCollection.class.php b/pandora_console/include/class/SatelliteCollection.class.php index a1ef24393c..3052abcda9 100644 --- a/pandora_console/include/class/SatelliteCollection.class.php +++ b/pandora_console/include/class/SatelliteCollection.class.php @@ -553,7 +553,6 @@ class SatelliteCollection extends HTML }, datatype: "json", success: function(data) { - console.log(data); showMsg(data); }, error: function(e) { @@ -596,7 +595,6 @@ class SatelliteCollection extends HTML }, datatype: "json", success: function(data) { - console.log(data); showMsg(data); }, error: function(e) { @@ -615,7 +613,7 @@ class SatelliteCollection extends HTML function showMsg(data) { var title = ""; var dt_satellite_agents = $("#satellite_collections").DataTable(); - dt_tableId; ?>.draw(false); + dt_satellite_agents.draw(false); var text = ''; var failed = 0; diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 9bca063e6e..493729b737 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -169,6 +169,8 @@ function menu_print_menu(&$menu) $sec2 = 'godmode/users/profile_list'; } else if ($sec2 === 'godmode/users/configure_token') { $sec2 = 'godmode/users/token_list'; + } else if ($sec2 === 'godmode/servers/modificar_server' && check_acl($config['id_user'], 0, 'AW')) { + $sec2 = 'enterprise/godmode/servers/list_satellite'; } else { $sec2 = (string) get_parameter('sec2'); } From 573f3045942b3c2734231789d0a74336e876c527 Mon Sep 17 00:00:00 2001 From: alejandro Date: Thu, 25 Apr 2024 15:07:30 +0200 Subject: [PATCH 41/53] space in comment --- pandora_console/extras/mr/69.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/69.sql b/pandora_console/extras/mr/69.sql index f7f9e6f8e1..45047f9149 100644 --- a/pandora_console/extras/mr/69.sql +++ b/pandora_console/extras/mr/69.sql @@ -7754,7 +7754,7 @@ ALTER TABLE `tdeployment_hosts` DROP COLUMN `arch`; -- Update all deployment recon tasks port UPDATE `trecon_task` SET `field4` = 41121 WHERE `type` = 9; ---Update execution in proxmox discovery plugin +-- Update execution in proxmox discovery plugin SET @short_name = 'pandorafms.proxmox'; SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; UPDATE `tdiscovery_apps_executions` SET `execution` = ''_exec1_' --conf '_tempfileProxmox_'' WHERE `id_app` = @id_app; From 9b6f160bd86b7d386201ab21a8aa104002c1e4ab Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 25 Apr 2024 15:10:17 +0200 Subject: [PATCH 42/53] 13605-Fix Scheduled downtime width form --- .../godmode/agentes/planned_downtime.editor.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index 75ef5bb65b..32132c7eb1 100644 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -906,7 +906,8 @@ $table->data[0][] = html_print_label_input_block( false, true, '', - $disabled_in_execution + $disabled_in_execution, + 'width: 100%;' ) ); @@ -939,8 +940,9 @@ $table->data[1][] = html_print_label_input_block( true, false, true, - '', - $disabled_in_execution + 'w100p', + $disabled_in_execution, + 'width: 100%;' ).ui_print_input_placeholder( __('Quiet: Modules will not generate events or fire alerts.').'
    '.__('Disable Agents: Disables the selected agents.').'
    '.__('Disable Alerts: Disable alerts for the selected agents.'), true @@ -964,7 +966,8 @@ $table->data[2][] = html_print_label_input_block( false, true, '', - $disabled_in_execution + $disabled_in_execution, + 'width: 100%;' ) ); From 4af45d30e25cae94f0a373e6a5a9d33f8ef6fbf8 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 25 Apr 2024 15:32:51 +0200 Subject: [PATCH 43/53] #13554 fix menu section for AW --- pandora_console/include/functions_menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 493729b737..c60ac0b5af 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -169,7 +169,7 @@ function menu_print_menu(&$menu) $sec2 = 'godmode/users/profile_list'; } else if ($sec2 === 'godmode/users/configure_token') { $sec2 = 'godmode/users/token_list'; - } else if ($sec2 === 'godmode/servers/modificar_server' && check_acl($config['id_user'], 0, 'AW')) { + } else if ($sec2 === 'godmode/servers/modificar_server' && check_acl($config['id_user'], 0, 'AW') && (bool) check_acl($config['id_user'], 0, 'PM') === false) { $sec2 = 'enterprise/godmode/servers/list_satellite'; } else { $sec2 = (string) get_parameter('sec2'); From 970103c1ea63d4615ea69cd9a26acf6cbabc7a3b Mon Sep 17 00:00:00 2001 From: alejandro Date: Thu, 25 Apr 2024 15:44:52 +0200 Subject: [PATCH 44/53] update pandoradb_data con new proxmox execution --- pandora_console/pandoradb_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index c80dac17f4..8ba8cf8ade 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -2947,7 +2947,7 @@ SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_na INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_proxmox'); -- Insert into tdiscovery_apps_executions -INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' -g '__taskGroup__' --host '_host_' --port '_port_' --user '_user_' --password '_password_' --vm '_scanVM_' --lxc '_scanLXC_' --backups '_scanBackups_' --nodes '_scanNodes_' --transfer_mode tentacle --tentacle_address '_tentacleIP_' --tentacle_port '_tentaclePort_' --as_discovery_plugin 1'); +INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileProxmox_''); -- Insert new SAP APP SET @short_name = 'pandorafms.sap.deset'; From a3803e97e8a09be8db423db095b27c82c95db950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Wed, 27 Mar 2024 13:54:36 -0600 Subject: [PATCH 45/53] Changes to Keep menu open --- pandora_console/include/functions_menu.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index c60ac0b5af..3439dd790a 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -171,6 +171,8 @@ function menu_print_menu(&$menu) $sec2 = 'godmode/users/token_list'; } else if ($sec2 === 'godmode/servers/modificar_server' && check_acl($config['id_user'], 0, 'AW') && (bool) check_acl($config['id_user'], 0, 'PM') === false) { $sec2 = 'enterprise/godmode/servers/list_satellite'; + }else if ($sec2 === 'enterprise/godmode/snmpconsole/snmp_trap_editor_form') { + $sec2 = 'enterprise/godmode/snmpconsole/snmp_trap_editor'; } else { $sec2 = (string) get_parameter('sec2'); } From b4d4300f124f42d7e858fbdfd54da87a3fdaa54c Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 26 Apr 2024 01:00:06 +0200 Subject: [PATCH 46/53] 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 97127595c6..776895016f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.776-240425 +Version: 7.0NG.776-240426 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 f1bab9e313..d903d734ff 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.776-240425" +pandora_version="7.0NG.776-240426" 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 845c0f6dad..11d3fbc342 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.776'; -use constant AGENT_BUILD => '240425'; +use constant AGENT_BUILD => '240426'; # 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 9d4799e151..da92e682d5 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.776 -%define release 240425 +%define release 240426 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 34d3587bea..d3ae159f29 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.776 -%define release 240425 +%define release 240426 %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 303e02bc9d..a4921ff03a 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.776 -%define release 240425 +%define release 240426 %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 132519c329..9de653ff61 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.776 -%define release 240425 +%define release 240426 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 01c8527c18..8c2d015bd3 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.776 -%define release 240425 +%define release 240426 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 5735720eeb..f534ae2797 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240425" +PI_BUILD="240426" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 4bf744c992..df2184c9de 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240425} +{240426} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index aa67dc414b..4a92ac6038 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.776 Build 240425") +#define PANDORA_VERSION ("7.0NG.776 Build 240426") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d895a6fae0..4c6daf186a 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.776(Build 240425))" + VALUE "ProductVersion", "(7.0NG.776(Build 240426))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 13f9fe2275..2764e03eec 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.776-240425 +Version: 7.0NG.776-240426 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 7089dd8c0f..6aba46a7f2 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.776-240425" +pandora_version="7.0NG.776-240426" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a3a79aa0f5..fb18f9d77c 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ use DI\ContainerBuilder; /* * Pandora build version and version */ -$build_version = 'PC240425'; +$build_version = 'PC240426'; $pandora_version = 'v7.0NG.776'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f7eae3e57b..b0d9f50633 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 53107d9127..aa0e3d0ae3 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.776 -%define release 240425 +%define release 240426 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 25ddbd8b24..1115db58cf 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.776 -%define release 240425 +%define release 240426 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 34260a9b55..dd691e1d57 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240425" +PI_BUILD="240426" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index eb69708ca8..b08bd733fa 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.776 Build 240425"; +my $version = "7.0NG.776 Build 240426"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 31b977cf51..6235c2f9a0 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.776 Build 240425"; +my $version = "7.0NG.776 Build 240426"; # save program name for logging my $progname = basename($0); From 8ad672a37608ce74a20ce05d842bc6a3f51b0451 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Fri, 26 Apr 2024 08:16:22 +0200 Subject: [PATCH 47/53] 13495-Show Setup icon in VC --- pandora_console/general/header.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index a396964166..73c5fcc90b 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -363,20 +363,6 @@ echo sprintf('
    ', $menuTypeClass); $display_counter = 'display:none'; } - if ((bool) check_acl($config['id_user'], 0, 'PM') === true) { - $header_setup .= ''; - } - $header_autorefresh = '
    '; $header_autorefresh .= $autorefresh_link_open_img; $header_autorefresh .= $autorefresh_img; @@ -391,6 +377,20 @@ echo sprintf('
    ', $menuTypeClass); $header_autorefresh_counter .= '
    '; } + if ((bool) check_acl($config['id_user'], 0, 'PM') === true) { + $header_setup .= ''; + } + $modal_box = '