From 0f379a28888d8c2289e4d4b486ef3454ef8a9f7b Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 20 Oct 2020 12:38:42 +0200 Subject: [PATCH 01/42] Fixed pagination counter --- pandora_console/extensions/module_groups.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 76225c0751..50a0de4d78 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -86,7 +86,6 @@ function mainModuleGroups() ); $info = $tree_group->getArray(); $info = groupview_plain_groups($info); - $counter = count($info); $offset = get_parameter('offset', 0); $agent_group_search = get_parameter('agent_group_search', ''); $module_group_search = get_parameter('module_group_search', ''); @@ -134,6 +133,8 @@ function mainModuleGroups() $ids_group = -1; } + $counter = count($info); + $condition_critical = modules_get_state_condition(AGENT_MODULE_STATUS_CRITICAL_ALERT); $condition_warning = modules_get_state_condition(AGENT_MODULE_STATUS_WARNING_ALERT); $condition_unknown = modules_get_state_condition(AGENT_MODULE_STATUS_UNKNOWN); From 6c16587b4099df4f0d1f972d111368a1adcad310 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 20 Oct 2020 12:58:25 +0200 Subject: [PATCH 02/42] fixed legend avg network interfaces --- pandora_console/include/functions.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 0147168ebf..a033f33115 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3753,7 +3753,16 @@ function series_type_graph_array($data, $show_elements_graph) $name_legend .= __('Unit ').' '; $name_legend .= $show_elements_graph['unit'].': '; } else { - $name_legend = $show_elements_graph['labels'][$value['agent_module_id']].': '; + if (isset($show_elements_graph['from_interface']) === true + && (bool) $show_elements_graph['from_interface'] === true + ) { + $label_interfaces = array_flip($show_elements_graph['modules_series']); + $name_legend = $show_elements_graph['labels'][$value['agent_module_id']][$label_interfaces[$value['agent_module_id']]].': '; + } else if (is_array($show_elements_graph['labels'][$value['agent_module_id']]) === true) { + $name_legend = 'Avg: '; + } else { + $name_legend = $show_elements_graph['labels'][$value['agent_module_id']].': '; + } } } else { if (strpos($key, 'baseline') !== false) { From 685acc6c204f21d16bb23ea75171f72657117fa0 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 20 Oct 2020 16:00:19 +0200 Subject: [PATCH 03/42] fixed report avg-min-max --- .../include/functions_reporting.php | 141 +++++++++++++++--- .../include/functions_reporting_html.php | 79 ++++++++-- pandora_console/include/styles/pandora.css | 1 + 3 files changed, 189 insertions(+), 32 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 0bfe96e864..674da95b09 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4979,6 +4979,16 @@ function reporting_agent_configuration($report, $content) } +/** + * Report Min, Max and Avg. + * + * @param array $report Info report. + * @param array $content Content report. + * @param string $type Type report. + * @param boolean $pdf Is pdf. + * + * @return array Data draw report. + */ function reporting_value($report, $content, $type, $pdf=false) { global $config; @@ -4993,16 +5003,17 @@ function reporting_value($report, $content, $type, $pdf=false) $return['type'] = 'min_value'; break; - case 'avg': - $return['type'] = 'avg_value'; - break; - case 'sum': $return['type'] = 'sumatory'; break; + + case 'avg': + default: + $return['type'] = 'avg_value'; + break; } - if (empty($content['name'])) { + if (empty($content['name']) === true) { switch ($type) { case 'max': $content['name'] = __('Max. Value'); @@ -5012,17 +5023,18 @@ function reporting_value($report, $content, $type, $pdf=false) $content['name'] = __('Min. Value'); break; - case 'avg': - $content['name'] = __('AVG. Value'); - break; - case 'sum': $content['name'] = __('Summatory'); break; + + case 'avg': + default: + $content['name'] = __('AVG. Value'); + break; } } - if ($config['metaconsole']) { + if (is_metaconsole() === true) { $id_meta = metaconsole_get_id_server($content['server_name']); $server = metaconsole_get_connection_by_id($id_meta); @@ -5060,14 +5072,15 @@ function reporting_value($report, $content, $type, $pdf=false) $return['agent_name'] = $agent_name; $return['module_name'] = $module_name; + $only_image = false; if ($pdf) { - $only_image = 1; + $only_image = true; } $params = [ 'agent_module_id' => $content['id_agent_module'], 'period' => $content['period'], - 'width' => '600px', + 'width' => '90%', 'pure' => false, 'date' => $report['datetime'], 'only_image' => $only_image, @@ -5086,6 +5099,7 @@ function reporting_value($report, $content, $type, $pdf=false) case 'max': case 'min': case 'avg': + default: $divisor = get_data_multiplier($unit); if ($content['lapse_calc'] == 0) { @@ -5107,6 +5121,7 @@ function reporting_value($report, $content, $type, $pdf=false) break; case 'avg': + default: $value = reporting_get_agentmodule_data_average( $content['id_agent_module'], $content['period'], @@ -5118,7 +5133,14 @@ function reporting_value($report, $content, $type, $pdf=false) if (!$config['simple_module_value']) { $formated_value = $value; } else { - $formated_value = format_for_graph($value, $config['graph_precision'], '.', ',', $divisor, $unit); + $formated_value = format_for_graph( + $value, + $config['graph_precision'], + '.', + ',', + $divisor, + $unit + ); } } else { $return['visual_format'] = $content['visual_format']; @@ -5126,17 +5148,51 @@ function reporting_value($report, $content, $type, $pdf=false) switch ($type) { case 'max': $params['force_interval'] = 'max_only'; - $value = format_for_graph(reporting_get_agentmodule_data_max($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision'], '.', ',', $divisor, $unit); + $value = format_for_graph( + reporting_get_agentmodule_data_max( + $content['id_agent_module'], + $content['period'], + $report['datetime'] + ), + $config['graph_precision'], + '.', + ',', + $divisor, + $unit + ); break; case 'min': $params['force_interval'] = 'min_only'; - $value = format_for_graph(reporting_get_agentmodule_data_min($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision'], '.', ',', $divisor, $unit); + $value = format_for_graph( + reporting_get_agentmodule_data_min( + $content['id_agent_module'], + $content['period'], + $report['datetime'] + ), + $config['graph_precision'], + '.', + ',', + $divisor, + $unit + ); break; case 'avg': + default: $params['force_interval'] = 'avg_only'; - $value = format_for_graph(reporting_get_agentmodule_data_average($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision'], '.', ',', $divisor, $unit); + $value = format_for_graph( + reporting_get_agentmodule_data_average( + $content['id_agent_module'], + $content['period'], + $report['datetime'] + ), + $config['graph_precision'], + '.', + ',', + $divisor, + $unit + ); break; } @@ -5166,15 +5222,49 @@ function reporting_value($report, $content, $type, $pdf=false) if ($i > $time_begin['utimestamp']) { switch ($type) { case 'max': - $row[__('Maximun')] = format_for_graph(reporting_get_agentmodule_data_max($content['id_agent_module'], $content['lapse'], ($i + $content['lapse'])), $config['graph_precision'], '.', ',', $divisor, $unit); + $row[__('Maximun')] = format_for_graph( + reporting_get_agentmodule_data_max( + $content['id_agent_module'], + $content['lapse'], + ($i + $content['lapse']) + ), + $config['graph_precision'], + '.', + ',', + $divisor, + $unit + ); break; case 'min': - $row[__('Maximun')] = format_for_graph(reporting_get_agentmodule_data_min($content['id_agent_module'], $content['lapse'], ($i + $content['lapse'])), $config['graph_precision'], '.', ',', $divisor, $unit); + $row[__('Maximun')] = format_for_graph( + reporting_get_agentmodule_data_min( + $content['id_agent_module'], + $content['lapse'], + ($i + $content['lapse']) + ), + $config['graph_precision'], + '.', + ',', + $divisor, + $unit + ); break; case 'avg': - $row[__('Maximun')] = format_for_graph(reporting_get_agentmodule_data_average($content['id_agent_module'], $content['lapse'], ($i + $content['lapse'])), $config['graph_precision'], '.', ',', $divisor, $unit); + default: + $row[__('Maximun')] = format_for_graph( + reporting_get_agentmodule_data_average( + $content['id_agent_module'], + $content['lapse'], + ($i + $content['lapse']) + ), + $config['graph_precision'], + '.', + ',', + $divisor, + $unit + ); break; } } else { @@ -5185,7 +5275,7 @@ function reporting_value($report, $content, $type, $pdf=false) } } - if ($config['metaconsole']) { + if (is_metaconsole() === true) { metaconsole_restore_db(); } @@ -5205,7 +5295,14 @@ function reporting_value($report, $content, $type, $pdf=false) } else { $divisor = get_data_multiplier($unit); - $formated_value = format_for_graph($value, $config['graph_precision'], '.', ',', $divisor, $unit); + $formated_value = format_for_graph( + $value, + $config['graph_precision'], + '.', + ',', + $divisor, + $unit + ); } break; } @@ -5215,7 +5312,7 @@ function reporting_value($report, $content, $type, $pdf=false) 'formated_value' => $formated_value, ]; - if ($config['metaconsole']) { + if (is_metaconsole() === true) { metaconsole_restore_db(); } diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 0de6b542bd..a9f7acadb9 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2965,8 +2965,26 @@ function reporting_html_min_value(&$table, $item, $mini) } -function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_empty=false) -{ +/** + * Htlm report AVg, min, Max, Only. + * + * @param array $table Table. + * @param array $item Data. + * @param boolean $mini Is mini. + * @param boolean $only_value Only value. + * @param boolean $check_empty Empty. + * @param integer $pdf PDF Mode. + * + * @return string Html output. + */ +function reporting_html_value( + $table, + $item, + $mini, + $only_value=false, + $check_empty=false, + $pdf=0 +) { global $config; if ($mini) { @@ -2975,8 +2993,12 @@ function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_e $font_size = $config['font_size_item_report'].'em'; } - if (isset($item['visual_format']) && $item['visual_format'] != 0 - && ($item['type'] == 'max_value' || $item['type'] == 'min_value' || $item['type'] == 'avg_value') + $return_pdf = ''; + + if (isset($item['visual_format']) === true && $item['visual_format'] != 0 + && ($item['type'] == 'max_value' + || $item['type'] == 'min_value' + || $item['type'] == 'avg_value') ) { $table2 = new stdClass(); $table2->width = '100%'; @@ -2998,6 +3020,7 @@ function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_e break; case 'avg_value': + default: $table2->head = [ __('Agent'), __('Module'), @@ -3025,15 +3048,28 @@ function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_e $table->colspan[2][0] = 3; $table->colspan[3][0] = 3; - array_push($table->data, html_print_table($table2, true)); + if ($pdf === 0) { + array_push($table->data, html_print_table($table2, true)); + } else { + $return_pdf .= html_print_table($table2, true); + } + unset($item['data'][0]); if ($item['visual_format'] != 1) { $value = $item['data'][1]['value']; - array_push($table->data, $value); - unset($item['data'][1]); + if ($pdf === 0) { + array_push($table->data, $value); + } else { + $style_div_pdf = 'text-align:center;margin-bottom:20px;'; + $return_pdf .= '
'; + $return_pdf .= $value; + $return_pdf .= '
'; + } } + unset($item['data'][1]); + if ($item['visual_format'] != 2) { $table1 = new stdClass(); $table1->width = '100%'; @@ -3053,6 +3089,7 @@ function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_e break; case 'avg_value': + default: $table1->head = [ __('Lapse'), __('Average'), @@ -3061,8 +3098,9 @@ function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_e } $table1->data = []; + $row = []; foreach ($item['data'] as $data) { - if (!is_numeric($data[__('Maximun')])) { + if (is_numeric($data[__('Maximun')]) === false) { $row = [ $data[__('Lapse')], $data[__('Maximun')], @@ -3070,7 +3108,12 @@ function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_e } else { $row = [ $data[__('Lapse')], - remove_right_zeros(number_format($data[__('Maximun')], $config['graph_precision'])), + remove_right_zeros( + number_format( + $data[__('Maximun')], + $config['graph_precision'] + ) + ), ]; } @@ -3080,10 +3123,22 @@ function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_e $table1->title = $item['title']; $table1->titleclass = 'title_table_pdf'; $table1->titlestyle = 'text-align:left;'; + if ($pdf === 0) { + array_push($table->data, html_print_table($table1, true)); + } else { + $return_pdf .= html_print_table($table1, true); + } + } - array_push($table->data, html_print_table($table1, true)); + if ($pdf !== 0) { + return $return_pdf; } } else { + if ($pdf !== 0) { + $table = new stdClass(); + $table->width = '100%'; + } + $table->colspan['data']['cell'] = 3; $table->cellstyle['data']['cell'] = 'text-align: left;'; @@ -3098,6 +3153,10 @@ function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_e } $table->data['data']['cell'] .= '

'; + + if ($pdf !== 0) { + return html_print_table($table, true); + } } } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 6b48ab13ae..5f0f9024c7 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -1480,6 +1480,7 @@ table.databox { padding: 9px 7px; font-weight: normal; color: #fff; + text-align: justify; } .databox > th * { From 3c95d1748225d76ee880b45774e79b0b35ccf712 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 20 Oct 2020 16:15:42 +0200 Subject: [PATCH 04/42] Fixed new_agent --- .../godmode/agentes/agent_manager.php | 17 ++++++++++------- .../godmode/agentes/modificar_agente.php | 1 - .../operation/agentes/estado_agente.php | 2 -- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index f4014de907..d1c7ae5224 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -149,7 +149,7 @@ if (is_ajax()) { ui_require_javascript_file('openlayers.pandora'); -$new_agent = (bool) get_parameter('new_agent'); +$new_agent = (empty($id_agente)) ? true : false; if (! isset($id_agente) && ! $new_agent) { db_pandora_audit('ACL Violation', 'Trying to access agent manager witout an agent'); @@ -1222,6 +1222,7 @@ ui_require_jquery_file('bgiframe'); $(document).ready (function() { + var $id_agent = ''; var previous_primary_group_select; $("#grupo").on('focus', function () { previous_primary_group_select = this.value; @@ -1276,12 +1277,14 @@ ui_require_jquery_file('bgiframe'); } }); - paint_qrcode( - "", - "#qr_code_agent_view", - 128, - 128 - ); + if (typeof $id_agent !== 'undefined' && $id_agent !== '0') { + paint_qrcode( + "", + "#qr_code_agent_view", + 128, + 128 + ); + } $("#text-agente").prop('readonly', true); }); diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index d4036bd68c..2a3620a504 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -754,7 +754,6 @@ if (check_acl($config['id_user'], 0, 'AW')) { // Create agent button. echo '
'; echo '
'; - html_print_input_hidden('new_agent', 1); html_print_submit_button( __('Create agent'), 'crt-2', diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index c0e6d147c5..58c392664f 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -902,7 +902,6 @@ if (!empty($table->data)) { if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AM')) { echo '
'; echo ''; - html_print_input_hidden('new_agent', 1); html_print_submit_button(__('Create agent'), 'crt', false, 'class="sub next"'); echo ''; echo '
'; @@ -913,7 +912,6 @@ if (!empty($table->data)) { ui_print_info_message([ 'no_close' => true, 'message' => __('There are no defined agents') ]); echo '
'; echo '
'; - html_print_input_hidden('new_agent', 1); html_print_submit_button(__('Create agent'), 'crt', false, 'class="sub next"'); echo '
'; echo '
'; From 033dd531a8a6a9c6c68cdf1f68f89893b345b519 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 20 Oct 2020 17:47:35 +0200 Subject: [PATCH 05/42] Minor fix all group empty label --- pandora_console/include/functions_html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 092044765c..02e31a4754 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -510,7 +510,7 @@ function html_print_select_groups( } } else { foreach ($selected as $k) { - $fields[$k] = groups_get_name($k); + $fields[$k] = groups_get_name($k, $returnAllGroup); } } From 25295f7b0b87d42ffdb75c2889673d15ba4371f7 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 20 Oct 2020 18:06:05 +0200 Subject: [PATCH 06/42] fixes --- pandora_console/include/functions_html.php | 8 ++++++++ .../lib/Dashboard/Widgets/top_n_events_by_group.php | 7 ++++++- .../lib/Dashboard/Widgets/top_n_events_by_module.php | 7 ++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 02e31a4754..025416ec47 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -510,8 +510,16 @@ function html_print_select_groups( } } else { foreach ($selected as $k) { + if ($k === null || $k === '') { + continue; + } + $fields[$k] = groups_get_name($k, $returnAllGroup); } + + if (empty($fields) === true && $returnAllGroup) { + $fields[0] = groups_get_name(null, true); + } } if (empty($nothing) === false) { diff --git a/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_group.php b/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_group.php index 2acd7f32fa..bd7d7d5886 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_group.php +++ b/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_group.php @@ -278,6 +278,11 @@ class TopNEventByGroupWidget extends Widget ]; // Groups. + $selected_groups = []; + if ($values['groupId']) { + $selected_groups = explode(',', $values['groupId'][0]); + } + $inputs[] = [ 'label' => __('Groups'), 'arguments' => [ @@ -285,7 +290,7 @@ class TopNEventByGroupWidget extends Widget 'name' => 'groupId[]', 'returnAllGroup' => true, 'privilege' => 'AR', - 'selected' => explode(',', $values['groupId'][0]), + 'selected' => $selected_groups, 'return' => true, 'multiple' => true, ], diff --git a/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_module.php b/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_module.php index 4bbaee22a8..148ace6aac 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_module.php +++ b/pandora_console/include/lib/Dashboard/Widgets/top_n_events_by_module.php @@ -277,6 +277,11 @@ class TopNEventByModuleWidget extends Widget ], ]; + $selected_groups = []; + if ($values['groupId']) { + $selected_groups = explode(',', $values['groupId'][0]); + } + // Groups. $inputs[] = [ 'label' => __('Groups'), @@ -285,7 +290,7 @@ class TopNEventByModuleWidget extends Widget 'name' => 'groupId[]', 'returnAllGroup' => true, 'privilege' => 'AR', - 'selected' => explode(',', $values['groupId'][0]), + 'selected' => $selected_groups, 'return' => true, 'multiple' => true, ], From 4babcbe647b638ca1a57303606efbc5adc0c8262 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 20 Oct 2020 18:25:04 +0200 Subject: [PATCH 07/42] Forced recursion while selecting All group - group_alert_report --- .../reporting/reporting_builder.item_editor.php | 14 ++++++++++++++ pandora_console/include/functions_reporting.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index db1303d907..dfdc05c1fc 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -3744,6 +3744,19 @@ $(document).ready (function () { $("#combo_group").change ( function () { + + // Alert report group must show all matches when selecting All group + // ignoring 'recursion' option. #6497. + if ($('#type').val() == 'alert_report_group' + && $("#combo_group").val() == 0 + ) { + $('#checkbox-recursion').attr('disabled',true) + $('#checkbox-recursion').attr('checked','checked') + } else { + $('#checkbox-recursion').removeAttr('checked') + $('#checkbox-recursion').removeAttr('disabled') + } + $("#id_agents").html(''); $("#id_agents2").html(''); $("#module").html(''); @@ -3772,6 +3785,7 @@ $(document).ready (function () { ); } ); + $("#combo_group").change(); $("#checkbox-recursion").change ( function () { diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 0bfe96e864..3c5aa9c66b 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3912,7 +3912,7 @@ function reporting_alert_report_group($report, $content) $agent_modules = alerts_get_agent_modules( $content['id_group'], - $content['recursion'] + (((string) $content['id_group'] === '0') ? true : $content['recursion']) ); if (empty($alerts)) { From 73ff2cff9dd0d1f4aea677cbbfb7e7503fd5dd5f Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 20 Oct 2020 18:30:53 +0200 Subject: [PATCH 08/42] fixed error report selector modules in metaconsole --- .../reporting_builder.item_editor.php | 6 +- .../godmode/reporting/reporting_builder.php | 14 ++- pandora_console/include/ajax/agent.php | 99 +++++++------------ 3 files changed, 47 insertions(+), 72 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index db1303d907..4bb76a00fa 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -223,8 +223,9 @@ switch ($action) { $server_name = $item['server_name']; // Metaconsole db connection. - if ($meta && !empty($server_name)) { + if ($meta && empty($server_name) === false) { $connection = metaconsole_get_connection($server_name); + $server_id = $connection['id']; if (metaconsole_load_external_db($connection) != NOERR) { continue; } @@ -1383,8 +1384,7 @@ $class = 'databox filters'; html_print_input_hidden('id_agent', $idAgent); html_print_input_hidden('server_name', $server_name); - html_print_input_hidden('server_id', $server_name); - html_print_input_hidden('id_server', ''); + html_print_input_hidden('server_id', $server_id); $params = []; $params['show_helptip'] = false; diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 8ac3a11e37..6857a2cd39 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1380,11 +1380,12 @@ switch ($action) { switch ($action) { case 'update': $values = []; - $server_name = get_parameter('server_id'); - if (is_metaconsole() && $server_name != '') { - $id_meta = metaconsole_get_id_server($server_name); + $server_id = get_parameter('server_id', 0); + if (is_metaconsole() === true + && empty($server_id) === false + ) { $connection = metaconsole_get_connection_by_id( - $id_meta + $server_id ); metaconsole_connect($connection); $values['server_name'] = $connection['server_name']; @@ -1811,7 +1812,6 @@ switch ($action) { 'combo_modulegroup' ); $values['id_group'] = get_parameter('combo_group'); - $values['server_name'] = get_parameter('server_name'); if ($values['server_name'] == '') { $values['server_name'] = get_parameter( @@ -1867,9 +1867,7 @@ switch ($action) { ); // If metaconsole is activated. - if ($config['metaconsole'] == 1 - && defined('METACONSOLE') - ) { + if (is_metaconsole() === true) { if (($values['type'] == 'custom_graph') || ($values['type'] == 'automatic_custom_graph') ) { diff --git a/pandora_console/include/ajax/agent.php b/pandora_console/include/ajax/agent.php index 698ab7df9b..4db3fbbbd9 100644 --- a/pandora_console/include/ajax/agent.php +++ b/pandora_console/include/ajax/agent.php @@ -216,7 +216,7 @@ if ($search_agents && (!is_metaconsole() || $force_local)) { } else if ($search_agents && is_metaconsole()) { $id_agent = (int) get_parameter('id_agent'); $string = (string) get_parameter('q'); - // q is what autocomplete plugin gives + // Q is what autocomplete plugin gives. $id_group = (int) get_parameter('id_group', -1); $addedItems = html_entity_decode((string) get_parameter('add')); $addedItems = json_decode($addedItems); @@ -236,6 +236,7 @@ if ($search_agents && (!is_metaconsole() || $force_local)) { 'alias', 'direccion', 'id_tmetaconsole_setup AS id_server', + 'server_name', ]; $filter = []; @@ -254,36 +255,33 @@ if ($search_agents && (!is_metaconsole() || $force_local)) { case 'enabled': $filter['disabled'] = 0; break; + + default: + // Not possible. + break; } - if (!empty($id_agent)) { + if (empty($id_agent) === false) { $filter['id_agente'] = $id_agent; } - if (!empty($string)) { + if (empty($string) === false) { // Get agents for only the alias. $filter_alias = $filter; - switch ($config['dbtype']) { - case 'mysql': - $filter_alias[] = '(alias COLLATE utf8_general_ci LIKE "%'.$string.'%")'; - break; + $filter_alias[] = '(alias COLLATE utf8_general_ci LIKE "%'.$string.'%")'; - case 'postgresql': - $filter_alias[] = '(alias LIKE \'%'.$string.'%\')'; - break; + $agents = db_get_all_rows_filter( + 'tmetaconsole_agent', + $filter_alias, + $fields + ); - case 'oracle': - $filter_alias[] = '(UPPER(alias) LIKE UPPER(\'%'.$string.'%\'))'; - break; - } - - $agents = db_get_all_rows_filter('tmetaconsole_agent', $filter_alias, $fields); if ($agents !== false) { foreach ($agents as $agent) { $data[] = [ 'id' => $agent['id_agente'], 'name' => io_safe_output($agent['nombre']), - 'alias' => io_safe_output($agent['alias']), + 'alias' => io_safe_output($agent['alias']).' ('.io_safe_output($agent['server_name']).')', 'ip' => io_safe_output($agent['direccion']), 'id_server' => $agent['id_server'], 'filter' => 'alias', @@ -293,27 +291,20 @@ if ($search_agents && (!is_metaconsole() || $force_local)) { // Get agents for only the name. $filter_agents = $filter; - switch ($config['dbtype']) { - case 'mysql': - $filter_agents[] = '(alias COLLATE utf8_general_ci NOT LIKE "%'.$string.'%" AND nombre COLLATE utf8_general_ci LIKE "%'.$string.'%")'; - break; + $filter_agents[] = '(alias COLLATE utf8_general_ci NOT LIKE "%'.$string.'%" AND nombre COLLATE utf8_general_ci LIKE "%'.$string.'%")'; - case 'postgresql': - $filter_agents[] = '(alias NOT LIKE \'%'.$string.'%\' AND nombre LIKE \'%'.$string.'%\')'; - break; + $agents = db_get_all_rows_filter( + 'tmetaconsole_agent', + $filter_agents, + $fields + ); - case 'oracle': - $filter_agents[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) LIKE UPPER(\'%'.$string.'%\'))'; - break; - } - - $agents = db_get_all_rows_filter('tmetaconsole_agent', $filter_agents, $fields); if ($agents !== false) { foreach ($agents as $agent) { $data[] = [ 'id' => $agent['id_agente'], 'name' => io_safe_output($agent['nombre']), - 'alias' => io_safe_output($agent['alias']), + 'alias' => io_safe_output($agent['alias']).' ('.io_safe_output($agent['server_name']).')', 'ip' => io_safe_output($agent['direccion']), 'id_server' => $agent['id_server'], 'filter' => 'agent', @@ -321,29 +312,22 @@ if ($search_agents && (!is_metaconsole() || $force_local)) { } } - // Get agents for only the address + // Get agents for only the address. $filter_address = $filter; - switch ($config['dbtype']) { - case 'mysql': - $filter_address[] = '(alias COLLATE utf8_general_ci NOT LIKE "%'.$string.'%" AND nombre COLLATE utf8_general_ci NOT LIKE "%'.$string.'%" AND direccion LIKE "%'.$string.'%")'; - break; + $filter_address[] = '(alias COLLATE utf8_general_ci NOT LIKE "%'.$string.'%" AND nombre COLLATE utf8_general_ci NOT LIKE "%'.$string.'%" AND direccion LIKE "%'.$string.'%")'; - case 'postgresql': - $filter_address[] = '(alias NOT LIKE \'%'.$string.'%\' AND nombre NOT LIKE \'%'.$string.'%\' AND direccion LIKE \'%'.$string.'%\')'; - break; + $agents = db_get_all_rows_filter( + 'tmetaconsole_agent', + $filter_address, + $fields + ); - case 'oracle': - $filter_address[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(direccion) LIKE UPPER(\'%'.$string.'%\'))'; - break; - } - - $agents = db_get_all_rows_filter('tmetaconsole_agent', $filter_address, $fields); if ($agents !== false) { foreach ($agents as $agent) { $data[] = [ 'id' => $agent['id_agente'], 'name' => io_safe_output($agent['nombre']), - 'alias' => io_safe_output($agent['alias']), + 'alias' => io_safe_output($agent['alias']).' ('.io_safe_output($agent['server_name']).')', 'ip' => io_safe_output($agent['direccion']), 'id_server' => $agent['id_server'], 'filter' => 'address', @@ -351,29 +335,22 @@ if ($search_agents && (!is_metaconsole() || $force_local)) { } } - // Get agents for only the description + // Get agents for only the description. $filter_description = $filter; - switch ($config['dbtype']) { - case 'mysql': - $filter_description[] = '(alias COLLATE utf8_general_ci NOT LIKE "%'.$string.'%" AND nombre COLLATE utf8_general_ci NOT LIKE "%'.$string.'%" AND direccion NOT LIKE "%'.$string.'%" AND comentarios LIKE "%'.$string.'%")'; - break; + $filter_description[] = '(alias COLLATE utf8_general_ci NOT LIKE "%'.$string.'%" AND nombre COLLATE utf8_general_ci NOT LIKE "%'.$string.'%" AND direccion NOT LIKE "%'.$string.'%" AND comentarios LIKE "%'.$string.'%")'; - case 'postgresql': - $filter_description[] = '(alias NOT LIKE \'%'.$string.'%\' AND nombre NOT LIKE \'%'.$string.'%\' AND direccion NOT LIKE \'%'.$string.'%\' AND comentarios LIKE \'%'.$string.'%\')'; - break; + $agents = db_get_all_rows_filter( + 'tmetaconsole_agent', + $filter_description, + $fields + ); - case 'oracle': - $filter_description[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(direccion) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(comentarios) LIKE UPPER(\'%'.$string.'%\'))'; - break; - } - - $agents = db_get_all_rows_filter('tmetaconsole_agent', $filter_description, $fields); if ($agents !== false) { foreach ($agents as $agent) { $data[] = [ 'id' => $agent['id_agente'], 'name' => io_safe_output($agent['nombre']), - 'alias' => io_safe_output($agent['alias']), + 'alias' => io_safe_output($agent['alias']).' ('.io_safe_output($agent['server_name']).')', 'ip' => io_safe_output($agent['direccion']), 'id_server' => $agent['id_server'], 'filter' => 'description', From 42cca865acc2bc82e7201a14d1ba5cf5b258160b Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 21 Oct 2020 11:38:57 +0200 Subject: [PATCH 09/42] groups_get_children and propagate update --- pandora_console/extensions/agents_modules.php | 2 +- .../godmode/agentes/modificar_agente.php | 2 +- .../agentes/planned_downtime.editor.php | 2 +- .../godmode/massive/massive_delete_alerts.php | 2 +- .../godmode/reporting/map_builder.php | 2 +- .../reporting/visual_console_favorite.php | 2 +- .../include/class/CredentialStore.class.php | 2 +- .../include/class/NetworkMap.class.php | 2 +- pandora_console/include/functions_agents.php | 7 +- pandora_console/include/functions_api.php | 2 +- .../include/functions_custom_fields.php | 2 +- pandora_console/include/functions_events.php | 42 ++---- pandora_console/include/functions_groups.php | 120 ++++-------------- .../include/functions_networkmap.php | 2 +- .../include/functions_reporting.php | 2 +- pandora_console/include/functions_tags.php | 12 +- .../operation/agentes/estado_agente.php | 4 +- .../operation/agentes/ver_agente.php | 14 +- .../operation/events/events.build_query.php | 2 +- 19 files changed, 78 insertions(+), 147 deletions(-) diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index 8aa032c9a8..0a3cc2a382 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -668,7 +668,7 @@ function mainAgentsModules() if ($recursion) { $filter_groups['id_grupo'] = array_merge( $group_id, - groups_get_id_recursive($group_id, true) + groups_get_children_ids($group_id, true) ); } else { $filter_groups['id_grupo'] = $group_id; diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index d4036bd68c..8238d1636b 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -408,7 +408,7 @@ if ($ag_group > 0) { $ag_groups = []; $ag_groups = (array) $ag_group; if ($recursion) { - $ag_groups = groups_get_id_recursive($ag_group, true); + $ag_groups = groups_get_children_ids($ag_group, true); } $user_groups_to_sql = implode(',', $ag_groups); diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index b3e7029dbd..4aceac701e 100644 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -877,7 +877,7 @@ if ($id_downtime > 0) { $filter_cond = ''; if ($filter_group > 0) { if ($recursion) { - $rg = groups_get_id_recursive($filter_group, true); + $rg = groups_get_children_ids($filter_group, true); $filter_cond .= ' AND id_grupo IN ('; $i = 0; diff --git a/pandora_console/godmode/massive/massive_delete_alerts.php b/pandora_console/godmode/massive/massive_delete_alerts.php index c9bcda46ba..c5407ed365 100755 --- a/pandora_console/godmode/massive/massive_delete_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_alerts.php @@ -40,7 +40,7 @@ if (is_ajax()) { $keys_prefix = (string) get_parameter('keys_prefix', ''); if ($recursion) { - $groups = groups_get_id_recursive($id_group, true); + $groups = groups_get_children_ids($id_group, true); } else { $groups = [$id_group]; } diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 9f8b8f0162..482b995f8f 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -278,7 +278,7 @@ if ($ag_group > 0) { $ag_groups = []; $ag_groups = (array) $ag_group; if ($recursion) { - $ag_groups = groups_get_id_recursive($ag_group, true); + $ag_groups = groups_get_children_ids($ag_group, true); } } diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index b9f4fe28d7..253218431f 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -143,7 +143,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) { $ag_groups = []; $ag_groups = (array) $ag_group; if ($recursion) { - $ag_groups = groups_get_id_recursive($ag_group, true); + $ag_groups = groups_get_children_ids($ag_group, true); } } else if ($own_info['is_admin']) { $returnAllGroups = 1; diff --git a/pandora_console/include/class/CredentialStore.class.php b/pandora_console/include/class/CredentialStore.class.php index 073f0831a3..d14314a6b4 100644 --- a/pandora_console/include/class/CredentialStore.class.php +++ b/pandora_console/include/class/CredentialStore.class.php @@ -248,7 +248,7 @@ class CredentialStore extends Wizard ); } else { $groups = [ $filter['filter_id_group'] ]; - $childrens = groups_get_childrens($id_group, null, true); + $childrens = groups_get_children($id_group, null, true); if (!empty($childrens)) { foreach ($childrens as $child) { $groups[] = (int) $child['id_grupo']; diff --git a/pandora_console/include/class/NetworkMap.class.php b/pandora_console/include/class/NetworkMap.class.php index a14e2b80c4..0eaea52134 100644 --- a/pandora_console/include/class/NetworkMap.class.php +++ b/pandora_console/include/class/NetworkMap.class.php @@ -810,7 +810,7 @@ class NetworkMap $filter['id_grupo'] = $this->idGroup; } else { // Show current group and children. - $childrens = groups_get_childrens($this->idGroup, null, true); + $childrens = groups_get_children($this->idGroup, null, true); if (!empty($childrens)) { $childrens = array_keys($childrens); diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index beff278dc1..8ba751042c 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1108,11 +1108,14 @@ function agents_get_group_agents( foreach ($id_group as $parent) { $id_group = array_merge( $id_group, - groups_get_id_recursive($parent, false) + groups_get_children_ids($parent, $noACL) ); } } else { - $id_group = groups_get_id_recursive($id_group, false); + $id_group = array_merge( + [$id_group], + groups_get_children_ids($id_group, $noACL) + ); } // Check available groups for target user only if asking for 'All' group. diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 6401910faa..863eaf0b3f 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1973,7 +1973,7 @@ function api_get_all_agents($thrash1, $thrash2, $other, $returnType) $ag_groups = $other['data'][1]; // Recursion. if ($other['data'][6] === '1') { - $ag_groups = groups_get_id_recursive($ag_groups, true); + $ag_groups = groups_get_children_ids($ag_groups, true); } $ag_groups = implode(',', (array) $ag_groups); diff --git a/pandora_console/include/functions_custom_fields.php b/pandora_console/include/functions_custom_fields.php index d1f661e874..c15b0cae95 100644 --- a/pandora_console/include/functions_custom_fields.php +++ b/pandora_console/include/functions_custom_fields.php @@ -367,7 +367,7 @@ function agent_counters_custom_fields($filters) if ($filters['group']) { // Recursion check acl. if ($filters['recursion']) { - $recursion_groups = groups_get_id_recursive($filters['group'], true); + $recursion_groups = groups_get_children_ids($filters['group'], true); if (!users_can_manage_group_all('AR')) { if (isset($user_groups) && is_array($user_groups)) { $groups_intersect = array_intersect($user_groups, $recursion_groups); diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 7a337fbdab..cf486b8acf 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -871,37 +871,23 @@ function events_get_all( } $groups = $filter['id_group_filter']; - if (isset($groups) && $groups > 0) { - $propagate = db_get_value( - 'propagate', - 'tgrupo', - 'id_grupo', - $groups - ); + if (isset($groups) === true && $groups > 0) { + $children = groups_get_children($groups); - if (!$propagate && isset($groups)) { - $sql_filters[] = sprintf( - ' AND (te.id_grupo = %d OR tasg.id_group = %d)', - $groups, - $groups - ); - } else { - $children = groups_get_children($groups); - $_groups = [ $groups ]; - if (!empty($children)) { - foreach ($children as $child) { - $_groups[] = (int) $child['id_grupo']; - } + $_groups = [ $groups ]; + if (empty($children) === false) { + foreach ($children as $child) { + $_groups[] = (int) $child['id_grupo']; } - - $groups = $_groups; - - $sql_filters[] = sprintf( - ' AND (te.id_grupo IN (%s) OR tasg.id_group IN (%s))', - join(',', $groups), - join(',', $groups) - ); } + + $groups = $_groups; + + $sql_filters[] = sprintf( + ' AND (te.id_grupo IN (%s) OR tasg.id_group IN (%s))', + join(',', $groups), + join(',', $groups) + ); } // Skip system messages if user is not PM. diff --git a/pandora_console/include/functions_groups.php b/pandora_console/include/functions_groups.php index b6c1a5e6c9..7b733b9c8d 100644 --- a/pandora_console/include/functions_groups.php +++ b/pandora_console/include/functions_groups.php @@ -265,49 +265,21 @@ function groups_check_used($idGroup) } -/** - * Return a array of id_group of childrens (to branches down) - * - * @param integer $parent The id_group parent to search the childrens. - * @param array $groups The groups, its for optimize the querys to DB. - */ -function groups_get_childrens_ids($parent, $groups=null) -{ - if (empty($groups)) { - $groups = db_get_all_rows_in_table('tgrupo'); - } - - $return = ''; - - foreach ($groups as $key => $group) { - if ($group['id_grupo'] == 0) { - continue; - } - - if ($group['parent'] == $parent) { - $return .= $group['id_grupo'].','; - $propagate = db_get_value('propagate', 'tgrupo', 'id_grupo', $group['id_grupo']); - if ($propagate) { - $return .= groups_get_childrens_ids($group['id_grupo']); - } - } - } - - return $return; -} - - /** * Return a array of id_group of children of given parent. * * @param integer $parent The id_grupo parent to search its children. * @param array $ignorePropagate Ignore propagate. + * @param string $privilege Default privilege. + * + * @return array Of Groups, children of $parent. */ -function groups_get_children($parent, $ignorePropagate=false) +function groups_get_children($parent, $ignorePropagate=false, $privilege='AR') { static $groups; + static $user_groups; - if (empty($groups)) { + if (empty($groups) === true) { $aux_groups = []; $groups = db_get_all_rows_in_table('tgrupo'); foreach ($groups as $key => $value) { @@ -317,13 +289,29 @@ function groups_get_children($parent, $ignorePropagate=false) $groups = $aux_groups; } + if (empty($user_groups) === true) { + $user_groups = users_get_groups(false, $privilege, true); + } + + // Admin see always all groups. + $ignorePropagate = users_is_admin() || $ignorePropagate; + $return = []; foreach ($groups as $key => $g) { if ($g['id_grupo'] == 0) { continue; } - if ($ignorePropagate || $parent == 0 || $groups[$parent]['propagate']) { + // IgnorePropagate will be true if user can access child. + $allowed = $ignorePropagate || array_key_exists( + $g['id_grupo'], + $user_groups + ); + + if ($allowed === true + || (int) $parent === 0 + || (bool) $groups[$parent]['propagate'] === true + ) { if ($g['parent'] == $parent) { $return += [$g['id_grupo'] => $g]; if ($g['propagate'] || $ignorePropagate) { @@ -340,38 +328,6 @@ function groups_get_children($parent, $ignorePropagate=false) } -/** - * @deprecated This is not working. Expects 'propagate' on CHILD not on PARENT!!! - * - * Return a array of id_group of childrens (to branches down) - * - * @param integer $parent The id_group parent to search the childrens. - * @param array $groups The groups, its for optimize the querys to DB. - */ -function groups_get_childrens($parent, $groups=null, $onlyPropagate=false) -{ - if (empty($groups)) { - $groups = db_get_all_rows_in_table('tgrupo'); - } - - $return = []; - - foreach ($groups as $key => $group) { - if ($group['id_grupo'] == 0) { - continue; - } - - if ($group['propagate'] || $onlyPropagate) { - if ($group['parent'] == $parent) { - $return = ($return + [$group['id_grupo'] => $group] + groups_get_childrens($group['id_grupo'], $groups, $onlyPropagate)); - } - } - } - - return $return; -} - - /** * Return a array of id_group of parents (to roots up). * @@ -541,35 +497,11 @@ function groups_get_all($groupWithAgents=false) * * @return array with all result groups */ -function groups_get_id_recursive($id_parent, $all=false) +function groups_get_children_ids($id_parent, $all=false) { - $return = []; + $return = groups_get_children($id_parent, $all); - $return = array_merge($return, [$id_parent]); - - // Check propagate - $propagate = db_get_value_filter('propagate', 'tgrupo', ['id_grupo' => $id_parent]); - - if (($propagate == 1) || $all) { - $children = db_get_all_rows_filter('tgrupo', ['parent' => $id_parent, 'disabled' => 0], ['id_grupo']); - - if ($children === false) { - $children = []; - } else { - $temp = []; - foreach ($children as $id_children) { - $temp = array_merge($temp, [$id_children['id_grupo']]); - } - - $children = $temp; - } - - foreach ($children as $id_children) { - $return = array_merge($return, groups_get_id_recursive($id_children, $all)); - } - } - - return $return; + return array_keys($return); } diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index 56172331c6..bd5152576d 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -319,7 +319,7 @@ function networkmap_generate_dot( if ($dont_show_subgroups) { $filter['id_grupo'] = $group; } else { - $childrens = groups_get_childrens($group, null, true); + $childrens = groups_get_children($group, null, true); if (!empty($childrens)) { $childrens = array_keys($childrens); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 0bfe96e864..c480969f16 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -9072,7 +9072,7 @@ function reporting_get_group_stats($id_group=0, $access='AR') $covered_groups = []; $group_array = []; foreach ($id_group as $group) { - $children = groups_get_childrens($group); + $children = groups_get_children($group); // Show empty groups only if they have children with agents // $group_array = array(); diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index 5aace86006..fe36bc34fa 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -941,7 +941,7 @@ function tags_get_acl_tags_event_condition( } // Group condition (The module belongs to an agent of the group X) - // $group_condition = sprintf('id_grupo IN (%s)', implode(',', array_values(groups_get_id_recursive($group_id, true))));. + // $group_condition = sprintf('id_grupo IN (%s)', implode(',', array_values(groups_get_children_ids($group_id, true))));. $group_condition = '('.$id_grupo_table_pretag.'id_grupo = '.$group_id.' OR '.$alt_id_grupo_table_pretag.'id_group = '.$group_id.')'; // Tags condition (The module has at least one of the restricted tags). @@ -1350,7 +1350,7 @@ function tags_checks_event_acl($id_user, $id_group, $access, $tags=[], $children foreach ($user_tags as $user_tag) { $tags_user = $user_tag['tags']; $id_group_user = $user_tag['id_grupo']; - $childrens = groups_get_childrens($id_group_user, null, true); + $childrens = groups_get_children($id_group_user, null, true); if (empty($childrens)) { $group_ids = $id_group_user; @@ -1421,7 +1421,7 @@ function tags_get_agents_counter($id_tag, $groups_and_tags=[], $agent_filter=[], $tags_arr = explode(',', $tags); foreach ($tags_arr as $tag) { if ($tag == $id_tag) { - $hierarchy_groups = groups_get_id_recursive($group_id); + $hierarchy_groups = groups_get_children_ids($group_id); $groups_id = array_merge($groups_id, $hierarchy_groups); } } @@ -1923,7 +1923,7 @@ function tags_get_monitors_counter($id_tag, $groups_and_tags=[], $agent_filter=[ $tags_arr = explode(',', $tags); foreach ($tags_arr as $tag) { if ($tag == $id_tag) { - $hierarchy_groups = groups_get_id_recursive($group_id); + $hierarchy_groups = groups_get_children_ids($group_id); $groups_id = array_merge($groups_id, $hierarchy_groups); } } @@ -2219,7 +2219,7 @@ function tags_monitors_fired_alerts($id_tag, $groups_and_tags=[], $id_agente=fal $tags_arr = explode(',', $tags); foreach ($tags_arr as $tag) { if ($tag == $id_tag) { - $hierarchy_groups = groups_get_id_recursive($group_id); + $hierarchy_groups = groups_get_children_ids($group_id); $groups_id = array_merge($groups_id, $hierarchy_groups); } } @@ -2283,7 +2283,7 @@ function tags_get_monitors_alerts($id_tag, $groups_and_tags=[], $id_agente=false $tags_arr = explode(',', $tags); foreach ($tags_arr as $tag) { if ($tag == $id_tag) { - $hierarchy_groups = groups_get_id_recursive($group_id); + $hierarchy_groups = groups_get_children_ids($group_id); $groups_id = array_merge($groups_id, $hierarchy_groups); } } diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index c0e6d147c5..8144ea524a 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -546,7 +546,7 @@ if (!empty($search_custom)) { if ($group_id > 0) { $groups = [$group_id]; if ($recursion) { - $groups = groups_get_id_recursive($group_id, true); + $groups = groups_get_children_ids($group_id, true); } } else { $groups = []; @@ -576,7 +576,7 @@ if ($strict_user) { if ($group_id > 0) { $groups = [$group_id]; if ($recursion) { - $groups = groups_get_id_recursive($group_id, true); + $groups = groups_get_children_ids($group_id, true); } $filter['id_group'] = implode(',', $groups); diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index e86960938a..eb4a5186bf 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -146,14 +146,24 @@ if (is_ajax()) { // Perform search. $agents = agents_get_group_agents( + // Id_group. $id_group, + // Search. $filter, + // Case. 'lower', - false, + // NoACL. + true, + // ChildGroups. $recursion, + // Serialized. false, + // Separator. '|', - $cluster_mode + // Add_alert_bulk_op. + $cluster_mode, + // Force_serialized. + false ); if (empty($agents)) { diff --git a/pandora_console/operation/events/events.build_query.php b/pandora_console/operation/events/events.build_query.php index b1b4051e7f..0f68cbfb5f 100755 --- a/pandora_console/operation/events/events.build_query.php +++ b/pandora_console/operation/events/events.build_query.php @@ -28,7 +28,7 @@ if ($id_group > 0) { if ($propagate) { $childrens_ids = [$id_group]; - $childrens = groups_get_childrens($id_group, null, true); + $childrens = groups_get_children($id_group, null, true); if (!empty($childrens)) { foreach ($childrens as $child) { From 82f4e1d9876601517f8757ee17035c6b94d087ca Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 21 Oct 2020 12:14:40 +0200 Subject: [PATCH 10/42] fixed error report SLA CSV and Visuals --- .../include/functions_reporting_html.php | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 0de6b542bd..20d1d4b51e 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -501,6 +501,8 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0) $table1->head[5] = __('Status'); $table1->headstyle = []; + $table1->headstyle[0] = 'text-align: left'; + $table1->headstyle[1] = 'text-align: left'; $table1->headstyle[2] = 'text-align: right'; $table1->headstyle[3] = 'text-align: right'; $table1->headstyle[4] = 'text-align: right'; @@ -536,6 +538,8 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0) $table2->head[6] = __('Downtime'); $table2->headstyle = []; + $table2->headstyle[0] = 'text-align: left'; + $table2->headstyle[1] = 'text-align: left'; $table2->headstyle[2] = 'text-align: right'; $table2->headstyle[3] = 'text-align: right'; $table2->headstyle[4] = 'text-align: right'; @@ -548,7 +552,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0) $table3->align = []; $table3->align[0] = 'left'; - $table3->align[1] = 'left'; + $table3->align[1] = 'right'; $table3->align[2] = 'right'; $table3->align[3] = 'right'; $table3->align[4] = 'right'; @@ -565,6 +569,8 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0) $table3->head[4] = __('Checks Unknown'); $table3->headstyle = []; + $table3->headstyle[0] = 'text-align: left'; + $table3->headstyle[1] = 'text-align: right'; $table3->headstyle[2] = 'text-align: right'; $table3->headstyle[3] = 'text-align: right'; $table3->headstyle[4] = 'text-align: right'; @@ -721,23 +727,23 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0) true ); } else { - $table1->title = $item['title']; - $table1->titleclass = 'title_table_pdf'; - $table1->titlestyle = 'text-align:left;'; + // $table1->title = $item['title']; + // $table1->titleclass = 'title_table_pdf'; + // $table1->titlestyle = 'text-align:left;'; $return_pdf .= html_print_table( $table1, true ); - $table2->title = $item['title']; - $table2->titleclass = 'title_table_pdf'; - $table2->titlestyle = 'text-align:left;'; + // $table2->title = $item['title']; + // $table2->titleclass = 'title_table_pdf'; + // $table2->titlestyle = 'text-align:left;'; $return_pdf .= html_print_table( $table2, true ); - $table3->title = $item['title']; - $table3->titleclass = 'title_table_pdf'; - $table3->titlestyle = 'text-align:left;'; + // $table3->title = $item['title']; + // $table3->titleclass = 'title_table_pdf'; + // $table3->titlestyle = 'text-align:left;'; $return_pdf .= html_print_table( $table3, true @@ -782,9 +788,9 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0) true ); } else { - $table1->title = $item['title']; - $table1->titleclass = 'title_table_pdf'; - $table1->titlestyle = 'text-align:left;'; + // $table1->title = $item['title']; + // $table1->titleclass = 'title_table_pdf'; + // $table1->titlestyle = 'text-align:left;'; $return_pdf .= html_print_table( $table1, true @@ -3617,9 +3623,9 @@ function reporting_html_availability($table, $item, $pdf=0) $data[0] = html_print_table($table1, true); array_push($table->data, $data); } else { - $table1->title = $item['title']; - $table1->titleclass = 'title_table_pdf'; - $table1->titlestyle = 'text-align:left;'; + // $table1->title = $item['title']; + // $table1->titleclass = 'title_table_pdf'; + // $table1->titlestyle = 'text-align:left;'; $return_pdf .= html_print_table($table1, true); } @@ -3629,9 +3635,9 @@ function reporting_html_availability($table, $item, $pdf=0) $data2[0] = html_print_table($table2, true); array_push($table->data, $data2); } else { - $table2->title = $item['title']; - $table2->titleclass = 'title_table_pdf'; - $table2->titlestyle = 'text-align:left;'; + // $table2->title = $item['title']; + // $table2->titleclass = 'title_table_pdf'; + // $table2->titlestyle = 'text-align:left;'; $return_pdf .= html_print_table($table2, true); } } @@ -3699,9 +3705,9 @@ function reporting_html_availability($table, $item, $pdf=0) ); array_push($table->data, $data); } else { - $table1->title = $item['title']; - $table1->titleclass = 'title_table_pdf'; - $table1->titlestyle = 'text-align:left;'; + // $table1->title = $item['title']; + // $table1->titleclass = 'title_table_pdf'; + // $table1->titlestyle = 'text-align:left;'; $return_pdf .= html_print_table( $table1, true From 6b25ae60044827fc5d40399f1b91d62a34d9fa3b Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 21 Oct 2020 13:23:17 +0200 Subject: [PATCH 11/42] improved agent_module report (CSV) --- pandora_console/include/functions.php | 67 +++++++++++++++++++ pandora_console/include/functions_agents.php | 19 +++--- .../operation/agentes/ver_agente.php | 2 +- 3 files changed, 78 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 0147168ebf..b14ad3e7b2 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1342,6 +1342,73 @@ function get_priority_name($priority) } +/** + * Translates status into string. + * + * @param integer $status Agent status. + * + * @return string Translation. + */ +function get_agent_status_string($status) +{ + switch ($status) { + case AGENT_STATUS_CRITICAL: + return __('CRITICAL'); + + case AGENT_STATUS_WARNING: + return __('WARNING'); + + case AGENT_STATUS_ALERT_FIRED: + return __('ALERT FIRED'); + + case AGENT_STATUS_NOT_INIT: + return __('NO DATA'); + + case AGENT_STATUS_NORMAL: + return __('NORMAL'); + + case AGENT_STATUS_UNKNOWN: + default: + return __('UNKNOWN'); + } +} + + +/** + * Translates status into string. + * + * @param integer $status Module status. + * + * @return string Translation. + */ +function get_module_status_string($status) +{ + switch ($status) { + case AGENT_MODULE_STATUS_CRITICAL_BAD: + return __('CRITICAL'); + + case AGENT_MODULE_STATUS_WARNING_ALERT: + case AGENT_MODULE_STATUS_CRITICAL_ALERT: + return __('ALERT FIRED'); + + case AGENT_MODULE_STATUS_WARNING: + return __('WARNING'); + + case AGENT_MODULE_STATUS_UNKNOWN: + return __('UNKNOWN'); + + case AGENT_MODULE_STATUS_NO_DATA: + case AGENT_MODULE_STATUS_NOT_INIT: + return __('NO DATA'); + + case AGENT_MODULE_STATUS_NORMAL_ALERT: + case AGENT_MODULE_STATUS_NORMAL: + default: + return __('NORMAL'); + } +} + + /** * Get priority class (CSS class) from priority value. * diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 8ba751042c..8bad693c3d 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -19,17 +19,18 @@ require_once $config['homedir'].'/include/functions.php'; require_once $config['homedir'].'/include/functions_modules.php'; -require_once $config['homedir'].'/include/functions_users.php';/** - * Return the agent if exists in the DB. - * - * @param integer $id_agent The agent id. - * @param boolean $show_disabled Show the agent found althought it is disabled. By default false. - * @param boolean $force_meta - * - * @return boolean The result to check if the agent is in the DB. - */ +require_once $config['homedir'].'/include/functions_users.php'; +/** + * Return the agent if exists in the DB. + * + * @param integer $id_agent The agent id. + * @param boolean $show_disabled Show the agent found althought it is disabled. By default false. + * @param boolean $force_meta + * + * @return boolean The result to check if the agent is in the DB. + */ function agents_get_agent($id_agent, $show_disabled=true, $force_meta=false) { $agent = db_get_row_filter( diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index eb4a5186bf..df5146711c 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -88,7 +88,7 @@ if (is_ajax()) { if ($get_agents_group_json) { $id_group = (int) get_parameter('id_group'); - $recursion = (bool) get_parameter('recursion'); + $recursion = (get_parameter_switch('recursion', 'false') === 'true'); $id_os = get_parameter('id_os', ''); $agent_name = get_parameter('name', ''); From 8b6b573bde71eaa6b195163059e734fe8909d0fa Mon Sep 17 00:00:00 2001 From: marcos Date: Wed, 21 Oct 2020 16:18:07 +0200 Subject: [PATCH 12/42] fixed error with value status field --- pandora_console/operation/events/events.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 3ca4123b4f..196db1576e 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1935,16 +1935,21 @@ function process_datatables_item(item) { /* Status */ img = ' __('Unknown'), 'class' => 'forced-title']); ?>'; + state = '0'; switch (item.estado) { case "": img = ' __('New event'), 'class' => 'forced-title']); ?>'; break; case "": + + state = '1'; img = ' __('Event validated'), 'class' => 'forced-title']); ?>'; break; case "": + state = '2'; + img = ' __('Event in process'), 'class' => 'forced-title']); ?>'; break; } @@ -1976,6 +1981,9 @@ function process_datatables_item(item) { } item.estado = '
'; + item.estado += ''; + item.estado += state; + item.estado += ''; item.estado += img; item.estado += '
'; From 5d69ca3126d13ee776a1493b6f2b029593a5d6ef Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 21 Oct 2020 17:54:33 +0200 Subject: [PATCH 13/42] recursion taken in mind in group report --- .../include/functions_reporting.php | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index c480969f16..f71269f288 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2972,7 +2972,11 @@ function reporting_group_report($report, $content) $return['data']['count_events'] = count($events); - $return['data']['group_stats'] = reporting_get_group_stats($content['id_group']); + $return['data']['group_stats'] = reporting_get_group_stats( + $content['id_group'], + 'AR', + (bool) $content['recursion'] + ); if ($config['metaconsole']) { metaconsole_restore_db(); @@ -8969,7 +8973,7 @@ function reporting_get_agents_detailed_event( * * @return array Group statistics */ -function reporting_get_group_stats($id_group=0, $access='AR') +function reporting_get_group_stats($id_group=0, $access='AR', $recursion=true) { global $config; @@ -9071,16 +9075,19 @@ function reporting_get_group_stats($id_group=0, $access='AR') // Store the groups where we are quering $covered_groups = []; $group_array = []; - foreach ($id_group as $group) { - $children = groups_get_children($group); - // Show empty groups only if they have children with agents - // $group_array = array(); - foreach ($children as $sub) { - // If the group is quering previously, we ingore it - if (!in_array($sub['id_grupo'], $covered_groups)) { - array_push($covered_groups, $sub['id_grupo']); - array_push($group_array, $sub['id_grupo']); + foreach ($id_group as $group) { + if ($recursion === true) { + $children = groups_get_children($group); + + // Show empty groups only if they have children with agents + // $group_array = array(); + foreach ($children as $sub) { + // If the group is quering previously, we ingore it + if (!in_array($sub['id_grupo'], $covered_groups)) { + array_push($covered_groups, $sub['id_grupo']); + array_push($group_array, $sub['id_grupo']); + } } } From 3220217ec8a37dd81aec22c17bdc656bb414944b Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 21 Oct 2020 18:31:10 +0200 Subject: [PATCH 14/42] exclude branch from select_for_Groups given group_id --- pandora_console/include/functions_html.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 092044765c..0bdf773977 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -428,7 +428,7 @@ function html_print_select_style($fields, $name, $selected='', $style='', $scrip * @param boolean $disabled Disabled or enabled. * @param boolean $style CSS inline style. * @param string $option_style CSS inline style in array format. - * @param array $id_group Groups to be manually added. + * @param integer $id_group Exclude group branch from id_group. * @param string $keys_field Field to be used as array key, (id). * @param boolean $strict_user Strict. * @param array $delete_groups Remove groups from select. @@ -500,6 +500,15 @@ function html_print_select_groups( $name = 'group_select'.$idcounter[$name]; } + if ($id_group !== null) { + $children = groups_get_children($id_group); + foreach ($children as $child) { + $delete_groups[] = $child['id_grupo']; + } + + $delete_groups[] = $id_group; + } + $fields = []; // Preload selector. if (is_array($selected) === false) { From 335e74c26b2831a8edeafa605e26e7c482b7be2e Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 22 Oct 2020 09:53:59 +0200 Subject: [PATCH 15/42] Fixed warning message in metaconsole --- pandora_console/godmode/users/configure_user.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index b98d35e003..3e9a38dede 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -1313,6 +1313,7 @@ $(document).ready (function () { var img_delete = ''; var id_user = ''; + var is_metaconsole = ''; var data = []; $('input:image[name="add"]').click(function (e) { @@ -1357,7 +1358,7 @@ $(document).ready (function () { $('input:image[name="del"]').click(function (e) { e.preventDefault(); var rows = $("#table_profiles tr").length; - if (rows <= 3) { + if ((is_metaconsole === '1' && rows <= 4) || (is_metaconsole === '' && rows <= 3)) { if (!confirm('' + '. ' + '')) { return; } @@ -1379,7 +1380,7 @@ $(document).ready (function () { success: function (data) { row.remove(); var rows = $("#table_profiles tr").length; - if (rows <= 2) { + if ((is_metaconsole === '1' && rows <= 3) || (is_metaconsole === '' && rows <= 2)) { window.location.replace(""); } } @@ -1389,7 +1390,7 @@ $(document).ready (function () { $('#submit-crtbutton').click(function (e) { e.preventDefault(); var rows = $("#table_profiles tr").length; - if (rows <= 2) { + if ((is_metaconsole === '1' && rows <= 3) || (is_metaconsole === '' && rows <= 2)) { alert(''); } else { this.form.submit(); From bfa8d703e7f93088fb7ae8378c440aaaa406c527 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Thu, 22 Oct 2020 11:35:07 +0200 Subject: [PATCH 16/42] Fixed api create_event autovalidation on meta --- pandora_console/include/functions_api.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 6401910faa..2b96c52978 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -12513,7 +12513,13 @@ function api_set_create_event($id, $trash1, $other, $returnType) if ($other['data'][18] != '') { $values['id_extra'] = $other['data'][18]; - $sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";'; + if (is_metaconsole()) { + $table_event = 'tmetaconsole_event'; + } else { + $table_event = 'tevento'; + } + + $sql_validation = 'SELECT id_evento FROM '.$table_event.' where estado IN (0,2) and id_extra ="'.$other['data'][18].'";'; $validation = db_get_all_rows_sql($sql_validation); if ($validation) { foreach ($validation as $val) { From f09e86456920bbad87f6804639c64a56a0fed580 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 22 Oct 2020 12:47:25 +0200 Subject: [PATCH 17/42] Solved issue --- pandora_console/include/class/AgentWizard.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index 9efc2a872a..96a41b4039 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -5034,7 +5034,7 @@ class AgentWizard extends HTML var imageInfoModules = $("#image-info-modules-" + blockNumber); var totalCount = 0; var markedCount = 0; - var hidden_input = document.getElementById("hidden-module-active-"+switchName[2]+"_"+switchName[3]); + var hidden_input = document.getElementById("hidden-module-active-"+switchName[2]+"_0-0"); var id_input = hidden_input.id.split("_"); if (type == 'block') { selectedBlock From ef50b4726975a8c99beae59387d7138d76cfc800 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 22 Oct 2020 15:15:46 +0200 Subject: [PATCH 18/42] avoid useless messages --- pandora_console/include/auth/mysql.php | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index 930e2cdbd2..dc0906a36c 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -263,11 +263,6 @@ function process_user_login_remote($login, $pass, $api=false) if ($config['autocreate_remote_users'] == 1) { if ($config['ad_save_password']) { $update_credentials = change_local_user_pass_ldap($login, $pass); - - if ($update_credentials) { - $config['auth_error'] = __('Your permissions have changed. Please, login again.'); - return false; - } } else { delete_user_pass_ldap($login); } @@ -288,11 +283,6 @@ function process_user_login_remote($login, $pass, $api=false) if ($return === 'error_permissions') { $config['auth_error'] = __('Problems with configuration permissions. Please contact with Administrator'); return false; - } else { - if ($return === 'permissions_changed') { - $config['auth_error'] = __('Your permissions have changed. Please, login again.'); - return false; - } } } } else if ($config['auth'] === 'ldap') { @@ -300,11 +290,6 @@ function process_user_login_remote($login, $pass, $api=false) if ($config['autocreate_remote_users'] == 1) { if ($config['ldap_save_password']) { $update_credentials = change_local_user_pass_ldap($login, $pass); - - if ($update_credentials) { - $config['auth_error'] = __('Your permissions have changed. Please, login again.'); - return false; - } } else { delete_user_pass_ldap($login); } @@ -326,11 +311,6 @@ function process_user_login_remote($login, $pass, $api=false) if ($return === 'error_permissions') { $config['auth_error'] = __('Problems with configuration permissions. Please contact with Administrator'); return false; - } else { - if ($return === 'permissions_changed') { - $config['auth_error'] = __('Your permissions have changed. Please, login again.'); - return false; - } } } } From ddc46c077ffde52f8837afaa9308ae068f8fe1a5 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 22 Oct 2020 17:01:10 +0200 Subject: [PATCH 19/42] Solved issue --- .../include/class/AgentWizard.class.php | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index 9efc2a872a..15e28312e0 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -3002,7 +3002,7 @@ class AgentWizard extends HTML $newModule = $module; // Split the values got to obtain the name. $tmpFirst = explode('.', $value); - $tmpSecond = explode(' ', $tmpFirst[1]); + $tmpSecond = explode(' ', $tmpFirst[(count($tmpFirst) - 1)]); // Position 0 is the index, Position 3 is the MIB name. $snmpwalkNames[$tmpSecond[0]] = $tmpSecond[3]; // Perform the operations for get the values. @@ -3011,6 +3011,11 @@ class AgentWizard extends HTML $currentOid = $oid.'.'.$tmpSecond[0]; $macros['macros'][$oidName] = $currentOid; $currentOidValue = $this->snmpgetValue($currentOid); + // If for any reason the value comes empty, add 1. + if ($currentOidValue == '') { + $currentOidValue = 1; + } + $thisOperation = preg_replace( '/'.$oidName.'/', $currentOidValue, @@ -4739,11 +4744,11 @@ class AgentWizard extends HTML string $unit='', ?int $type=0 ) { - // Avoid non-numeric or arithmetic chars for security reasons. - if (preg_match('/(([^0-9\s\+\-\*\/\(\).,])+)/', $operation) === 1) { - $output = 'ERROR'; - } else { - try { + try { + // Avoid non-numeric or arithmetic chars for security reasons. + if (preg_match('/(([^0-9\s\+\-\*\/\(\).,])+)/', $operation) === 1) { + throw new Exception(sprintf(__("The operation '%s' is not permitted. Review for remote components."), $operation)); + } else { // Get the result of the operation and set it. $output = ''; eval('$output = '.$operation.';'); @@ -4753,9 +4758,11 @@ class AgentWizard extends HTML $unit, $type ); - } catch (Exception $e) { - $output = 'ERROR'; } + } catch (Exception $e) { + $this->message['type'][] = 'error'; + $this->message['message'][] = $e->getMessage(); + $this->showMessage(); } return $output; From a8c54dadee7377259c0dca7c14a12038ae6de0b8 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 22 Oct 2020 17:03:31 +0200 Subject: [PATCH 20/42] Fixed some errors --- pandora_console/include/class/AgentWizard.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index 15e28312e0..5ac7c9fa02 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -4571,7 +4571,7 @@ class AgentWizard extends HTML // Definition object. $definition = []; - // ifHCInOctets. + // IfHCInOctets. $moduleName = $name.'ifHCInOctets'; $definition['ifHCInOctets'] = [ 'module_name' => $moduleName, @@ -4597,7 +4597,7 @@ class AgentWizard extends HTML ], ]; - // ifHCOutOctets. + // IfHCOutOctets. $moduleName = $name.'ifHCOutOctets'; $definition['ifHCOutOctets'] = [ 'module_name' => $moduleName, @@ -4623,7 +4623,7 @@ class AgentWizard extends HTML ], ]; - // ifHCInUcastPkts. + // IfHCInUcastPkts. $moduleName = $name.'ifHCInUcastPkts'; $definition['ifHCInUcastPkts'] = [ 'module_name' => $moduleName, @@ -4649,7 +4649,7 @@ class AgentWizard extends HTML ], ]; - // ifHCOutUcastPkts. + // IfHCOutUcastPkts. $moduleName = $name.'ifHCOutUcastPkts'; $definition['ifHCOutUcastPkts'] = [ 'module_name' => $moduleName, @@ -4674,7 +4674,7 @@ class AgentWizard extends HTML 'inv_critical' => false, ], ]; - // ifHCInNUcastPkts. + // IfHCInNUcastPkts. $moduleName = $name.'ifHCInNUcastPkts'; $definition['ifHCInNUcastPkts'] = [ 'module_name' => $moduleName, @@ -4738,6 +4738,7 @@ class AgentWizard extends HTML * @param integer|null $type Module type. * * @return string + * @throws Exception Handle of unwanted operations. */ private function evalOperation( string $operation, From f3de0540fc804abd1951e7845c6427b587c41a73 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Thu, 22 Oct 2020 19:56:13 +0200 Subject: [PATCH 21/42] Fix continous reload page cased by automatic form submit --- pandora_console/godmode/reporting/visual_console_favorite.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index b9f4fe28d7..99f91c969c 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -115,7 +115,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) { $return_all_group, 'ag_group', $ag_group, - 'this.form.submit();', + '', '', 0, false, @@ -126,7 +126,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) { ); echo "
    • "; echo __('Group Recursion'); - html_print_checkbox('recursion', 1, $recursion, false, false, 'this.form.submit()'); + html_print_checkbox('recursion', 1, $recursion, false, false, ''); echo '
    • '; echo ""; echo '
  • '; From 002509500c6a335f73c0ac7d42fb914c799fba4d Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 23 Oct 2020 01:00:18 +0200 Subject: [PATCH 22/42] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 16c02dc8d5..4740e86fc1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.750-201021 +Version: 7.0NG.750-201023 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 be2a175460..d2902cd0b6 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.750-201021" +pandora_version="7.0NG.750-201023" 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 092b66d070..472ef319e8 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.750'; -use constant AGENT_BUILD => '201021'; +use constant AGENT_BUILD => '201023'; # 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 6099900edc..cf2e9aa8f4 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201021 +%define release 201023 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index d7cc02b5a6..9ac370795e 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201021 +%define release 201023 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 355ac58ff0..22d8e8c8c5 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201021" +PI_BUILD="201023" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index a9354de3cc..920e330d03 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201021} +{201023} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index fb54736f2b..fda4543c24 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.750(Build 201021)") +#define PANDORA_VERSION ("7.0NG.750(Build 201023)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index a7f9ac489f..cd28d733dd 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.750(Build 201021))" + VALUE "ProductVersion", "(7.0NG.750(Build 201023))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index f58d47addf..e69de672fd 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.750-201021 +Version: 7.0NG.750-201023 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 424dabe125..540dbb84ab 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.750-201021" +pandora_version="7.0NG.750-201023" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 11208ca992..7918f8f019 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC201021'; +$build_version = 'PC201023'; $pandora_version = 'v7.0NG.750'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index d9b7d02fa4..e735ba79c3 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 3f5eaf9e71..d9a95f2de6 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201021 +%define release 201023 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 1e363d45d8..f6adde89c5 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201021 +%define release 201023 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 7103fa31ce..3fb3c0f849 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201021" +PI_BUILD="201023" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 0807ed6e94..810b5b240c 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.750 PS201021"; +my $version = "7.0NG.750 PS201023"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 1bd9f8c181..2f180ab4e8 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.750 PS201021"; +my $version = "7.0NG.750 PS201023"; # save program name for logging my $progname = basename($0); From bd95c0a4f044e15bbd7bdad2f6ab27b8df95dd05 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 24 Oct 2020 01:00:16 +0200 Subject: [PATCH 23/42] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 4740e86fc1..8749501487 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.750-201023 +Version: 7.0NG.750-201024 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 d2902cd0b6..d404addaff 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.750-201023" +pandora_version="7.0NG.750-201024" 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 472ef319e8..2ee0a04d0e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.750'; -use constant AGENT_BUILD => '201023'; +use constant AGENT_BUILD => '201024'; # 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 cf2e9aa8f4..601f5ab32f 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201023 +%define release 201024 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 9ac370795e..336212bdef 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201023 +%define release 201024 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 22d8e8c8c5..d29743fbb4 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201023" +PI_BUILD="201024" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 920e330d03..bf58e11259 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201023} +{201024} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index fda4543c24..9ea2ab629d 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.750(Build 201023)") +#define PANDORA_VERSION ("7.0NG.750(Build 201024)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index cd28d733dd..46c0ec4606 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.750(Build 201023))" + VALUE "ProductVersion", "(7.0NG.750(Build 201024))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index e69de672fd..7552eb8101 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.750-201023 +Version: 7.0NG.750-201024 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 540dbb84ab..42c89d379a 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.750-201023" +pandora_version="7.0NG.750-201024" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 7918f8f019..a904a0a2eb 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC201023'; +$build_version = 'PC201024'; $pandora_version = 'v7.0NG.750'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index e735ba79c3..6df85113e0 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index d9a95f2de6..f4f77e4c78 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201023 +%define release 201024 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index f6adde89c5..e3e32fa83e 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201023 +%define release 201024 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 3fb3c0f849..5281e38f98 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201023" +PI_BUILD="201024" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 810b5b240c..e1e45a7907 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.750 PS201023"; +my $version = "7.0NG.750 PS201024"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 2f180ab4e8..a9bf043069 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.750 PS201023"; +my $version = "7.0NG.750 PS201024"; # save program name for logging my $progname = basename($0); From 89fc211e6feca3e75fc0da1a0e9432dd2aa1c335 Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 25 Oct 2020 01:00:15 +0200 Subject: [PATCH 24/42] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8749501487..dc4c494a44 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.750-201024 +Version: 7.0NG.750-201025 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 d404addaff..99efd77bb3 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.750-201024" +pandora_version="7.0NG.750-201025" 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 2ee0a04d0e..43cd220b52 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.750'; -use constant AGENT_BUILD => '201024'; +use constant AGENT_BUILD => '201025'; # 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 601f5ab32f..719a9f27a2 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201024 +%define release 201025 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 336212bdef..e4f606a7f3 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201024 +%define release 201025 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 d29743fbb4..6d07daec17 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201024" +PI_BUILD="201025" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index bf58e11259..a6b7686f1f 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201024} +{201025} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9ea2ab629d..62bf86f47f 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.750(Build 201024)") +#define PANDORA_VERSION ("7.0NG.750(Build 201025)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 46c0ec4606..0dd7d05120 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.750(Build 201024))" + VALUE "ProductVersion", "(7.0NG.750(Build 201025))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7552eb8101..3cf88cdc63 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.750-201024 +Version: 7.0NG.750-201025 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 42c89d379a..a96c767c7c 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.750-201024" +pandora_version="7.0NG.750-201025" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a904a0a2eb..9e13c911cc 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC201024'; +$build_version = 'PC201025'; $pandora_version = 'v7.0NG.750'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 6df85113e0..22a4a5b643 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index f4f77e4c78..079443bbcc 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201024 +%define release 201025 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index e3e32fa83e..19820a5bae 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201024 +%define release 201025 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 5281e38f98..fd4f821105 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201024" +PI_BUILD="201025" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index e1e45a7907..b2ae2cfc5a 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.750 PS201024"; +my $version = "7.0NG.750 PS201025"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index a9bf043069..8c99b44bc9 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.750 PS201024"; +my $version = "7.0NG.750 PS201025"; # save program name for logging my $progname = basename($0); From 76324679ec9c0746116b55407d8d3faa9ed82278 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 26 Oct 2020 01:00:14 +0100 Subject: [PATCH 25/42] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index dc4c494a44..4fecf5d5db 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.750-201025 +Version: 7.0NG.750-201026 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 99efd77bb3..3c41d59799 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.750-201025" +pandora_version="7.0NG.750-201026" 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 43cd220b52..dcf6ce3719 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.750'; -use constant AGENT_BUILD => '201025'; +use constant AGENT_BUILD => '201026'; # 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 719a9f27a2..e8d5ba360e 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201025 +%define release 201026 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index e4f606a7f3..4e9891f8cc 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201025 +%define release 201026 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 6d07daec17..8cf408cc77 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201025" +PI_BUILD="201026" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index a6b7686f1f..1f7a962eae 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201025} +{201026} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 62bf86f47f..4ec547fa68 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.750(Build 201025)") +#define PANDORA_VERSION ("7.0NG.750(Build 201026)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 0dd7d05120..9f5f9872e9 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.750(Build 201025))" + VALUE "ProductVersion", "(7.0NG.750(Build 201026))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 3cf88cdc63..e04b3c9161 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.750-201025 +Version: 7.0NG.750-201026 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 a96c767c7c..890008009a 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.750-201025" +pandora_version="7.0NG.750-201026" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 9e13c911cc..f5a41e3337 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC201025'; +$build_version = 'PC201026'; $pandora_version = 'v7.0NG.750'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 22a4a5b643..f39f2adc26 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 079443bbcc..63e13ebe52 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201025 +%define release 201026 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 19820a5bae..73712e49d1 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201025 +%define release 201026 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index fd4f821105..d2dc2b4701 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201025" +PI_BUILD="201026" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index b2ae2cfc5a..94cb21db50 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.750 PS201025"; +my $version = "7.0NG.750 PS201026"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 8c99b44bc9..1304a56793 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.750 PS201025"; +my $version = "7.0NG.750 PS201026"; # save program name for logging my $progname = basename($0); From 7ff518f4aaa5d093451a788e9c9f8a7e73965100 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 26 Oct 2020 10:34:31 +0100 Subject: [PATCH 26/42] Solved issues with entities --- pandora_console/godmode/modules/manage_network_components.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index fb8a845284..e68ea5e595 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -330,7 +330,7 @@ if ($create_component) { if ($name && !$name_check) { $id = network_components_create_network_component( - strip_tags(io_safe_input($name), '
    '), + $name, $type, $id_group, [ @@ -431,7 +431,7 @@ if ($update_component) { $id, [ 'type' => $type, - 'name' => strip_tags(io_safe_input($name, '
    ')), + 'name' => $name, 'id_group' => $id_group, 'description' => $description, 'module_interval' => $module_interval, From be09fb8a29e9af233fb5b0dd66452fddcdd0f631 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 26 Oct 2020 10:36:43 +0100 Subject: [PATCH 27/42] Fixed code error --- pandora_console/godmode/modules/manage_network_components.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index e68ea5e595..5ff2132d12 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -258,7 +258,7 @@ if ($id_modulo === COMPONENT_TYPE_WIZARD) { if ($execution_type === EXECUTION_TYPE_PLUGIN || $module_protocol === 'wmi') { // Search all parameters received with extra_fields. foreach ($_REQUEST as $parameter => $thisValue) { - // Extra fields (OIDs Macros or WMI Extra fields) + // Extra fields (OIDs Macros or WMI Extra fields). if (preg_match('/extra_field_'.$module_protocol.'_/', $parameter) !== 0) { $tmpParameter = explode('_', $parameter); $extra_fields['extra_field_'.$tmpParameter[3]] = get_parameter($parameter); From 3287223b4d761e3420f9c1455be8a8387818c947 Mon Sep 17 00:00:00 2001 From: Kike Date: Mon, 26 Oct 2020 12:05:37 +0100 Subject: [PATCH 28/42] Use service description instead of name in tree view --- .../include/class/TreeService.class.php | 6 ++++++ .../include/javascript/tree/TreeController.js | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/TreeService.class.php b/pandora_console/include/class/TreeService.class.php index b9721b3eb0..0afa46af73 100644 --- a/pandora_console/include/class/TreeService.class.php +++ b/pandora_console/include/class/TreeService.class.php @@ -264,6 +264,7 @@ class TreeService extends Tree ts.id_agent_module, ts.name, ts.name as `alias`, + ts.description as `description`, ts.id as `rootID`, "services" as `rootType`, "services" as `type`, @@ -311,6 +312,7 @@ class TreeService extends Tree ]; $services[$service['id']]['name'] = $service['name']; $services[$service['id']]['id'] = $service['id']; + $services[$service['id']]['description'] = $service['description']; $services[$service['id']]['serviceDetail'] = 'index.php?sec=network&sec2=enterprise/operation/services/services&tab=service_map&id_service='.(int) $service['id']; } @@ -512,6 +514,8 @@ class TreeService extends Tree $tmp['id'] = (int) $item->service()->id(); $tmp['name'] = $item->service()->name(); $tmp['alias'] = $item->service()->name(); + $tmp['description'] = $item->service()->description(); + $tmp['elementDescription'] = $item->description(); if ($this->connectedToNode === false && is_metaconsole() === true @@ -643,6 +647,8 @@ class TreeService extends Tree ts.id_agent_module, ts.name, ts.name as `alias`, + ts.description as `description`, + tse.description as `elementDescription`, tse.id_service as `rootID`, "services" as `rootType`, "services" as `type`, diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index f3e6ecec52..497e18c266 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -637,7 +637,20 @@ var TreeController = { .css("cursor", "pointer"); $content.append($serviceDetailImage); - $content.append(" " + element.name); + if ( + typeof element.elementDescription !== "undefined" && + element.elementDescription != "" + ) { + $content.append(" " + element.elementDescription); + } else if ( + typeof element.description !== "undefined" && + element.description != "" + ) { + $content.append(" " + element.description); + } else { + $content.append(" " + element.name); + } + // $content.append(" " + element.name); } else { $content.remove($node); } From 6ff11239e4838b74111493b42b36ab9059b31f37 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 26 Oct 2020 14:44:05 +0100 Subject: [PATCH 29/42] fixed connection check in public link of visual consoles --- pandora_console/include/javascript/pandora.js | 2 +- pandora_console/operation/visual_console/public_view.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 15c2f9fcf4..f99ae01c79 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -2024,7 +2024,7 @@ function getServerUrl() { server_url = get_php_value("homeurl"); } catch (SyntaxError) { console.warn("Pandora homeurl cannot be found."); - server_url = window.location.origin + "/pandora_console"; + server_url = $("#hidden-homeurl").val(); } return server_url; } diff --git a/pandora_console/operation/visual_console/public_view.php b/pandora_console/operation/visual_console/public_view.php index 1127614eed..301ec3ca9c 100644 --- a/pandora_console/operation/visual_console/public_view.php +++ b/pandora_console/operation/visual_console/public_view.php @@ -31,6 +31,8 @@ require_once $config['homedir'].'/vendor/autoload.php'; ui_require_css_file('visual_maps'); ui_require_css_file('register'); +html_print_input_hidden('homeurl', $config['homeurl']); + // Connection lost alert. $conn_title = __('Connection with server has been lost'); $conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); From 3b9558c7a0442c367c6e71e3f688c5ce8e1ddf08 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 27 Oct 2020 01:00:21 +0100 Subject: [PATCH 30/42] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 4fecf5d5db..bf1751f2f0 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.750-201026 +Version: 7.0NG.750-201027 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 3c41d59799..1eb901b32f 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.750-201026" +pandora_version="7.0NG.750-201027" 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 dcf6ce3719..033036621b 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.750'; -use constant AGENT_BUILD => '201026'; +use constant AGENT_BUILD => '201027'; # 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 e8d5ba360e..17369dc230 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201026 +%define release 201027 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 4e9891f8cc..034ff949f0 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201026 +%define release 201027 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 8cf408cc77..7e135b5982 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201026" +PI_BUILD="201027" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 1f7a962eae..b38d7499f4 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201026} +{201027} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 4ec547fa68..d6bfb1e406 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.750(Build 201026)") +#define PANDORA_VERSION ("7.0NG.750(Build 201027)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 9f5f9872e9..4fd1263251 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.750(Build 201026))" + VALUE "ProductVersion", "(7.0NG.750(Build 201027))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index e04b3c9161..c7a3a3c9e6 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.750-201026 +Version: 7.0NG.750-201027 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 890008009a..23add77b43 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.750-201026" +pandora_version="7.0NG.750-201027" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index f5a41e3337..1aeee036b6 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC201026'; +$build_version = 'PC201027'; $pandora_version = 'v7.0NG.750'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f39f2adc26..10594bda78 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 63e13ebe52..7d5dda6118 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201026 +%define release 201027 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 73712e49d1..cbcf2bf722 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201026 +%define release 201027 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index d2dc2b4701..992bf170fb 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201026" +PI_BUILD="201027" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 94cb21db50..3abb1560ca 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.750 PS201026"; +my $version = "7.0NG.750 PS201027"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 1304a56793..482f817e6e 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.750 PS201026"; +my $version = "7.0NG.750 PS201027"; # save program name for logging my $progname = basename($0); From a9075f0068c69c8602c423f669a529692aee4efd Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 27 Oct 2020 07:49:33 +0100 Subject: [PATCH 31/42] Fix --- pandora_console/include/class/AgentWizard.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index 96a41b4039..8ab0022846 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -5034,15 +5034,13 @@ class AgentWizard extends HTML var imageInfoModules = $("#image-info-modules-" + blockNumber); var totalCount = 0; var markedCount = 0; - var hidden_input = document.getElementById("hidden-module-active-"+switchName[2]+"_0-0"); - var id_input = hidden_input.id.split("_"); if (type == 'block') { selectedBlock .parent() .removeClass("alpha50"); if (selectedBlock.prop("checked")) { // Set to active the values of fields. - $("[id*='"+id_input[0]+"']") + $("[id*=hidden-module-active-"+blockNumber+"]") .each(function(){ $(this).val('1'); }); @@ -5054,7 +5052,7 @@ class AgentWizard extends HTML imageInfoModules.removeClass('hidden'); } else { // Set to inactive the values of fields. - $("[id*='"+id_input[0]+"']") + $("[id*=hidden-module-active-"+blockNumber+"]") .each(function(){ $(this).val('0'); }); From 8ba92a683a001602e5b14671ea01abbf5c37d57c Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 27 Oct 2020 07:51:30 +0100 Subject: [PATCH 32/42] Fix some errors --- pandora_console/include/class/AgentWizard.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index 8ab0022846..3ace44b2b0 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -4566,7 +4566,7 @@ class AgentWizard extends HTML // Definition object. $definition = []; - // ifHCInOctets. + // IfHCInOctets. $moduleName = $name.'ifHCInOctets'; $definition['ifHCInOctets'] = [ 'module_name' => $moduleName, @@ -4592,7 +4592,7 @@ class AgentWizard extends HTML ], ]; - // ifHCOutOctets. + // IfHCOutOctets. $moduleName = $name.'ifHCOutOctets'; $definition['ifHCOutOctets'] = [ 'module_name' => $moduleName, @@ -4618,7 +4618,7 @@ class AgentWizard extends HTML ], ]; - // ifHCInUcastPkts. + // IfHCInUcastPkts. $moduleName = $name.'ifHCInUcastPkts'; $definition['ifHCInUcastPkts'] = [ 'module_name' => $moduleName, @@ -4644,7 +4644,7 @@ class AgentWizard extends HTML ], ]; - // ifHCOutUcastPkts. + // IfHCOutUcastPkts. $moduleName = $name.'ifHCOutUcastPkts'; $definition['ifHCOutUcastPkts'] = [ 'module_name' => $moduleName, @@ -4669,7 +4669,7 @@ class AgentWizard extends HTML 'inv_critical' => false, ], ]; - // ifHCInNUcastPkts. + // IfHCInNUcastPkts. $moduleName = $name.'ifHCInNUcastPkts'; $definition['ifHCInNUcastPkts'] = [ 'module_name' => $moduleName, From 7c882d37238b006b31644838573d5dde0fd14954 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 27 Oct 2020 12:53:54 +0100 Subject: [PATCH 33/42] fixed connection check --- pandora_console/operation/visual_console/legacy_public_view.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/operation/visual_console/legacy_public_view.php b/pandora_console/operation/visual_console/legacy_public_view.php index 797a12846f..4df0a6db28 100644 --- a/pandora_console/operation/visual_console/legacy_public_view.php +++ b/pandora_console/operation/visual_console/legacy_public_view.php @@ -43,6 +43,8 @@ enterprise_include('index.php'); $url_css = ui_get_full_url('include/styles/visual_maps.css', false, false, false); echo ''; +html_print_input_hidden('homeurl', $config['homeurl']); + $url_css_modal = ui_get_full_url('include/styles/register.css', false, false, false); echo ''; // Connection lost alert. From 2b2acefa31ae7003ed99f4ed719d43915ac17ad7 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 27 Oct 2020 15:02:05 +0100 Subject: [PATCH 34/42] Snmp and WMI in recon task move open --- .../godmode/wizards/HostDevices.class.php | 376 +++++++++++++++++- pandora_console/include/styles/wizard.css | 4 + 2 files changed, 379 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index 2a15affd94..cb90d927b8 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -1170,6 +1170,380 @@ class HostDevices extends Wizard ]; } + // Input: SNMP enabled. + $form['inputs'][] = [ + 'label' => __('SNMP enabled'), + 'arguments' => [ + 'name' => 'snmp_enabled', + 'type' => 'switch', + 'return' => true, + 'value' => (isset($this->task['snmp_enabled'])) ? $this->task['snmp_enabled'] : 1, + 'onclick' => 'extraSNMP();', + + ], + ]; + + // SNMP CONFIGURATION. + $form['inputs'][] = [ + 'hidden' => 1, + 'block_id' => 'snmp_extra', + 'class' => 'indented', + 'block_content' => [ + [ + 'label' => __('SNMP version'), + 'arguments' => [ + 'name' => 'snmp_version', + 'fields' => [ + '1' => 'v. 1', + '2c' => 'v. 2c', + '3' => 'v. 3', + ], + 'type' => 'select', + 'script' => 'SNMPExtraShow(this.value)', + 'selected' => $this->task['snmp_version'], + 'return' => true, + ], + ], + ], + ]; + + // SNMP Options pack v1. + $form['inputs'][] = [ + 'hidden' => 1, + 'block_id' => 'snmp_options_basic', + 'class' => 'indented', + 'block_content' => [ + [ + 'label' => __('SNMP communities to try with').ui_print_help_tip( + __( + 'You can specify several values, separated by commas, for example: public,mysecret,1234' + ), + true + ), + 'arguments' => [ + 'name' => 'community', + 'type' => 'text', + 'value' => $this->task['snmp_community'], + 'size' => 25, + 'return' => true, + + ], + ], + ], + ]; + + // SNMP Options pack v3. + $form['inputs'][] = [ + 'hidden' => 1, + 'block_id' => 'snmp_options_v3', + 'class' => 'indented', + 'block_content' => [ + [ + 'label' => ''.__('Context').'', + 'arguments' => [ + 'name' => 'snmp_context', + 'type' => 'text', + 'value' => $this->task['snmp_community'], + 'size' => 15, + 'return' => true, + + ], + ], + [ + 'label' => ''.__('Auth user').'', + 'arguments' => [ + 'name' => 'snmp_auth_user', + 'type' => 'text', + 'value' => $this->task['snmp_auth_user'], + 'size' => 15, + 'return' => true, + + ], + ], + [ + 'label' => ''.__('Auth password').''.ui_print_help_tip( + __( + 'The pass length must be eight character minimum.' + ), + true + ), + 'arguments' => [ + 'name' => 'snmp_auth_pass', + 'type' => 'password', + 'value' => $this->task['snmp_auth_pass'], + 'size' => 15, + 'return' => true, + + ], + ], + [ + 'label' => ''.__('Privacy method').'', + 'arguments' => [ + 'name' => 'snmp_privacy_method', + 'type' => 'select', + 'fields' => [ + 'DES' => __('DES'), + 'AES' => __('AES'), + ], + 'selected' => $this->task['snmp_privacy_method'], + 'size' => 15, + 'return' => true, + + ], + ], + [ + 'label' => ''.__('Privacy pass').''.ui_print_help_tip( + __( + 'The pass length must be eight character minimum.' + ), + true + ), + 'arguments' => [ + 'name' => 'snmp_privacy_pass', + 'type' => 'password', + 'value' => $this->task['snmp_privacy_pass'], + 'size' => 15, + 'return' => true, + + ], + ], + [ + 'label' => ''.__('Auth method').'', + 'arguments' => [ + 'name' => 'snmp_auth_method', + 'type' => 'select', + 'fields' => [ + 'MD5' => __('MD5'), + 'SHA' => __('SHA'), + ], + 'selected' => $this->task['snmp_auth_method'], + 'size' => 15, + 'return' => true, + + ], + ], + [ + 'label' => ''.__('Security level').'', + 'arguments' => [ + 'name' => 'snmp_security_level', + 'type' => 'select', + 'fields' => [ + 'noAuthNoPriv' => __('Not auth and not privacy method'), + 'authNoPriv' => __('Auth and not privacy method'), + 'authPriv' => __('Auth and privacy method'), + ], + 'selected' => $this->task['snmp_security_level'], + 'size' => 15, + 'return' => true, + + ], + ], + + ], + ]; + + // Input: Enforce os detection. + $form['inputs'][] = [ + 'label' => __('OS detection'), + 'arguments' => [ + 'name' => 'os_detect', + 'type' => 'switch', + 'return' => true, + 'value' => (isset($this->task['os_detect'])) ? $this->task['os_detect'] : 1, + + ], + ]; + + // Input: Name resolution. + $form['inputs'][] = [ + 'label' => __('Name resolution'), + 'arguments' => [ + 'name' => 'resolve_names', + 'type' => 'switch', + 'return' => true, + 'value' => (isset($this->task['resolve_names'])) ? $this->task['resolve_names'] : 1, + ], + ]; + + // Input: Parent detection. + $form['inputs'][] = [ + 'label' => __('Parent detection'), + 'arguments' => [ + 'name' => 'parent_detection', + 'type' => 'switch', + 'return' => true, + 'value' => (isset($this->task['parent_detection'])) ? $this->task['parent_detection'] : 1, + ], + ]; + + // Input: Parent recursion. + $form['inputs'][] = [ + 'label' => __('Parent recursion'), + 'arguments' => [ + 'name' => 'parent_recursion', + 'type' => 'switch', + 'return' => true, + 'value' => (isset($this->task['parent_recursion'])) ? $this->task['parent_recursion'] : 1, + ], + ]; + + // Input: VLAN enabled. + $form['inputs'][] = [ + 'label' => __('VLAN enabled'), + 'arguments' => [ + 'name' => 'vlan_enabled', + 'type' => 'switch', + 'return' => true, + 'value' => (isset($this->task['vlan_enabled'])) ? $this->task['vlan_enabled'] : 1, + ], + ]; + + // Input: WMI enabled. + $form['inputs'][] = [ + 'label' => __('WMI enabled'), + 'arguments' => [ + 'name' => 'wmi_enabled', + 'type' => 'switch', + 'value' => (isset($this->task['wmi_enabled'])) ? $this->task['wmi_enabled'] : 0, + 'return' => true, + 'onclick' => 'toggleAuth();', + + ], + ]; + + // AUTH CONFIGURATION. + $show_auth = false; + if ((isset($this->task['wmi_enabled']) && $this->task['wmi_enabled'] > 0) + || (isset($this->task['rcmd_enabled']) && $this->task['rcmd_enabled'] > 0) + ) { + $show_auth = true; + } + + include_once $config['homedir'].'/include/class/CredentialStore.class.php'; + $available_keys = CredentialStore::getKeys('CUSTOM'); + if (check_acl($config['id_user'], 0, 'PM')) { + $link_to_cs = ''; + $link_to_cs .= __('No credentials available').', '; + $link_to_cs .= strtolower(__('Manage credentials')).''; + } else { + $link_to_cs = __('No credentials available'); + } + + if (count($available_keys) > 0) { + $form['inputs'][] = [ + 'block_id' => 'auth_block', + 'class' => 'indented', + 'hidden' => !$show_auth, + 'block_content' => [ + [ + 'label' => __('Credentials to try with'), + 'arguments' => [ + 'type' => 'select', + 'name' => 'auth_strings[]', + 'fields' => CredentialStore::getKeys('CUSTOM'), + 'selected' => explode( + ',', + $this->task['auth_strings'] + ), + + 'multiple' => true, + 'class' => 'select_multiple', + ], + ], + ], + ]; + } else { + $form['inputs'][] = [ + 'block_id' => 'auth_block', + 'class' => 'indented', + 'hidden' => !$show_auth, + 'block_content' => [ + [ + 'label' => __('Credentials'), + 'extra' => $link_to_cs, + ], + ], + ]; + } + + ui_require_jquery_file('tag-editor.min'); + ui_require_jquery_file('caret.min'); + ui_require_css_file('jquery.tag-editor'); + + $form['js'] = ' + $(\'#text-community\').tagEditor({ + forceLowercase: false + }); + + function SNMPExtraShow(target) { + $("#snmp_options_basic").hide(); + $("#snmp_options_v3").hide(); + if (document.getElementsByName("snmp_enabled")[0].checked) { + $("#snmp_extra").show(); + if (target == 3) { + $("#snmp_options_v3").show(); + } else { + $("#snmp_options_basic").show(); + } + } + } + + function extraSNMP() { + if (document.getElementsByName("snmp_enabled")[0].checked) { + SNMPExtraShow($("#snmp_version").val()); + $("#snmp_extra").show(); + + // Enable snmp dependant checks + if (!document.getElementsByName("parent_recursion")[0].checked) + $("input[name=parent_recursion]").click(); + + if (!document.getElementsByName("parent_detection")[0].checked) + $("input[name=parent_detection]").click(); + + if (!document.getElementsByName("resolve_names")[0].checked) + $("input[name=resolve_names]").click(); + + if (!document.getElementsByName("vlan_enabled")[0].checked) + $("input[name=vlan_enabled]").click(); + } else { + // Hide unusable sections + $("#snmp_extra").hide(); + $("#snmp_options_basic").hide(); + $("#snmp_options_v3").hide(); + + // Disable snmp dependant checks + if (document.getElementsByName("parent_recursion")[0].checked) + $("input[name=parent_recursion]").click(); + + if (document.getElementsByName("parent_detection")[0].checked) + $("input[name=parent_detection]").click(); + + if (document.getElementsByName("resolve_names")[0].checked) + $("input[name=resolve_names]").click(); + + if (document.getElementsByName("vlan_enabled")[0].checked) + $("input[name=vlan_enabled]").click(); + } + } + + function toggleAuth() { + if (document.getElementsByName("wmi_enabled")[0].checked + || (typeof document.getElementsByName("rcmd_enabled")[0] != "undefined" + && document.getElementsByName("rcmd_enabled")[0].checked) + ) { + $("#auth_block").show(); + } else { + $("#auth_block").hide(); + } + } + + $(function() { + SNMPExtraShow($("#snmp_version").val()); + }); + '; + if (enterprise_installed()) { // Feature configuration. $extra = enterprise_hook('hd_showextrainputs', [$this]); @@ -1178,7 +1552,7 @@ class HostDevices extends Wizard $form['inputs'], $extra['inputs'] ); - $form['js'] = $extra['js']; + $form['js'] .= $extra['js']; } } diff --git a/pandora_console/include/styles/wizard.css b/pandora_console/include/styles/wizard.css index a183e2368f..0ef0df5ee6 100644 --- a/pandora_console/include/styles/wizard.css +++ b/pandora_console/include/styles/wizard.css @@ -11,6 +11,10 @@ ul.wizard { ul.wizard li { padding-bottom: 10px; padding-top: 10px; + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; } ul.wizard li > label:not(.p-switch) { From f744261821998e9932438ddab158c937940c42cc Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 27 Oct 2020 16:03:35 +0100 Subject: [PATCH 35/42] minor fix --- pandora_console/godmode/groups/configure_group.php | 10 +++++++++- pandora_console/include/functions_html.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/groups/configure_group.php b/pandora_console/godmode/groups/configure_group.php index 72fe425fca..7d74fe56d0 100644 --- a/pandora_console/godmode/groups/configure_group.php +++ b/pandora_console/godmode/groups/configure_group.php @@ -168,7 +168,15 @@ if ($id_group) { } } else { $table->data[2][1] = '
    '; - $table->data[2][1] .= html_print_select_groups(false, 'AR', true, 'id_parent', $id_parent, '', '', '', true); + $table->data[2][1] .= html_print_input( + [ + 'type' => 'select_groups', + 'name' => 'id_parent', + 'selected' => $id_parent, + 'return' => true, + 'returnAllGroup' => true, + ] + ); $table->data[2][1] .= '
    '; } diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 0bdf773977..e029ebda2e 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -500,7 +500,7 @@ function html_print_select_groups( $name = 'group_select'.$idcounter[$name]; } - if ($id_group !== null) { + if ($id_group !== false) { $children = groups_get_children($id_group); foreach ($children as $child) { $delete_groups[] = $child['id_grupo']; From 288b81dcc4c9df94ee4fd449a29bf70a074120c2 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 28 Oct 2020 01:00:18 +0100 Subject: [PATCH 36/42] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index bf1751f2f0..9c8a9f87c8 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.750-201027 +Version: 7.0NG.750-201028 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 1eb901b32f..d561516453 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.750-201027" +pandora_version="7.0NG.750-201028" 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 033036621b..c51d56cfb3 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.750'; -use constant AGENT_BUILD => '201027'; +use constant AGENT_BUILD => '201028'; # 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 17369dc230..adcd47fef9 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201027 +%define release 201028 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 034ff949f0..b18bea056b 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201027 +%define release 201028 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 7e135b5982..1b3339d25a 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201027" +PI_BUILD="201028" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index b38d7499f4..939325c22e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201027} +{201028} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d6bfb1e406..ac4030e4d6 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.750(Build 201027)") +#define PANDORA_VERSION ("7.0NG.750(Build 201028)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 4fd1263251..285ec499f8 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.750(Build 201027))" + VALUE "ProductVersion", "(7.0NG.750(Build 201028))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c7a3a3c9e6..25cfb215af 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.750-201027 +Version: 7.0NG.750-201028 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 23add77b43..f32d578a85 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.750-201027" +pandora_version="7.0NG.750-201028" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1aeee036b6..83e5211edf 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC201027'; +$build_version = 'PC201028'; $pandora_version = 'v7.0NG.750'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 10594bda78..40ce0f07cb 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 7d5dda6118..5a89471fa4 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201027 +%define release 201028 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index cbcf2bf722..097fa5ecf7 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201027 +%define release 201028 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 992bf170fb..a7d5eefa90 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201027" +PI_BUILD="201028" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 3abb1560ca..d3474c820b 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.750 PS201027"; +my $version = "7.0NG.750 PS201028"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 482f817e6e..6e07cfab2c 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.750 PS201027"; +my $version = "7.0NG.750 PS201028"; # save program name for logging my $progname = basename($0); From 94cfd51501d737fb2eb0b5268604697fdf42ed10 Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Wed, 28 Oct 2020 11:41:30 +0100 Subject: [PATCH 37/42] Ent 6512 error en acls de alertas --- pandora_console/godmode/alerts/alert_list.builder.php | 2 +- pandora_console/include/functions_agents.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index 4e9772b6d6..bcb1db0e08 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -131,7 +131,7 @@ if (check_acl($config['id_user'], 0, 'LM')) { $table->data[2][0] = __('Template'); $own_info = get_user_info($config['id_user']); -if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) { +if ($own_info['is_admin']) { $templates = alerts_get_alert_templates(false, ['id', 'name']); } else { $usr_groups = users_get_groups($config['id_user'], 'LW', true); diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index beff278dc1..119852f1b9 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -335,6 +335,11 @@ function agents_get_alerts_simple($id_agent=false, $filter='', $options=false, $ // Filter by agents id. $id_agents_list = implode(',', $id_agent); + + if ($id_agents_list === '') { + $id_agents_list = '0'; + } + $subQuery .= ' AND id_agente in ('.$id_agents_list.')'; } else if ($id_agent === false || empty($id_agent)) { if ($allModules) { From 860024a11ac16e337e396f9b37a65d0aebb65028 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 29 Oct 2020 01:00:21 +0100 Subject: [PATCH 38/42] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 9c8a9f87c8..bb54c56b4c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.750-201028 +Version: 7.0NG.750-201029 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 d561516453..7e6e85035c 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.750-201028" +pandora_version="7.0NG.750-201029" 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 c51d56cfb3..d55e379f01 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.750'; -use constant AGENT_BUILD => '201028'; +use constant AGENT_BUILD => '201029'; # 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 adcd47fef9..698b2439d2 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201028 +%define release 201029 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index b18bea056b..8d18a817fe 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.750 -%define release 201028 +%define release 201029 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 1b3339d25a..81a292285e 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201028" +PI_BUILD="201029" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 939325c22e..f6493723fd 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201028} +{201029} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ac4030e4d6..bac75d8cd5 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.750(Build 201028)") +#define PANDORA_VERSION ("7.0NG.750(Build 201029)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 285ec499f8..070d4c6fbd 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.750(Build 201028))" + VALUE "ProductVersion", "(7.0NG.750(Build 201029))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 25cfb215af..304b66c7a6 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.750-201028 +Version: 7.0NG.750-201029 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 f32d578a85..a7ca73a213 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.750-201028" +pandora_version="7.0NG.750-201029" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 83e5211edf..e490b8d671 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC201028'; +$build_version = 'PC201029'; $pandora_version = 'v7.0NG.750'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 40ce0f07cb..f706f1dff4 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 5a89471fa4..258f820820 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201028 +%define release 201029 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 097fa5ecf7..7b05aea60c 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.750 -%define release 201028 +%define release 201029 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index a7d5eefa90..2712d24fd2 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.750" -PI_BUILD="201028" +PI_BUILD="201029" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index d3474c820b..e7a1e7ec12 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.750 PS201028"; +my $version = "7.0NG.750 PS201029"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 6e07cfab2c..80771fd543 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.750 PS201028"; +my $version = "7.0NG.750 PS201029"; # save program name for logging my $progname = basename($0); From 6112b3e932e300d3b25ab2c1ae1a29181037ba30 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 29 Oct 2020 10:55:07 +0100 Subject: [PATCH 39/42] minor fix --- .../godmode/reporting/reporting_builder.item_editor.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index dfdc05c1fc..814e9f1ec4 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -3747,13 +3747,10 @@ $(document).ready (function () { // Alert report group must show all matches when selecting All group // ignoring 'recursion' option. #6497. - if ($('#type').val() == 'alert_report_group' - && $("#combo_group").val() == 0 - ) { + if ($("#combo_group").val() == 0) { $('#checkbox-recursion').attr('disabled',true) $('#checkbox-recursion').attr('checked','checked') } else { - $('#checkbox-recursion').removeAttr('checked') $('#checkbox-recursion').removeAttr('disabled') } From 3e1a89dab782522cfd1df638ac88c5a98a61b2f6 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 29 Oct 2020 11:21:56 +0100 Subject: [PATCH 40/42] groups_get_cChildren --- pandora_console/include/functions_groups.php | 49 +++++++++++++++----- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/functions_groups.php b/pandora_console/include/functions_groups.php index 7b733b9c8d..3248eadb31 100644 --- a/pandora_console/include/functions_groups.php +++ b/pandora_console/include/functions_groups.php @@ -266,16 +266,21 @@ function groups_check_used($idGroup) /** - * Return a array of id_group of children of given parent. + * Return a array of id_group of children of given parent INCLUDING PARENT!!. * * @param integer $parent The id_grupo parent to search its children. * @param array $ignorePropagate Ignore propagate. * @param string $privilege Default privilege. + * @param boolean $selfInclude Include group "id_parent" in return. * * @return array Of Groups, children of $parent. */ -function groups_get_children($parent, $ignorePropagate=false, $privilege='AR') -{ +function groups_get_children( + $parent, + $ignorePropagate=false, + $privilege='AR', + $selfInclude=true +) { static $groups; static $user_groups; @@ -296,7 +301,15 @@ function groups_get_children($parent, $ignorePropagate=false, $privilege='AR') // Admin see always all groups. $ignorePropagate = users_is_admin() || $ignorePropagate; + // Prepare array. $return = []; + + if ($selfInclude === true) { + if (array_key_exists($parent, $user_groups) === true) { + $return[$parent] = $groups[$parent]; + } + } + foreach ($groups as $key => $g) { if ($g['id_grupo'] == 0) { continue; @@ -317,7 +330,9 @@ function groups_get_children($parent, $ignorePropagate=false, $privilege='AR') if ($g['propagate'] || $ignorePropagate) { $return += groups_get_children( $g['id_grupo'], - $ignorePropagate + $ignorePropagate, + $privilege, + $selfInclude ); } } @@ -490,16 +505,28 @@ function groups_get_all($groupWithAgents=false) /** - * Get all groups recursive from an initial group. + * Get all groups recursive from an initial group INCLUDING PARENT!!. * - * @param int Id of the parent group - * @param bool Whether to force recursive search ignoring propagation (true) or not (false) + * @param integer $id_parent Id of the parent group. + * @param boolean $ignorePropagate Whether to force recursive search ignoring + * propagation (true) or not (false). + * @param boolean $selfInclude Include group "id_parent" in return. + * @param string $privilege Privilege flag to search for default 'AR'. * - * @return array with all result groups + * @return array With all result groups. */ -function groups_get_children_ids($id_parent, $all=false) -{ - $return = groups_get_children($id_parent, $all); +function groups_get_children_ids( + $id_parent, + $ignorePropagate=false, + $selfInclude=true, + $privilege='AR' +) { + $return = groups_get_children( + $id_parent, + $ignorePropagate, + $privilege, + $selfInclude + ); return array_keys($return); } From 43ca5e4972ef2f2fe80679e8b96831c142ab7add Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 29 Oct 2020 12:53:09 +0100 Subject: [PATCH 41/42] =?UTF-8?q?Ent=206482=20fallo=20en=20la=20agrupaci?= =?UTF-8?q?=C3=B3n=20de=20eventos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pandora_console/include/functions_events.php | 6 +++++- pandora_console/operation/events/events.php | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index cf486b8acf..7b598f7ab2 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1244,7 +1244,11 @@ function events_get_all( // Order. $order_by = ''; if (isset($order, $sort_field)) { - $order_by = events_get_sql_order($sort_field, $order); + if (isset($filter['group_rep']) && $filter['group_rep'] == 1) { + $order_by = events_get_sql_order('MAX('.$sort_field.')', $order); + } else { + $order_by = events_get_sql_order($sort_field, $order); + } } // Pagination. diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 3ca4123b4f..05f244d727 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -358,6 +358,21 @@ if (is_ajax()) { $tmp->comments = ui_print_comments($tmp->comments); } + // Show last event. + if (isset($tmp->max_id_evento) && $tmp->max_id_evento !== $tmp->id_evento) { + $max_event = db_get_row_sql( + sprintf( + 'SELECT criticity, timestamp FROM %s + WHERE id_evento = %s', + ($tmp->meta) ? 'tmetaconsole_event' : 'tevento', + $tmp->max_id_evento + ) + ); + + $tmp->timestamp = $max_event['timestamp']; + $tmp->criticity = $max_event['criticity']; + } + $tmp->agent_name = io_safe_output($tmp->agent_name); $tmp->ack_utimestamp = ui_print_timestamp( $tmp->ack_utimestamp, From f8511de008fa2a341dee4a071fdad41a6de4b6fc Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Thu, 29 Oct 2020 16:39:00 +0100 Subject: [PATCH 42/42] fixed error 6495 --- pandora_console/godmode/servers/modificar_server.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index 9062eab0a4..d7332b86b4 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -140,7 +140,7 @@ if (isset($_GET['server'])) { ui_print_error_message(__('There was a problem deleting the server')); } } else if (isset($_GET['update'])) { - $address = trim(get_parameter_post('address'), ' '); + $address = trim(io_safe_output(get_parameter_post('address')), ' '); $description = trim(get_parameter_post('description'), ' '); $id_server = get_parameter_post('server'); $exec_proxy = get_parameter_post('exec_proxy');