From c7cd59ffb51cab0430b1ab47de488c73acf41091 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Wed, 27 Feb 2019 18:25:37 +0100 Subject: [PATCH 01/63] Ticket resolved Former-commit-id: c7b3a4c44941a8e2ea91faf811730bbec4d7f877 --- pandora_console/operation/events/events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 18e1e77ffc..e12e7ee54b 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1047,7 +1047,7 @@ function validate_event_advanced(id, new_status) { $("#delete-"+id).attr ("data-title", ); $("#delete-"+id).attr ("alt", ); $("#delete-"+id).attr ("data-use_title_for_force_title", 1); - $("#delete-"+id).attr ("class", "forced_title"); + $("#delete-"+id).attr ("class", "forced_title"); // Remove row due to new state if (($("#status").val() == 0) From f0fa992912a8908f605510f21e0d7ce98a876372 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Thu, 28 Feb 2019 10:08:33 +0100 Subject: [PATCH 02/63] Ticket Resolved Former-commit-id: 023a3b09aff3255b4ea6744ab12ddc2d2a5f540d --- pandora_console/operation/events/events.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index e12e7ee54b..e8329e79d6 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -839,11 +839,11 @@ $(document).ready( function() { // Remove delete link (if event is not grouped and there is more than one event) if ($("#group_rep").val() == 1) { if (parseInt($("#count_event_group_"+id).text()) <= 1) { - $("#delete-"+id).replaceWith('' + <?php echo + '" title="' + + '" src="images/cross.disabled.png">'); + $("#delete-"+id).replaceWith(' <?php echo addslashes(__('Is not allowed delete events in process')); ?>'); } } else { // Remove delete link (if event is not grouped) - $("#delete-"+id).replaceWith('' + <?php echo + '" title="' + + '" src="images/cross.disabled.png">'); + $("#delete-"+id).replaceWith('<?php echo addslashes(__('Is not allowed delete events in process')); ?> '); } // Change state image @@ -1044,8 +1044,8 @@ function validate_event_advanced(id, new_status) { $("#in-progress-"+id).remove(); // Format the new disabled delete icon. $("#validate-"+id).parent().append(""); - $("#delete-"+id).attr ("data-title", ); - $("#delete-"+id).attr ("alt", ); + $("#delete-"+id).attr ("data-title", ""); + $("#delete-"+id).attr ("alt"," "); $("#delete-"+id).attr ("data-use_title_for_force_title", 1); $("#delete-"+id).attr ("class", "forced_title"); @@ -1098,4 +1098,4 @@ if ($load_event) { } ?> /* ]]> */ - + \ No newline at end of file From 7d88af625e17bca59a0e467fa82e4c4606a2bc7e Mon Sep 17 00:00:00 2001 From: samucarc Date: Mon, 4 Mar 2019 15:53:47 +0100 Subject: [PATCH 03/63] Added module units in module graphs Former-commit-id: d17383bd9e8ea7101cf5479b01e2ab0bf45c6813 --- pandora_console/include/functions.php | 12 ++++++------ pandora_console/include/functions_graph.php | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index e1861e70a3..7543e30413 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3533,21 +3533,21 @@ function series_type_graph_array($data, $show_elements_graph) && is_array($show_elements_graph['labels']) && (count($show_elements_graph['labels']) > 0) ) { - if ($show_elements_graph['unit']) { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$show_elements_graph['unit'].': '; + if ($value['unit']) { + $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$value['unit'].': '; } else { $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].': '; } } else { if (strpos($key, 'baseline') !== false) { - if ($show_elements_graph['unit']) { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$show_elements_graph['unit'].'Baseline '; + if ($value['unit']) { + $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$value['unit'].'Baseline '; } else { $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].'Baseline '; } } else { - if ($show_elements_graph['unit']) { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$show_elements_graph['unit'].': '; + if ($value['unit']) { + $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$value['unit'].': '; } else { $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].': '; } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 71049d7804..72667e0480 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -256,6 +256,7 @@ function grafico_modulo_sparse_data( $array_data['sum'.$series_suffix]['agent_name'] = $data_module_graph['agent_name']; $array_data['sum'.$series_suffix]['module_name'] = $data_module_graph['module_name']; $array_data['sum'.$series_suffix]['agent_alias'] = $data_module_graph['agent_alias']; + $array_data['sum'.$series_suffix]['unit'] = $data_module_graph['unit']; // This is for a specific type of report that consists in passing an interval and doing the average sum and avg. if ($params['force_interval'] != '') { @@ -754,6 +755,7 @@ function grafico_modulo_sparse($params) $data_module_graph['c_min'] = $module_data['min_critical']; $data_module_graph['c_max'] = $module_data['max_critical']; $data_module_graph['c_inv'] = $module_data['critical_inverse']; + $data_module_graph['unit'] = $module_data['unit']; } else { $data_module_graph = false; } @@ -1352,6 +1354,7 @@ function graphic_combined_module( $data_module_graph['c_max'] = $module_data['max_critical']; $data_module_graph['c_inv'] = $module_data['critical_inverse']; $data_module_graph['module_id'] = $agent_module_id; + $data_module_graph['unit'] = $module_data['unit']; // stract data $array_data_module = grafico_modulo_sparse_data( From 00eb2766a94fb561dbf0eb92c838e18e3e3aa8ad Mon Sep 17 00:00:00 2001 From: samucarc Date: Tue, 5 Mar 2019 18:06:50 +0100 Subject: [PATCH 04/63] Fixed labels in automatic combined graphs Former-commit-id: f91777c30da55edc43d021b87cda2c0105626f64 --- pandora_console/include/functions.php | 8 ++------ pandora_console/include/functions_graph.php | 4 ++-- pandora_console/include/functions_reporting.php | 4 ++++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 7543e30413..2691a7b0d8 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3529,15 +3529,11 @@ function series_type_graph_array($data, $show_elements_graph) break; } - if (isset($show_elements_graph['labels']) + if (isset($show_elements_graph['labels'][$value['agent_module_id']]) && is_array($show_elements_graph['labels']) && (count($show_elements_graph['labels']) > 0) ) { - if ($value['unit']) { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$value['unit'].': '; - } else { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].': '; - } + $name_legend = $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']].' '; } else { if (strpos($key, 'baseline') !== false) { if ($value['unit']) { diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 72667e0480..d97817eb3f 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1222,11 +1222,11 @@ function graphic_combined_module( foreach ($sources as $source) { array_push($modules, $source['id_agent_module']); array_push($weights, $source['weight']); - if ($source['label'] != '') { + if ($source['label'] != '' || $params_combined['labels']) { $item['type'] = 'custom_graph'; $item['id_agent'] = agents_get_module_id($source['id_agent_module']); $item['id_agent_module'] = $source['id_agent_module']; - $labels[$source['id_agent_module']] = reporting_label_macro($item, $source['label']); + $labels[$source['id_agent_module']] = ($source['label'] != '') ? reporting_label_macro($item, $source['label']) : reporting_label_macro($item, $params_combined['labels']); } } } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 1581119772..1b612ebf80 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4384,6 +4384,9 @@ function reporting_value($report, $content, $type, $pdf=false) $return['description'] = $content['description']; $return['date'] = reporting_get_date_text($report, $content); $return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : ''; + $return['agents'] = [$content['id_agent']]; + $return['id_agent'] = $content['id_agent']; + $return['id_agent_module'] = $content['id_agent_module']; $return['agent_name'] = $agent_name; $return['module_name'] = $module_name; @@ -7072,6 +7075,7 @@ function reporting_custom_graph( 'modules_series' => $graphs[0]['modules_series'], 'id_graph' => $id_graph, 'type_report' => $type_report, + 'labels' => $content['style']['label'], ]; $return['chart'] = graphic_combined_module( From 9db9d1644cc4f3327e334d06895cf0b5c376716b Mon Sep 17 00:00:00 2001 From: samucarc Date: Wed, 6 Mar 2019 11:25:47 +0100 Subject: [PATCH 05/63] Eliminated the cache when update agents Former-commit-id: 4e52c0f85ae68a5658c8cd40e72064b48c644934 --- pandora_console/godmode/agentes/configurar_agente.php | 2 +- pandora_console/include/db/mysql.php | 4 ++-- pandora_console/include/functions_db.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 9c10099042..f6e3cbfb0d 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1067,7 +1067,7 @@ if ($id_agente) { exit; } - $agent = db_get_row('tagente', 'id_agente', $id_agente); + $agent = db_get_row('tagente', 'id_agente', $id_agente, false, false); if (empty($agent)) { // Close out the page ui_print_error_message(__('There was a problem loading the agent')); diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index 82b654e374..17f5712d2c 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -205,7 +205,7 @@ function mysql_db_get_value($field, $table, $field_search=1, $condition=1, $sear * * @return mixed The first row of a database query or false. */ -function mysql_db_get_row($table, $field_search, $condition, $fields=false) +function mysql_db_get_row($table, $field_search, $condition, $fields=false, $cache=true) { if (empty($fields)) { $fields = '*'; @@ -243,7 +243,7 @@ function mysql_db_get_row($table, $field_search, $condition, $fields=false) ); } - $result = db_get_all_rows_sql($sql); + $result = db_get_all_rows_sql($sql, false, $cache); if ($result === false) { return false; diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 9018a1044d..2061ab215c 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -421,13 +421,13 @@ function db_get_row_sql($sql, $search_history_db=false) * * @return mixed The first row of a database query or false. */ -function db_get_row($table, $field_search, $condition, $fields=false) +function db_get_row($table, $field_search, $condition, $fields=false, $cache=true) { global $config; switch ($config['dbtype']) { case 'mysql': - return mysql_db_get_row($table, $field_search, $condition, $fields); + return mysql_db_get_row($table, $field_search, $condition, $fields, $cache); break; case 'postgresql': From 94768935eea75a6694175a5935f13b04aae0a583 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Tue, 26 Mar 2019 15:42:56 +0100 Subject: [PATCH 06/63] Pending to review Former-commit-id: c874be78a33585942c825f23b48010b2d604cd7c --- pandora_console/operation/events/events.build_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index d38bd1918e..0d214a36d1 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -896,7 +896,7 @@ if ($group_rep == 2) { // Checkbox $data[$i] = html_print_checkbox_extended('validate_ids[]', $event['id_evento'], false, false, false, 'class="chk_val"', true); } else if (isset($table->header[$i]) || true) { - $data[$i] = ''; + $data[$i] = html_print_checkbox_extended('validate_ids[]', $event['id_evento'], false, false, false, 'class="chk_val"', true); } } From 8b5744a6c1db6460f6b026bce2b58e5d8793bfcf Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Fri, 29 Mar 2019 15:00:52 +0100 Subject: [PATCH 07/63] Added unknown status image Former-commit-id: 1b7da57a8f3f409902053a9e5c05edeb28b67033 --- pandora_console/operation/search_modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandora_console/operation/search_modules.php b/pandora_console/operation/search_modules.php index 687dea13e2..bb86159035 100644 --- a/pandora_console/operation/search_modules.php +++ b/pandora_console/operation/search_modules.php @@ -108,6 +108,12 @@ if (!$modules || !$searchModules) { __('WARNING').': '.modules_get_last_value($module['id_agente_modulo']), true ); + } else if ($status_sql['estado'] == 3) { + $statusCell = ui_print_status_image( + STATUS_MODULE_UNKNOWN, + __('UNKNOWN').': '.modules_get_last_value($module['id_agente_modulo']), + true + ); } else { $last_status = modules_get_agentmodule_last_status($module['id_agente_modulo']); switch ($last_status) { From bc00a1b3b93865b287534644aab791f47d0e0539 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Tue, 9 Apr 2019 10:39:07 +0200 Subject: [PATCH 08/63] Fixed select bug not selectig value Former-commit-id: 8c53c1cfd294326123d5efb65af1095ddf35c34c --- pandora_console/include/functions_visual_map_editor.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 151014cd01..fe15482ef6 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -1394,6 +1394,9 @@ function visual_map_editor_print_hack_translate_strings() - + "; @@ -175,8 +175,28 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); $unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id); - echo '
'; + + // MENU + $menu_form = "
".html_print_input_hidden('id', $id, true).html_print_input_hidden('label', $label, true); + + if (!empty($server_id)) { + $menu_form .= html_print_input_hidden('server', $server_id, true); + } + + if (isset($_GET['type'])) { + $type = get_parameter_get('type'); + $menu_form .= html_print_input_hidden('type', $type, true); + } + + echo $menu_form; + + echo ''; + + echo '
'; + + + echo '
'; $width = '90%'; $height = '450'; @@ -228,39 +248,16 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); echo '
'; - // - // SIDE MENU - // - $params = []; - // TOP TEXT - // Use the no_meta parameter because this image is only in the base console - $params['top_text'] = "
".html_print_image('images/wrench_blanco.png', true, ['width' => '16px'], false, false, true).' '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_w.png', true).'
'; - $params['body_text'] = "'; - unset($table); - $table = new stdClass(); - $table->id = 'stat_win_form'; - $table->width = '100%'; - $table->cellspacing = 2; - $table->cellpadding = 2; - $table->class = 'databox'; - $data = []; - $data[0] = html_print_div( - [ - 'id' => 'field_list', - 'content' => $form_table, - 'style' => 'overflow: auto; height: 220px', - ], - true - ); - $table->data[] = $data; - $table->rowclass[] = ''; - - $params['body_text'] .= html_print_table($table, true); - $params['body_text'] .= ''; - $params['body_text'] .= '
'; - // outer - // ICONS - $params['icon_closed'] = '/images/graphmenu_arrow_hide.png'; - $params['icon_open'] = '/images/graphmenu_arrow.png'; - - // SIZE - $params['width'] = 500; - - // POSITION - $params['position'] = 'left'; - - html_print_side_layer($params); + echo '
+
+ show/hide + '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).' + Manage +
+ +
'; // Hidden div to forced title html_print_div( @@ -491,11 +462,24 @@ ui_include_time_picker(true); $.datepicker.setDefaults($.datepicker.regional[""]); - $(window).ready(function() { - $("#field_list").css('height', ($(window).height() - 160) + 'px'); +//$(window).ready(function() { + $('.print_menu').append($('.module_graph_menu_dropdown')); +//}); + + + $('#module_graph_menu_header').on('click', function(){ + if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){ + $('.module_graph_menu_content').show(); + $('.module_graph_menu_content').removeClass('module_graph_menu_content_closed'); + $('#module_graph_menu_header .imagen').attr('src',$('#module_graph_menu_header .imagen').attr('src').replace('arrow_down_green','arrow_up_green')) + } + else{ + $('.module_graph_menu_content').hide(); + $('.module_graph_menu_content').addClass('module_graph_menu_content_closed'); + $('#module_graph_menu_header .imagen').attr('src',$('#module_graph_menu_header .imagen').attr('src').replace('arrow_up_green','arrow_down_green')) + } + + }); - $(window).resize(function() { - $("#field_list").css('height', ($(document).height() - 160) + 'px'); - }); From fa14fa9510a2396f5dce0a82bf7ee5b41e036de4 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Tue, 7 May 2019 17:47:47 +0200 Subject: [PATCH 40/63] Show new values after update --- .../godmode/alerts/configure_alert_command.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/alerts/configure_alert_command.php b/pandora_console/godmode/alerts/configure_alert_command.php index 7482c21f63..3e93319b76 100644 --- a/pandora_console/godmode/alerts/configure_alert_command.php +++ b/pandora_console/godmode/alerts/configure_alert_command.php @@ -33,6 +33,7 @@ if (! check_acl($config['id_user'], 0, 'LM')) { $update_command = (bool) get_parameter('update_command'); $id = (int) get_parameter('id'); $pure = get_parameter('pure', 0); +$alert = []; // Header if (defined('METACONSOLE')) { @@ -86,7 +87,15 @@ if ($update_command) { $result = ''; } else { $result = alerts_update_alert_command($id, $values); - $info = '{"Name":"'.$name.'","Command":"'.$command.'","Description":"'.$description.' '.$info_fields.'"}'; + if ($result) { + $info = '{"Name":"'.$name.'","Command":"'.$command.'","Description":"'.$description.' '.$info_fields.'"}'; + $alert['fields_values'] = io_json_mb_encode($fields_values); + $alert['fields_descriptions'] = io_json_mb_encode($fields_descriptions); + $alert['name'] = $name; + $alert['command'] = $command; + $alert['description'] = $description; + $alert['id_group'] = $id_group; + } } if ($result) { @@ -110,7 +119,10 @@ $fields_descriptions = ''; $fields_values = ''; $id_group = 0; if ($id) { - $alert = alerts_get_alert_command($id); + if (!$result) { + $alert = alerts_get_alert_command($id); + } + $name = $alert['name']; $command = $alert['command']; $description = $alert['description']; From 5e0b53e3c23bdaef379fcd1520e827008420400b Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Wed, 8 May 2019 09:35:28 +0200 Subject: [PATCH 41/63] New menu module graph - #3617 --- pandora_console/include/styles/pandora.css | 116 +++++++++++++----- .../operation/agentes/stat_win.php | 54 ++++---- 2 files changed, 106 insertions(+), 64 deletions(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index a897c26247..ba026abbda 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -3598,6 +3598,78 @@ div.simple_value > a > span.text p { cursor: pointer; } +.events_show_more_table { + border-spacing: 0px; + text-align: left; +} + +/* Modal window - Show More */ +table.events_show_more_table tr:nth-child(odd) td { + background-color: #ffffff; +} +table.events_show_more_table tr:nth-child(even) td { + background-color: #f5f5f5; + border-top: 1px solid #cacaca; + border-bottom: 1px solid #cacaca; +} + +table.events_show_more_table tr td { + height: 22px; + padding: 4px; +} + +table.events_show_more_table tr td:first-child { + width: 35%; + font-weight: bold; + padding-left: 20px; +} + +ul.events_tabs { + background: #ffffff !important; + border: 0px; + display: flex; + justify-content: space-between; + padding: 0px !important; +} + +ul.events_tabs:before, +ul.events_tabs:after { + content: none !important; +} + +ul.events_tabs > li { + margin: 0 !important; + width: 20%; + text-align: center; + float: none !important; + outline-width: 0; +} + +ul.events_tabs > li.ui-state-default { + background: #fff !important; + border: none !important; + border-bottom: 2px solid black !important; +} + +ul.events_tabs > li a { + text-align: center; + float: none !important; + padding: 8px !important; + display: block; +} + +ul.events_tabs > li span { + position: relative; + top: -6px; + left: 5px; + margin-right: 10px; +} + +ul.events_tabs > li.ui-tabs-active { + border-bottom: 2px solid #82b92e !important; + border-top: 2px solid #82b92e !important; +} + /* * --------------------------------------------------------------------- * - modal window and edit user - @@ -5439,36 +5511,18 @@ table.info_table.policy_sub_table { align-items: flex-start; } -/* mergear esto antes */ - -table.events_show_more_table tr:nth-child(odd) td { - background-color: #ffffff; -} -table.events_show_more_table tr:nth-child(even) td { - background-color: #f5f5f5; - border-top: 1px solid #cacaca; - border-bottom: 1px solid #cacaca; -} - -table.events_show_more_table tr td { - height: 22px; - padding: 4px; -} - -table.events_show_more_table tr td:first-child { - width: 35%; - font-weight: bold; - padding-left: 20px; -} - -/* nuevassss */ +/* + * --------------------------------------------------------------------- + * - MODULE GRAPHS + * --------------------------------------------------------------------- + */ .module_graph_menu_dropdown { padding-top: 20px; padding-bottom: 20px; position: absolute; top: 10px; width: 100%; - z-index: 1; + z-index: 1001; } .module_graph_menu_content, @@ -5480,13 +5534,6 @@ table.events_show_more_table tr td:first-child { background-color: #fff; } -.module_graph_menu_content { - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - padding: 15px; - border-top: none; -} - .module_graph_menu_header { border-top-left-radius: 4px; border-top-right-radius: 4px; @@ -5501,3 +5548,10 @@ table.events_show_more_table tr td:first-child { vertical-align: middle; padding-left: 5px; } + +.module_graph_menu_content { + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + padding: 15px; + border-top: none; +} diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 767bc3de2a..f04a3eafa4 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -176,26 +176,7 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); $unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id); - - // MENU - $menu_form = "
".html_print_input_hidden('id', $id, true).html_print_input_hidden('label', $label, true); - - if (!empty($server_id)) { - $menu_form .= html_print_input_hidden('server', $server_id, true); - } - - if (isset($_GET['type'])) { - $type = get_parameter_get('type'); - $menu_form .= html_print_input_hidden('type', $type, true); - } - - echo $menu_form; - - echo ''; - - echo '
'; - - + // Graph. echo '
'; $width = '90%'; $height = '450'; @@ -250,7 +231,7 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); - // FORM TABLE + // FORM TABLE. $table = html_get_predefined_table('transparent', 2); $table->width = '100%'; $table->id = 'stat_win_form_div'; @@ -405,15 +386,28 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); ).'
'; + // Menu. + $menu_form = "
".html_print_input_hidden('id', $id, true).html_print_input_hidden('label', $label, true); - echo '
+ if (!empty($server_id)) { + $menu_form .= html_print_input_hidden('server', $server_id, true); + } + + if (isset($_GET['type'])) { + $type = get_parameter_get('type'); + $menu_form .= html_print_input_hidden('type', $type, true); + } + + echo $menu_form; + echo '
- show/hide + '.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).' '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).' - Manage + '.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).'
'; + echo ''; // Hidden div to forced title html_print_div( @@ -462,24 +456,18 @@ ui_include_time_picker(true); $.datepicker.setDefaults($.datepicker.regional[""]); -//$(window).ready(function() { - $('.print_menu').append($('.module_graph_menu_dropdown')); -//}); - - + // Menu. $('#module_graph_menu_header').on('click', function(){ if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){ $('.module_graph_menu_content').show(); $('.module_graph_menu_content').removeClass('module_graph_menu_content_closed'); - $('#module_graph_menu_header .imagen').attr('src',$('#module_graph_menu_header .imagen').attr('src').replace('arrow_down_green','arrow_up_green')) + $('#module_graph_menu_header .module_graph_menu_arrow').attr('src',$('#module_graph_menu_header .module_graph_menu_arrow').attr('src').replace('arrow_down_green','arrow_up_green')) } else{ $('.module_graph_menu_content').hide(); $('.module_graph_menu_content').addClass('module_graph_menu_content_closed'); - $('#module_graph_menu_header .imagen').attr('src',$('#module_graph_menu_header .imagen').attr('src').replace('arrow_up_green','arrow_down_green')) + $('#module_graph_menu_header .module_graph_menu_arrow').attr('src',$('#module_graph_menu_header .module_graph_menu_arrow').attr('src').replace('arrow_up_green','arrow_down_green')) } - - }); From cb49de4d81ee7a81a5e6fe0db26c19e966129d00 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Wed, 8 May 2019 10:28:00 +0200 Subject: [PATCH 42/63] New menu module graph - #3617 --- pandora_console/include/javascript/tree/TreeController.js | 6 ++++-- pandora_console/operation/agentes/stat_win.php | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 1ce416e770..b544dbfd95 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -747,9 +747,11 @@ var TreeController = { } } else { try { - winopeng( + winopeng_var( element.moduleGraph.url, - element.moduleGraph.handle + element.moduleGraph.handle, + 1000, + 650 ); } catch (error) { // console.log(error); diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index f04a3eafa4..ef4a448360 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -458,15 +458,18 @@ ui_include_time_picker(true); // Menu. $('#module_graph_menu_header').on('click', function(){ + var arrow = $('#module_graph_menu_header .module_graph_menu_arrow'); + var arrow_up = 'arrow_up_green'; + var arrow_down = 'arrow_down_green'; if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){ $('.module_graph_menu_content').show(); $('.module_graph_menu_content').removeClass('module_graph_menu_content_closed'); - $('#module_graph_menu_header .module_graph_menu_arrow').attr('src',$('#module_graph_menu_header .module_graph_menu_arrow').attr('src').replace('arrow_down_green','arrow_up_green')) + arrow.attr('src',arrow.attr('src').replace(arrow_down, arrow_up)); } else{ $('.module_graph_menu_content').hide(); $('.module_graph_menu_content').addClass('module_graph_menu_content_closed'); - $('#module_graph_menu_header .module_graph_menu_arrow').attr('src',$('#module_graph_menu_header .module_graph_menu_arrow').attr('src').replace('arrow_up_green','arrow_down_green')) + arrow.attr('src',arrow.attr('src').replace(arrow_up, arrow_down)); } }); From 99f5cab83d56fd5f5e62ba7a263d2b96ed5b20ea Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 8 May 2019 10:55:20 +0200 Subject: [PATCH 43/63] fixed filemanager --- pandora_console/godmode/servers/plugin.php | 3 +-- pandora_console/godmode/setup/file_manager.php | 4 +--- pandora_console/include/functions_filemanager.php | 8 ++------ .../operation/snmpconsole/snmp_mib_uploader.php | 5 +---- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index 08c29b92e2..645815e6c0 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -242,7 +242,6 @@ if ($filemanager) { $chunck_url = '&create=1'; } - $homedir_filemanager = isset($config['homedir_filemanager']) ? $config['homedir_filemanager'] : false; filemanager_file_explorer( $real_directory, $directory, @@ -253,7 +252,7 @@ if ($filemanager) { 'index.php?sec=gservers&sec2=godmode/servers/plugin'.$chunck_url.'&plugin_command=[FILE_FULLPATH]&id_plugin='.$id_plugin, true, 0775, - $homedir_filemanager + false ); } diff --git a/pandora_console/godmode/setup/file_manager.php b/pandora_console/godmode/setup/file_manager.php index 27f3e232c8..6d5e7679b7 100644 --- a/pandora_console/godmode/setup/file_manager.php +++ b/pandora_console/godmode/setup/file_manager.php @@ -66,8 +66,6 @@ $real_directory = realpath($config['homedir'].'/'.$directory); echo '

'.__('Index of %s', $directory).'

'; -$homedir_filemanager = isset($config['homedir_filemanager']) ? $config['homedir_filemanager'] : false; - filemanager_file_explorer( $real_directory, $directory, @@ -78,5 +76,5 @@ filemanager_file_explorer( '', false, '', - $homedir_filemanager + false ); diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index 3df7a65afd..b3aa490edf 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -120,18 +120,13 @@ if (!function_exists('mime_content_type')) { global $config; -if (isset($config['homedir_filemanager'])) { - $homedir_filemanager = trim(io_safe_output($config['homedir_filemanager'])); -} else { - $homedir_filemanager = trim($config['homedir']); -} +$homedir_filemanager = trim($config['homedir']); $sec2 = get_parameter('sec2'); if ($sec2 == 'enterprise/godmode/agentes/collections' || $sec2 == 'advanced/collections') { $homedir_filemanager .= '/attachment/collection/'; } - $upload_file_or_zip = (bool) get_parameter('upload_file_or_zip'); if ($upload_file_or_zip) { @@ -738,6 +733,7 @@ function filemanager_file_explorer( $data[4] .= html_print_input_hidden('delete_file', 1, true); $relative_dir = str_replace($homedir_filemanager, '', str_replace('\\', '/', dirname($fileinfo['realpath']))); + if ($relative_dir[0] == '/') { $relative_dir = substr($relative_dir, 1); } diff --git a/pandora_console/operation/snmpconsole/snmp_mib_uploader.php b/pandora_console/operation/snmpconsole/snmp_mib_uploader.php index 7754fe3743..1fbe2b1823 100644 --- a/pandora_console/operation/snmpconsole/snmp_mib_uploader.php +++ b/pandora_console/operation/snmpconsole/snmp_mib_uploader.php @@ -69,9 +69,6 @@ $real_directory = realpath($config['homedir'].'/'.$directory); ui_print_info_message(__('MIB files will be installed on the system. Please note that a MIB may depend on other MIB. To customize trap definitions use the SNMP trap editor.')); -// echo '

' . __('Index of %s', $directory) . '

'; -$homedir_filemanager = isset($config['homedir_filemanager']) ? $config['homedir_filemanager'] : false; - filemanager_file_explorer( $real_directory, $directory, @@ -82,5 +79,5 @@ filemanager_file_explorer( '', false, '', - $homedir_filemanager + false ); From a9bf83cc5b5b1be4517040e08e130acc5b7dab0d Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 8 May 2019 11:18:12 +0200 Subject: [PATCH 44/63] Fix the call to docker build to always build the latest image. --- extras/docker/build_and_push.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/docker/build_and_push.sh b/extras/docker/build_and_push.sh index 980087cfe5..91e6fa15e5 100755 --- a/extras/docker/build_and_push.sh +++ b/extras/docker/build_and_push.sh @@ -1,3 +1,3 @@ #!/bin/bash -docker build --rm=true --build-arg BRANCH="develop" --build-arg DB_PASS="pandora" -t pandorafms/pandorafms:7 . && \ +docker build --rm=true --pull --no-cache --build-arg BRANCH="develop" --build-arg DB_PASS="pandora" -t pandorafms/pandorafms:7 . && \ docker push pandorafms/pandorafms:7 From ef1149d3bbecadae3620ae18d052a1b1b21366f2 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Wed, 8 May 2019 12:39:53 +0200 Subject: [PATCH 45/63] Fixed get agent status on linked map --- pandora_console/include/functions_visual_map.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 603afe9c90..680d6e3ce9 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -4094,10 +4094,8 @@ function visual_map_get_layout_status($layout_id, $status_data=[], $depth=0) ); } else if (!empty($layout_item_data['id_agent'])) { // Agent. - $agent_status = agents_get_status( - $layout_item_data['id_agent'], - true - ); + $agent = db_get_row('tagente', 'id_agente', $layout_item_data['id_agent']); + $agent_status = agents_get_status_from_counts($agent); $status = visual_map_translate_agent_status( $agent_status ); From 1644b492d2ccfa0e43cd0ec2af0239204c504be2 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 8 May 2019 18:29:33 +0200 Subject: [PATCH 46/63] fixed errors pdf SLA Weekly --- .../include/functions_reporting.php | 2 +- .../include/functions_reporting_html.php | 24 ++----------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 9b67d16b42..a877361766 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -11663,7 +11663,7 @@ function reporting_translate_sla_status_for_graph($status) * * @return html Return table of header. */ -function reporting_header_table_for_pdf(string $title='', string $description='') +function reporting_header_table_for_pdf($title='', $description='') { $result_pdf .= ''; $result_pdf .= ''; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index dc6010e34a..10bef8631f 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -1026,11 +1026,9 @@ function reporting_html_event_report_group($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1046,7 +1044,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_agent']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1064,7 +1061,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_user_validator']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1082,7 +1078,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_criticity']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1100,7 +1095,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['validated_vs_unvalidated']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1117,7 +1111,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); @@ -1233,11 +1226,9 @@ function reporting_html_event_report_module($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1253,7 +1244,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_agent']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1271,7 +1261,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_user_validator']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1289,7 +1278,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_criticity']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1307,7 +1295,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['validated_vs_unvalidated']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -1326,7 +1313,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); @@ -2021,11 +2007,9 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -2042,7 +2026,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_user_validator']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -2060,7 +2043,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['by_criticity']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -2078,7 +2060,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) $table1->data[0][0] = $item['chart']['validated_vs_unvalidated']; if ($pdf) { - $table1->class = 'table-beauty'; $pdf_export .= html_print_table($table1, true); $pdf_export .= '
'; } else { @@ -2095,7 +2076,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) if ($pdf) { $table0 = new stdClass(); $table0->width = '99%'; - $table0->class = 'table-beauty'; $table0->data['count_row']['count'] = 'Total events: '.$item['total_events']; $pdf_export = html_print_table($table0, true); @@ -2438,7 +2418,7 @@ function reporting_html_alert_report($table, $item, $pdf=0) $table->data['alerts']['cell'] = html_print_table($table1, true); if ($pdf) { - $table1->class = 'table-beauty pdf_alert_table'; + $table1->class = 'pdf_alert_table'; return html_print_table($table1, true); } } @@ -4937,7 +4917,7 @@ function reporting_html_planned_downtimes_table($planned_downtimes) if ($for_pdf) { $table->titlestyle = 'background: #373737; color: #FFF; display: table-cell; font-size: 12px; border: 1px solid grey'; - $table->class = 'table_sla table_beauty'; + $table->class = 'table_sla'; for ($i = 0; $i < count($table->head); $i++) { $table->headstyle[$i] = 'background: #666; color: #FFF; display: table-cell; font-size: 11px; border: 1px solid grey'; From 7da73afd08ba406e7ce06b1d46ea0ec229131140 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 9 May 2019 00:01:10 +0200 Subject: [PATCH 47/63] 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 b6b934ff33..cebf58c0cc 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.734-190508 +Version: 7.0NG.734-190509 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 dd1d3f1dfc..05ee21ba04 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.734-190508" +pandora_version="7.0NG.734-190509" 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 040bff38d6..fb8671b220 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.734'; -use constant AGENT_BUILD => '190508'; +use constant AGENT_BUILD => '190509'; # 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 5615f6fe39..8b89542a17 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.734 -%define release 190508 +%define release 190509 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 ee07bff69d..4c5fed356c 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.734 -%define release 190508 +%define release 190509 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 1b8d3c6336..e18f072efc 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.734" -PI_BUILD="190508" +PI_BUILD="190509" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 1cffee5906..20da7b7ae4 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190508} +{190509} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 5b1741c5de..7a34c41bbe 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.734(Build 190508)") +#define PANDORA_VERSION ("7.0NG.734(Build 190509)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 98cf70c65e..d792109417 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.734(Build 190508))" + VALUE "ProductVersion", "(7.0NG.734(Build 190509))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 17e5b06504..11235f2a12 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.734-190508 +Version: 7.0NG.734-190509 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 e6d06c1376..7f82def4f9 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.734-190508" +pandora_version="7.0NG.734-190509" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 9ef83cd110..20e2fb9004 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 = 'PC190508'; +$build_version = 'PC190509'; $pandora_version = 'v7.0NG.734'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index b0b2960ac8..614151bc47 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 8028827a16..73d08f06a5 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.734 -%define release 190508 +%define release 190509 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index c25651aa26..231349ee24 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.734 -%define release 190508 +%define release 190509 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 119f0a06c8..1896c72705 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.734" -PI_BUILD="190508" +PI_BUILD="190509" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index b4d33cb816..881f73940b 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.734 PS190508"; +my $version = "7.0NG.734 PS190509"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 8b638ec31d..babf1f7eff 100644 --- 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.734 PS190508"; +my $version = "7.0NG.734 PS190509"; # save program name for logging my $progname = basename($0); From f5114918b50ea0148725410ff7236c32a9478ea3 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Thu, 9 May 2019 08:45:55 +0200 Subject: [PATCH 48/63] Unify the styles of Discovery with Pandora - #4004 --- .../godmode/wizards/HostDevices.class.php | 144 +++++++++--------- .../include/class/CustomNetScan.class.php | 6 +- pandora_console/include/styles/discovery.css | 60 +++----- pandora_console/include/styles/wizard.css | 3 +- 4 files changed, 94 insertions(+), 119 deletions(-) diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index 9ac87d9baa..cd7f52f0df 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -594,11 +594,11 @@ class HostDevices extends Wizard if (isset($this->page) === false || $this->page == 0 ) { - // Comment input - $comment_input ='
'; + $comment_input = '
'; - $comment_input .= $this->printInput([ + $comment_input .= $this->printInput( + [ 'name' => 'comment', 'rows' => 1, 'columns' => 1, @@ -606,49 +606,55 @@ class HostDevices extends Wizard 'type' => 'textarea', 'size' => 25, 'class' => 'discovery_textarea_input', - 'return' => true - ]); + 'return' => true, + ] + ); // Task input $taskname_input_label = '
'; - $taskname_input = $this->printInput([ + $taskname_input = $this->printInput( + [ 'name' => 'taskname', 'value' => $this->task['name'], 'type' => 'text', 'size' => 25, - 'class' => 'discovery_full_width_input' - ]); + 'class' => 'discovery_full_width_input', + ] + ); // Network input $network_input_label .= '
'.ui_print_help_tip(__('You can specify several networks, separated by commas, for example: 192.168.50.0/24,192.168.60.0/24'), true).'
'; - $network_input = $this->printInput([ + $network_input = $this->printInput( + [ 'name' => 'network', 'value' => $this->task['subnet'], 'type' => 'text', 'size' => 25, 'class' => 'discovery_full_width_input', - ]); - + ] + ); // Discovery server input $discovery_server_select_label = '
'.ui_print_help_tip(__('You must select a Discovery Server to run the Task, otherwise the Recon Task will never run'), true).'
'; - $discovery_server_select = $this->printInput([ - 'type' => 'select_from_sql', - 'sql' => sprintf( - 'SELECT id_server, name + $discovery_server_select = $this->printInput( + [ + 'type' => 'select_from_sql', + 'sql' => sprintf( + 'SELECT id_server, name FROM tserver WHERE server_type = %d ORDER BY name', - SERVER_TYPE_DISCOVERY - ), - 'name' => 'id_recon_server', - 'selected' => $this->task['id_recon_server'], - 'return' => true, - 'style' => 'width: 100%', - ]); + SERVER_TYPE_DISCOVERY + ), + 'name' => 'id_recon_server', + 'selected' => $this->task['id_recon_server'], + 'return' => true, + 'style' => 'width: 100%', + ] + ); // Interval input $interv_manual = 0; @@ -658,38 +664,40 @@ class HostDevices extends Wizard $interval_input_label = '
'.ui_print_help_tip(__('Manual interval means that it will run only on demand.'), true).'
'; - $interval_input = $this->printInput([ - 'type' => 'select', - 'selected' => $interv_manual, - 'fields' => [ - 0 => __('Defined'), - 1 => __('Manual'), - ], - 'name' => 'interval_manual_defined', - 'return' => true, - 'style' => 'float: right;' - ]); + $interval_input = $this->printInput( + [ + 'type' => 'select', + 'selected' => $interv_manual, + 'fields' => [ + 0 => __('Defined'), + 1 => __('Manual'), + ], + 'name' => 'interval_manual_defined', + 'return' => true, + 'style' => 'float: right;', + ] + ); $interval_input_extra = ''.html_print_extended_select_for_time( - 'interval', - $this->task['interval_sweep'], - '', - '', - '0', - false, - true, - false, - false - ).ui_print_help_tip( - __('The minimum recomended interval for Recon Task is 5 minutes'), - true - ).''; - + 'interval', + $this->task['interval_sweep'], + '', + '', + '0', + false, + true, + false, + false + ).ui_print_help_tip( + __('The minimum recomended interval for Recon Task is 5 minutes'), + true + ).''; // Group select $group_select = '
'; - $group_select .= $this->printInput([ + $group_select .= $this->printInput( + [ 'name' => 'id_group', 'returnAllGroup' => false, 'privilege' => 'PM', @@ -699,15 +707,18 @@ class HostDevices extends Wizard 'class' => 'discovery_list_input', 'size' => 9, 'simple_multiple_options' => true, - ]); + ] + ); - if (isset($this->task['id_rt']) === true) { - //Propagate ID - $task_hidden = $this->printInput([ - 'name' => 'task', - 'value' => $this->task['id_rt'], - 'type' => 'hidden' - ]); + if (isset($this->task['id_rt']) === true) { + // Propagate ID + $task_hidden = $this->printInput( + [ + 'name' => 'task', + 'value' => $this->task['id_rt'], + 'type' => 'hidden', + ] + ); } $task_url = ''; @@ -725,32 +736,20 @@ class HostDevices extends Wizard // XXX: Could be improved validating inputs before continue (JS) // Print NetScan page 0. - //$this->printForm($form); - + // $this->printForm($form); echo '
'; echo $task_hidden; echo '
-
' - .'
'.html_print_image ("images/wizard/netscan_green.png", true, array ("title" => __('Close'), "style" => 'width: 60%;'), false).'
' - .'
'.$interval_input_label.'
'.$interval_input.'
'.$interval_input_extra.'
' - .'
+
'.'
'.html_print_image('images/wizard/netscan_green.png', true, ['title' => __('Close')], false).'
'.'
'.$interval_input_label.'
'.$interval_input.'
'.$interval_input_extra.'
'.'
-
'.$taskname_input_label.'
'.$taskname_input.'
' - .'
'.$discovery_server_select_label.$discovery_server_select.'
' - .'
'.$network_input_label.'
'.$network_input.'
' - .'
' - .'
'.$group_select.'
' - .'
' - - .'
+
'.$taskname_input_label.'
'.$taskname_input.'
'.'
'.$discovery_server_select_label.$discovery_server_select.'
'.'
'.$network_input_label.'
'.$network_input.'
'.'
'.'
'.$group_select.'
'.'
'.'
'.$comment_input.'
-
' - .'
'; + '.''; $str = __('Next'); @@ -778,7 +777,6 @@ class HostDevices extends Wizard }).change(); '; - } } diff --git a/pandora_console/include/class/CustomNetScan.class.php b/pandora_console/include/class/CustomNetScan.class.php index 078d23fa6b..dc28a696e7 100644 --- a/pandora_console/include/class/CustomNetScan.class.php +++ b/pandora_console/include/class/CustomNetScan.class.php @@ -443,7 +443,7 @@ class CustomNetScan extends Wizard 'name' => 'taskname', 'value' => $this->task['name'], 'type' => 'text', - 'size' => 25, + 'size' => 50, ], ]; @@ -465,7 +465,7 @@ class CustomNetScan extends Wizard 'name' => 'comment', 'value' => $this->task['description'], 'type' => 'text', - 'size' => 25, + 'size' => 50, ], ]; @@ -652,7 +652,7 @@ class CustomNetScan extends Wizard 'value' => $explanation, 'return' => true, 'attributes' => 'style="width: 388px;"', - 'class' => 'discovery_textarea_input' + 'class' => 'discovery_textarea_input', ], ]; diff --git a/pandora_console/include/styles/discovery.css b/pandora_console/include/styles/discovery.css index 51b4e98c10..28d4456a55 100644 --- a/pandora_console/include/styles/discovery.css +++ b/pandora_console/include/styles/discovery.css @@ -162,7 +162,7 @@ span.breadcrumb_link { .edit_discovery_info { display: flex; - align-items: center; + align-items: flex-start; padding-top: 25px; } @@ -181,63 +181,41 @@ span.breadcrumb_link { label { color: #343434 !important; - font-size: 1.5em; - font-family: "lato-bolder", "Open Sans", sans-serif !important; font-weight: bold; - margin: 0px 0px 5px 0px; } .discovery_full_width_input { width: 100%; } -select { - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1.6em !important; - color: #686868; +li > input[type="text"], +li > input[type="password"], +.discovery_text_input > input[type="password"], +.discovery_text_input > input[type="text"], +#interval_manual > input[type="text"] { + background-color: transparent !important; + border: none; + border-radius: 0 !important; + border-bottom: 1px solid #343434; + padding: 0px 0px 2px 0px; + box-sizing: border-box; + margin-bottom: 4px; } -select > option { - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1em !important; -} - -li > input[type=text], li > input[type=password], .discovery_text_input > input[type=password], .discovery_text_input > input[type=text], #interval_manual > input[type=text] { - background-color: transparent !important; - border: none; - border-radius: 0 !important; - border-bottom: 1px solid #343434; - padding: 0px 0px 2px 0px; - box-sizing: border-box; - margin-bottom: 4px; - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1.6em; -} - -li > input[type=text]:focus, li > input[type=password]:focus, .discovery_text_input > input[type=password]:focus, .discovery_text_input > input[type=text]:focus, #interval_manual > input[type=text]:focus { - font-weight: bold; -} - -#interval_manual > input[type=text] { +#interval_manual > input[type="text"] { width: 50px; margin-left: 10px; margin-right: 10px; } .discovery_list_input { - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1.6em !important; - color: #686868; width: 100%; - height: 240px; - border: 1px solid #CBCBCB; + border: 1px solid #cbcbcb; overflow-y: auto; } .discovery_list_input option { - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1.1em !important; - padding-left: 30%; + text-align: center; } .discovery_list_input option:checked { @@ -253,11 +231,9 @@ li > input[type=text]:focus, li > input[type=password]:focus, .discovery_text_in max-height: 100px; max-width: 100%; -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ - -moz-box-sizing: border-box; /* Firefox, other Gecko */ + -moz-box-sizing: border-box; /* Firefox, other Gecko */ box-sizing: border-box; resize: none; - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1.4em !important; } a.tip { @@ -270,4 +246,4 @@ a.tip { .discovery_interval_select_width { width: 90%; -} \ No newline at end of file +} diff --git a/pandora_console/include/styles/wizard.css b/pandora_console/include/styles/wizard.css index d7ec2e4ee5..029addf5cb 100644 --- a/pandora_console/include/styles/wizard.css +++ b/pandora_console/include/styles/wizard.css @@ -6,7 +6,8 @@ ul.wizard { } ul.wizard li { - padding: 10px; + padding-bottom: 10px; + padding-top: 10px; } ul.wizard li > label:not(.p-switch) { From fd83540ad5fd2f61fce45cbf3a119d23d4fe2534 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Thu, 9 May 2019 12:39:03 +0200 Subject: [PATCH 49/63] New menu module graph for interface modules- #3617 --- .../agentes/interface_traffic_graph_win.php | 96 +++++++++---------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index 72e8f8989f..e00ed0d254 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -96,7 +96,7 @@ if ($refresh > 0) { --> - + $now) { $urlImage = ui_get_full_url(false); - echo '
'; + // Graph. + echo '
'; $height = 400; $width = '90%'; @@ -177,27 +178,14 @@ if ($date > $now) { echo '
'; - // - // SIDE MENU - // - $side_layer_params = []; - // TOP TEXT - $side_layer_params['top_text'] = "
".html_print_image('/images/config.disabled.png', true, ['width' => '16px'], false, false, false, true).' '.__('Graph configuration menu').'
'; - $side_layer_params['body_text'] = "'; - // outer - // ICONS - $side_layer_params['icon_closed'] = '/images/graphmenu_arrow_hide.png'; - $side_layer_params['icon_open'] = '/images/graphmenu_arrow.png'; - - // SIZE - $side_layer_params['width'] = 500; - - // POSITION - $side_layer_params['position'] = 'left'; - - html_print_side_layer($side_layer_params); + echo $menu_form; + echo '
+
+ '.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).' + '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).' + '.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).' +
+ +
'; + echo ''; // Hidden div to forced title html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]); @@ -341,4 +321,22 @@ ui_include_time_picker(true); $.datepicker.setDefaults($.datepicker.regional[""]); forced_title_callback(); + + // Menu. + $('#module_graph_menu_header').on('click', function(){ + var arrow = $('#module_graph_menu_header .module_graph_menu_arrow'); + var arrow_up = 'arrow_up_green'; + var arrow_down = 'arrow_down_green'; + if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){ + $('.module_graph_menu_content').show(); + $('.module_graph_menu_content').removeClass('module_graph_menu_content_closed'); + arrow.attr('src',arrow.attr('src').replace(arrow_down, arrow_up)); + } + else{ + $('.module_graph_menu_content').hide(); + $('.module_graph_menu_content').addClass('module_graph_menu_content_closed'); + arrow.attr('src',arrow.attr('src').replace(arrow_up, arrow_down)); + } + }); + From e0729b6ca6498f8cd57ca33afb2852580d04ba54 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Thu, 9 May 2019 14:59:47 +0200 Subject: [PATCH 50/63] Se vuelve a crear la rama Former-commit-id: 8ac69d4e1d15be23411faff82dc2bddcfcf7f7b6 --- .../godmode/setup/setup_ehorus.php | 3 +- pandora_console/include/functions_config.php | 2 +- pandora_console/install.php | 1105 ----------------- 3 files changed, 3 insertions(+), 1107 deletions(-) delete mode 100644 pandora_console/install.php diff --git a/pandora_console/godmode/setup/setup_ehorus.php b/pandora_console/godmode/setup/setup_ehorus.php index fc2ebd3d3a..02d7b23ba4 100644 --- a/pandora_console/godmode/setup/setup_ehorus.php +++ b/pandora_console/godmode/setup/setup_ehorus.php @@ -52,8 +52,9 @@ $table_enable->style['name'] = 'font-weight: bold'; // Enable eHorus. $row = []; -$row['name'] = __('Enable eHorus'); +$row['name'] = ('Enable eHorus'); $row['control'] = html_print_checkbox_switch('ehorus_enabled', 1, $config['ehorus_enabled'], true); +$row['button'] = html_print_submit_button(('Update'), 'update_button', false, 'class="sub upd"', true); $table_enable->data['ehorus_enabled'] = $row; // Remote config table. diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 0d258b2bff..dc0e845afb 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1349,7 +1349,7 @@ function config_update_config() break; case 'ehorus': - if (!config_update_value('ehorus_enabled', (int) get_parameter('ehorus_enabled', $config['ehorus_enabled']))) { + if (!config_update_value('ehorus_enabled', (int) get_parameter('ehorus_enabled', 0))) { $error_update[] = __('Enable eHorus'); } diff --git a/pandora_console/install.php b/pandora_console/install.php deleted file mode 100644 index 614151bc47..0000000000 --- a/pandora_console/install.php +++ /dev/null @@ -1,1105 +0,0 @@ - - - - - Pandora FMS - Installation Wizard - - - - - - - - - - - - - - - -
- -
- - - -
'; -} - -function check_include($ext, $label) -{ - echo ''; -} - - -function check_exists($file, $label) -{ - echo ''; -} - - -function check_generic($ok, $label) -{ - echo "'; - echo ''; - return 1; - } else { - echo " "; - echo ''; - echo ''; - return 0; - } -} - - -function check_writable($fullpath, $label) -{ - echo "'; - echo ''; - return 0; - } else { - echo " "; - echo ''; - echo ''; - return 1; - } - } else { - echo " "; - echo ''; - echo ''; - return 1; - } -} - - -function check_variable($var, $value, $label, $mode) -{ - echo ''; -} - - -function parse_mysql_dump($url) -{ - if (file_exists($url)) { - $file_content = file($url); - $query = ''; - foreach ($file_content as $sql_line) { - if (trim($sql_line) != '' && strpos($sql_line, '-- ') === false) { - $query .= $sql_line; - if (preg_match("/;[\040]*\$/", $sql_line)) { - if (!$result = mysql_query($query)) { - echo mysql_error(); - // Uncomment for debug - echo "
$query
"; - return 0; - } - - $query = ''; - } - } - } - - return 1; - } else { - return 0; - } -} - - -function parse_mysqli_dump($connection, $url) -{ - if (file_exists($url)) { - $file_content = file($url); - $query = ''; - foreach ($file_content as $sql_line) { - if (trim($sql_line) != '' && strpos($sql_line, '-- ') === false) { - $query .= $sql_line; - if (preg_match("/;[\040]*\$/", $sql_line)) { - if (!$result = mysqli_query($connection, $query)) { - echo mysqli_error(); - // Uncomment for debug - echo "
$query
"; - return 0; - } - - $query = ''; - } - } - } - - return 1; - } else { - return 0; - } -} - - -function random_name($size) -{ - $temp = ''; - for ($a = 0; $a < $size; $a++) { - $temp = $temp.chr(rand(122, 97)); - } - - return $temp; -} - - -function print_logo_status($step, $step_total) -{ - global $banner; - - $header = " -
-
-
- $banner -
-
"; - $header .= " -
- Install step $step of $step_total -
"; - - return $header; -} - - -// -// This function adjusts path settings in pandora db for FreeBSD. -// -// All packages and configuration files except operating system's base files -// are installed under /usr/local in FreeBSD. So, path settings in pandora db -// for some programs should be changed from the Linux default. -// -function adjust_paths_for_freebsd($engine, $connection=false) -{ - $adjust_sql = [ - "update trecon_script set script = REPLACE(script,'/usr/share','/usr/local/share');", - "update tconfig set value = REPLACE(value,'/usr/bin','/usr/local/bin') where token='netflow_daemon' OR token='netflow_nfdump' OR token='netflow_nfexpire';", - "update talert_commands set command = REPLACE(command,'/usr/bin','/usr/local/bin');", - "update talert_commands set command = REPLACE(command,'/usr/share', '/usr/local/share');", - "update tplugin set execute = REPLACE(execute,'/usr/share','/usr/local/share');", - "update tevent_response set target = REPLACE(target,'/usr/share','/usr/local/share');", - "insert into tconfig (token, value) VALUES ('graphviz_bin_dir', '/usr/local/bin');", - ]; - - for ($i = 0; $i < count($adjust_sql); $i++) { - switch ($engine) { - case 'mysql': - $result = mysql_query($adjust_sql[$i]); - break; - - case 'mysqli': - $result = mysqli_query($connection, $adjust_sql[$i]); - break; - - case 'oracle': - // Delete the last semicolon from current query - $query = substr($adjust_sql[$i], 0, (strlen($adjust_sql[$i]) - 1)); - $sql = oci_parse($connection, $query); - $result = oci_execute($sql); - break; - - case 'pgsql': - pg_send_query($connection, $adjust_sql[$i]); - $result = pg_get_result($connection); - break; - } - - if (!$result) { - return 0; - } - } - - return 1; -} - - -function install_step1() -{ - global $banner; - - echo " -
-
- ".print_logo_status(1, 6)." -
-

Welcome to Pandora FMS installation Wizard

-

This wizard helps you to quick install Pandora FMS console and main database in your system.

-

In four steps, this installer will check all dependencies and will create your configuration, ready to use.

-

For more information, please refer to documentation.
- Pandora FMS Development Team

- "; - if (file_exists('include/config.php')) { - echo "
Warning: You already have a config.php file. - Configuration and database would be overwritten if you continued.
"; - } - - echo '
'; - echo '
'; - echo " $label "; - echo ''; - if (!extension_loaded($ext)) { - echo ""; - return 1; - } else { - echo ""; - return 0; - } - - echo '
'; - echo " $label "; - echo ''; - if (!include $ext) { - echo ""; - return 1; - } else { - echo ""; - return 0; - } - - echo '
'; - echo " $label "; - echo ''; - if (!file_exists($file)) { - echo " "; - return 1; - } else { - echo " "; - return 0; - } - - echo '
"; - if ($ok == 0) { - echo " "; - echo ''; - echo " $label "; - echo '
'; - echo " $label "; - echo '
"; - if (file_exists($fullpath)) { - if (is_writable($fullpath)) { - echo " "; - echo ''; - echo " $label "; - echo '
'; - echo " $label "; - echo '
'; - echo " $label "; - echo '
'; - echo " $label "; - echo ''; - if ($mode == 1) { - if ($var >= $value) { - echo " "; - return 0; - } else { - echo " "; - return 1; - } - } else if ($var == $value) { - echo " "; - return 0; - } else { - echo " "; - return 1; - } - - echo '
'; - $writable = check_writable('include', 'Checking if ./include is writable'); - if (file_exists('include/config.php')) { - $writable += check_writable('include/config.php', 'Checking if include/config.php is writable'); - } - - echo '
'; - - echo "
Warning: This installer will overwrite and destroy - your existing Pandora FMS configuration and Database. Before continue, - please be sure that you have no valuable Pandora FMS data in your Database.
-
"; - - echo "
Upgrade: - If you want to upgrade from Pandora FMS 4.x to 5.0 version, please use the migration tool inside /extras directory in this setup. -
"; - - echo '
'; - - if ($writable == 0) { - echo "
"; - echo ""; - echo '
'; - } else { - echo "
ERROR:You need to setup permissions to be able to write in ./include directory
"; - } - - echo '
'; - - echo "
"; - echo " - -
- Pandora FMS is an OpenSource Software project registered at - SourceForge -
- "; -} - - -function install_step1_licence() -{ - echo " -
-
- ".print_logo_status(2, 6)." -
-

GPL2 Licence terms agreement

-

Pandora FMS is an OpenSource software project licensed under the GPL2 licence. Pandora FMS includes, as well, another software also licensed under LGPL and BSD licenses. Before continue, you must accept the licence terms.. -

For more information, please refer to our website at http://pandorafms.org and contact us if you have any kind of question about the usage of Pandora FMS

-

If you dont accept the licence terms, please, close your browser and delete Pandora FMS files.

- "; - - if (!file_exists('COPYING')) { - echo "
Licence file 'COPYING' is not present in your distribution. This means you have some 'partial' Pandora FMS distribution. We cannot continue without accepting the licence file."; - echo '
'; - } else { - echo "
"; - echo "'; - echo '

'; - echo "

"; - } - - echo '
'; - - echo "
-
-
- Pandora FMS is an OpenSource Software project registered at - SourceForge -
-
"; -} - - -function install_step2() -{ - echo " -
-
- ".print_logo_status(3, 6)." -
"; - echo '

Checking software dependencies

'; - echo ''; - $res = 0; - $res += check_variable(phpversion(), '7.0', 'PHP version >= 7.0', 1); - $res += check_extension('gd', 'PHP GD extension'); - $res += check_extension('ldap', 'PHP LDAP extension'); - $res += check_extension('snmp', 'PHP SNMP extension'); - $res += check_extension('session', 'PHP session extension'); - $res += check_extension('gettext', 'PHP gettext extension'); - $res += check_extension('mbstring', 'PHP Multibyte String'); - $res += check_extension('zip', 'PHP Zip'); - $res += check_extension('zlib', 'PHP Zlib extension'); - $res += check_extension('json', 'PHP json extension'); - $res += check_extension('curl', 'CURL (Client URL Library)'); - $res += check_extension('filter', 'PHP filter extension'); - $res += check_extension('calendar', 'PHP calendar extension'); - if (PHP_OS == 'FreeBSD') { - $res += check_exists('/usr/local/bin/twopi', 'Graphviz Binary'); - } else if (PHP_OS == 'NetBSD') { - $res += check_exists('/usr/pkg/bin/twopi', 'Graphviz Binary'); - } else if (substr(PHP_OS, 0, 3) == 'WIN') { - $res += check_exists("..\\..\\..\\Graphviz\\bin\\twopi.exe", 'Graphviz Binary'); - } else { - $res += check_exists('/usr/bin/twopi', 'Graphviz Binary'); - } - - echo ''; - check_extension('mysqli', 'PHP MySQL(mysqli) extension'); - echo '
'; - echo "DB Engines"; - echo ''; - echo '
'; - - if ($res > 0) { - echo " -
You have some incomplete - dependencies. Please correct them or this installer - will not be able to finish your installation. -
-
- Remember, if you install any PHP module to comply - with these dependences, you need to restart - your HTTP/Apache server after it to use the new - modules. -
-
- Ignore it. -
"; - } else { - echo "
"; - echo " - "; - echo '
'; - } - - echo '
'; - echo "
"; - echo " -
-
-
-
- Pandora FMS is an OpenSource Software project registered at - SourceForge -
- "; -} - - -function install_step3() -{ - $options = ''; - if (extension_loaded('mysql')) { - $options .= ""; - } - - if (extension_loaded('mysqli')) { - $options .= ""; - } - - $error = false; - if (empty($options)) { - $error = true; - } - - echo " -
-
- ".print_logo_status(4, 6)." -
-

Environment and database setup

-

- This wizard will create your Pandora FMS database, - and populate it with all the data needed to run for the first time. -

-

- You need a privileged user to create database schema, this is usually root user. - Information about root user will not be used or stored anymore. -

-

- You can also deploy the scheme into an existing Database. - In this case you need a privileged Database user and password of that instance. -

-

- Now, please, complete all details to configure your database and environment setup. -

-
- Warning: This installer will overwrite and destroy your existing - Pandora FMS configuration and Database. Before continue, - please be sure that you have no valuable Pandora FMS data in your Database. -

-
"; - - if (extension_loaded('oci8')) { - echo "
For Oracle installation an existing Database with a privileged user is needed.
"; - } - - if (!$error) { - echo ""; - } - - echo ""; - echo '"; - - // the field dbgrant is only shown when the DB host is different from 127.0.0.1 or localhost - echo " - - "; - - echo " "; - - echo ""; - echo '
'; - echo 'DB Engine
'; - - if ($error) { - echo " -
- Warning: You haven't a any DB engine with PHP. Please check the previous step to DB engine dependencies. -
"; - } else { - echo "'; - - echo '
'; - echo ' Installation in
'; - echo "'; - } - - echo "
DB User with privileges
- - -
DB Password for this user
- - -
DB Hostname
- - -
DB Name (pandora by default)
- - -
Drop Database if exists
- -
Full path to HTTP publication directory
- For example /var/www/pandora_console/ -
- - -
'; - echo "URL path to Pandora FMS Console
- For example '/pandora_console' -
- -
- "; - - if (!$error) { - echo "
"; - echo " - "; - echo '
'; - ?> - - '; - - echo ''; - - echo "
"; - echo "
-
- Pandora FMS is an OpenSource Software project registered at - SourceForge -
-
"; -} - - -function install_step4() -{ - $pandora_config = 'include/config.php'; - - if ((! isset($_POST['user'])) || (! isset($_POST['dbname'])) || (! isset($_POST['host'])) - || (! isset($_POST['pass'])) || (!isset($_POST['engine'])) || (! isset($_POST['db_action'])) - ) { - $dbpassword = ''; - $dbuser = ''; - $dbhost = ''; - $dbname = ''; - $engine = ''; - $dbaction = ''; - $dbgrant = ''; - } else { - $engine = $_POST['engine']; - $dbpassword = $_POST['pass']; - $dbuser = $_POST['user']; - $dbhost = $_POST['host']; - $dbaction = $_POST['db_action']; - if (isset($_POST['dbgrant']) && $_POST['dbgrant'] != '') { - $dbgrant = $_POST['dbgrant']; - } else { - $dbgrant = $_SERVER['SERVER_ADDR']; - } - - if (isset($_POST['drop'])) { - $dbdrop = $_POST['drop']; - } else { - $dbdrop = 0; - } - - $dbname = $_POST['dbname']; - if (isset($_POST['url'])) { - $url = $_POST['url']; - } else { - $url = 'http://localhost'; - } - - if (isset($_POST['path'])) { - $path = $_POST['path']; - $path = str_replace('\\', '/', $path); - // Windows compatibility - } else { - $path = '/var/www'; - } - } - - $everything_ok = 0; - $step1 = 0; - $step2 = 0; - $step3 = 0; - $step4 = 0; - $step5 = 0; - $step6 = 0; - $step7 = 0; - - echo " -
-
- ".print_logo_status(5, 6)." -
-

Creating database and default configuration file

- "; - switch ($engine) { - case 'mysql': - if (! mysql_connect($dbhost, $dbuser, $dbpassword)) { - check_generic(0, 'Connection with Database'); - } else { - check_generic(1, 'Connection with Database'); - - // Drop database if needed and don't want to install over an existing DB - if ($dbdrop == 1) { - mysql_query("DROP DATABASE IF EXISTS `$dbname`"); - } - - // Create schema - if ($dbaction == 'db_new' || $dbdrop == 1) { - $step1 = mysql_query("CREATE DATABASE `$dbname`"); - check_generic($step1, "Creating database '$dbname'"); - } else { - $step1 = 1; - } - - if ($step1 == 1) { - $step2 = mysql_select_db($dbname); - check_generic($step2, "Opening database '$dbname'"); - - $step3 = parse_mysql_dump('pandoradb.sql'); - check_generic($step3, 'Creating schema'); - - $step4 = parse_mysql_dump('pandoradb_data.sql'); - check_generic($step4, 'Populating database'); - if (PHP_OS == 'FreeBSD') { - $step_freebsd = adjust_paths_for_freebsd($engine); - check_generic($step_freebsd, 'Adjusting paths in database for FreeBSD'); - } - - $random_password = random_name(8); - $host = $dbhost; - // set default granted origin to the origin of the queries - if (($dbhost != 'localhost') && ($dbhost != '127.0.0.1')) { - $host = $dbgrant; - // if the granted origin is different from local machine, set the valid origin - } - - $step5 = mysql_query( - "GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host - IDENTIFIED BY '".$random_password."'" - ); - mysql_query('FLUSH PRIVILEGES'); - check_generic($step5, "Established privileges for user pandora. A new random password has been generated: $random_password
Please write it down, you will need to setup your Pandora FMS server, editing the /etc/pandora/pandora_server.conf file
"); - - $step6 = is_writable('include'); - check_generic($step6, "Write permissions to save config file in './include'"); - - $cfgin = fopen('include/config.inc.php', 'r'); - $cfgout = fopen($pandora_config, 'w'); - $config_contents = fread($cfgin, filesize('include/config.inc.php')); - $dbtype = 'mysql'; - $config_new = ''; - $step7 = fputs($cfgout, $config_new); - $step7 = ($step7 + fputs($cfgout, $config_contents)); - if ($step7 > 0) { - $step7 = 1; - } - - fclose($cfgin); - fclose($cfgout); - chmod($pandora_config, 0600); - check_generic($step7, "Created new config file at '".$pandora_config."'"); - } - } - - if (($step7 + $step6 + $step5 + $step4 + $step3 + $step2 + $step1) == 7) { - $everything_ok = 1; - } - break; - - case 'mysqli': - $connection = mysqli_connect($dbhost, $dbuser, $dbpassword); - if (mysqli_connect_error() > 0) { - check_generic(0, 'Connection with Database'); - } else { - check_generic(1, 'Connection with Database'); - - // Drop database if needed and don't want to install over an existing DB - if ($dbdrop == 1) { - mysqli_query($connection, "DROP DATABASE IF EXISTS `$dbname`"); - } - - // Create schema - if ($dbaction == 'db_new' || $dbdrop == 1) { - $step1 = mysqli_query($connection, "CREATE DATABASE `$dbname`"); - check_generic($step1, "Creating database '$dbname'"); - } else { - $step1 = 1; - } - - if ($step1 == 1) { - $step2 = mysqli_select_db($connection, $dbname); - check_generic($step2, "Opening database '$dbname'"); - - $step3 = parse_mysqli_dump($connection, 'pandoradb.sql'); - check_generic($step3, 'Creating schema'); - - $step4 = parse_mysqli_dump($connection, 'pandoradb_data.sql'); - check_generic($step4, 'Populating database'); - if (PHP_OS == 'FreeBSD') { - $step_freebsd = adjust_paths_for_freebsd($engine, $connection); - check_generic($step_freebsd, 'Adjusting paths in database for FreeBSD'); - } - - $random_password = random_name(8); - $host = $dbhost; - // set default granted origin to the origin of the queries - if (($dbhost != 'localhost') && ($dbhost != '127.0.0.1')) { - $host = $dbgrant; - // if the granted origin is different from local machine, set the valid origin - } - - $step5 = mysqli_query( - $connection, - "GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host - IDENTIFIED BY '".$random_password."'" - ); - mysqli_query($connection, 'FLUSH PRIVILEGES'); - check_generic($step5, "Established privileges for user pandora. A new random password has been generated: $random_password
Please write it down, you will need to setup your Pandora FMS server, editing the /etc/pandora/pandora_server.conf file
"); - - $step6 = is_writable('include'); - check_generic($step6, "Write permissions to save config file in './include'"); - - $cfgin = fopen('include/config.inc.php', 'r'); - $cfgout = fopen($pandora_config, 'w'); - $config_contents = fread($cfgin, filesize('include/config.inc.php')); - $dbtype = 'mysql'; - $config_new = ''; - $step7 = fputs($cfgout, $config_new); - $step7 = ($step7 + fputs($cfgout, $config_contents)); - if ($step7 > 0) { - $step7 = 1; - } - - fclose($cfgin); - fclose($cfgout); - chmod($pandora_config, 0600); - check_generic($step7, "Created new config file at '".$pandora_config."'"); - } - } - - if (($step7 + $step6 + $step5 + $step4 + $step3 + $step2 + $step1) == 7) { - $everything_ok = 1; - } - break; - } - - echo '
'; - - if ($everything_ok == 1) { - echo "
"; - echo " - "; - echo '
'; - } else { - $info = "
There were some problems. - Installation was not completed. -

Please correct failures before trying again. - All database "; - if ($engine == 'oracle') { - $info .= 'objects '; - } else { - $info .= 'schemes '; - } - - $info .= 'created in this step have been dropped.

-
'; - echo $info; - - switch ($engine) { - case 'mysql': - if (mysql_error() != '') { - echo "
ERROR: ".mysql_error().'.
'; - } - - if ($step1 == 1) { - mysql_query("DROP DATABASE $dbname"); - } - break; - - case 'mysqli': - if (mysqli_error($connection) != '') { - echo "
ERROR: ".mysqli_error($connection).'.
'; - } - - if ($step1 == 1) { - mysqli_query($connection, "DROP DATABASE $dbname"); - } - break; - } - - echo '
'; - } - - echo '
'; - echo "
"; - echo " -
-
- Pandora FMS is an Open Source Software project registered at - SourceForge -
-
"; -} - - -function install_step5() -{ - echo " -
-
- ".print_logo_status(6, 6)." -
-

Installation complete

-

For security, you now must manually delete this installer - ('install.php') file before trying to access to your Pandora FMS console. -

You should also install Pandora FMS Servers before trying to monitor anything; - please read documentation on how to install it.

-

Default user is 'admin' with password 'pandora', - please change it both as soon as possible.

-

Don't forget to check http://pandorafms.com - for updates. -

Select if you want to rename 'install.php'.

-
- - -
-


. -

-
"; - - echo "
-
- Pandora FMS is an OpenSource Software project registered at - SourceForge -
-
"; -} From dab12ecdc5bb0f9a01786955d71b65ca479bddec Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 9 May 2019 15:06:03 +0200 Subject: [PATCH 51/63] Fixed error window in visual console Former-commit-id: 97def5509195b687a1607810043076e58dd72fe0 --- .../visual_console_builder.editor.js | 20 ++++++++++++++----- .../include/functions_visual_map_editor.php | 4 ++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 03841a342e..bc00f703c8 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -674,12 +674,17 @@ function update_button_palette_callback() { return false; } } - if (values["module"] == 0) { + var radio_value = $("input[name='radio_choice']:checked").val(); + if (values["agent"] == "" && radio_value == "module_graph") { + dialog_message("#message_alert_no_agent"); + return false; + } + if (values["module"] == 0 && radio_value == "module_graph") { dialog_message("#message_alert_no_module"); return false; } - if (values["agent"] == "") { - dialog_message("#message_alert_no_agent"); + if (values["id_custom_graph"] == 0 && radio_value == "custom_graph") { + dialog_message("#message_alert_no_custom_graph"); return false; } if ($("input[name=width_module_graph]").val() == "") { @@ -1425,11 +1430,12 @@ function create_button_palette_callback() { break; case "module_graph": - if (values["module"] == 0) { + var radio_value = $("input[name='radio_choice']:checked").val(); + if (values["module"] == 0 && radio_value == "module_graph") { dialog_message("#message_alert_no_module"); validate = false; } - if (values["id_custom_graph"] == 0) { + if (values["id_custom_graph"] == 0 && radio_value == "module_graph") { if (values["agent"] == "") { dialog_message("#message_alert_no_agent"); validate = false; @@ -1439,6 +1445,10 @@ function create_button_palette_callback() { validate = false; } } + if (values["id_custom_graph"] == 0 && radio_value == "custom_graph") { + dialog_message("#message_alert_no_custom_graph"); + validate = false; + } if ( values["height_module_graph"] == "" || values["height_module_graph"] == 0 diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 5cf5121e55..20aa6f3095 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -1386,6 +1386,10 @@ function visual_map_editor_print_hack_translate_strings() echo "

".__('Could not be save.').'

'; echo ''; + echo "'; + } From 9b51928e350b7e48dcc589895d659cc94140d517 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 9 May 2019 16:01:51 +0200 Subject: [PATCH 52/63] Added HTML edit feature, needed because TinyEdit adds lot's of HTML and is not practical. You need to edit the contents in HTML. Is not a security issue, because only admin can edit this news contents. Former-commit-id: 4039346ffe4fc2628f515b4cdaeaf1655377e74b --- pandora_console/godmode/setup/news.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/setup/news.php b/pandora_console/godmode/setup/news.php index 4e51181b8a..61491496f5 100644 --- a/pandora_console/godmode/setup/news.php +++ b/pandora_console/godmode/setup/news.php @@ -331,7 +331,7 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/'); theme : "advanced", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", - theme_advanced_buttons1 : "bold,italic, |, image, link, |, cut, copy, paste, |, undo, redo, |, forecolor, |, fontsizeselect, |, justifyleft, justifycenter, justifyright", + theme_advanced_buttons1 : "bold,italic, |, image, link, |, cut, copy, paste, |, undo, redo, |, forecolor, |, fontsizeselect, |, justifyleft, justifycenter, justifyright, | ,code", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", convert_urls : false, From 5126c651f7ce8ac32baf5e5d4ac658dbee87878c Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Thu, 9 May 2019 17:38:40 +0200 Subject: [PATCH 53/63] Changed '' of query --- pandora_console/extras/mr/28.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/28.sql b/pandora_console/extras/mr/28.sql index 5d61a98318..e4dfe8fe9b 100644 --- a/pandora_console/extras/mr/28.sql +++ b/pandora_console/extras/mr/28.sql @@ -1,5 +1,5 @@ START TRANSACTION; -DELETE FROM 'tevent_response' WHERE 'name' LIKE 'Create Integria IMS incident from event'; +DELETE FROM `tevent_response` WHERE `name` LIKE 'Create Integria IMS incident from event'; COMMIT; From 72eb2babadf0a4c4f85509fbcddd44e5e6ddbaa4 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Thu, 9 May 2019 17:44:54 +0200 Subject: [PATCH 54/63] se quita install.php Former-commit-id: 34ab35a67b924c6d0aab9f756a0c73bffd36c8cd --- pandora_console/install.php | 1105 +++++++++++++++++++++++++++++++++++ 1 file changed, 1105 insertions(+) create mode 100644 pandora_console/install.php diff --git a/pandora_console/install.php b/pandora_console/install.php new file mode 100644 index 0000000000..614151bc47 --- /dev/null +++ b/pandora_console/install.php @@ -0,0 +1,1105 @@ + + + + + Pandora FMS - Installation Wizard + + + + + + + + + + + + + + + +
+ +
+ + + +'; + echo " $label "; + echo ''; + if (!extension_loaded($ext)) { + echo ""; + return 1; + } else { + echo ""; + return 0; + } + + echo ''; +} + +function check_include($ext, $label) +{ + echo ''; + echo " $label "; + echo ''; + if (!include $ext) { + echo ""; + return 1; + } else { + echo ""; + return 0; + } + + echo ''; +} + + +function check_exists($file, $label) +{ + echo ''; + echo " $label "; + echo ''; + if (!file_exists($file)) { + echo " "; + return 1; + } else { + echo " "; + return 0; + } + + echo ''; +} + + +function check_generic($ok, $label) +{ + echo ""; + if ($ok == 0) { + echo " "; + echo ''; + echo " $label "; + echo ''; + echo ''; + return 1; + } else { + echo " "; + echo ''; + echo " $label "; + echo ''; + echo ''; + return 0; + } +} + + +function check_writable($fullpath, $label) +{ + echo ""; + if (file_exists($fullpath)) { + if (is_writable($fullpath)) { + echo " "; + echo ''; + echo " $label "; + echo ''; + echo ''; + return 0; + } else { + echo " "; + echo ''; + echo " $label "; + echo ''; + echo ''; + return 1; + } + } else { + echo " "; + echo ''; + echo " $label "; + echo ''; + echo ''; + return 1; + } +} + + +function check_variable($var, $value, $label, $mode) +{ + echo ''; + echo " $label "; + echo ''; + if ($mode == 1) { + if ($var >= $value) { + echo " "; + return 0; + } else { + echo " "; + return 1; + } + } else if ($var == $value) { + echo " "; + return 0; + } else { + echo " "; + return 1; + } + + echo ''; +} + + +function parse_mysql_dump($url) +{ + if (file_exists($url)) { + $file_content = file($url); + $query = ''; + foreach ($file_content as $sql_line) { + if (trim($sql_line) != '' && strpos($sql_line, '-- ') === false) { + $query .= $sql_line; + if (preg_match("/;[\040]*\$/", $sql_line)) { + if (!$result = mysql_query($query)) { + echo mysql_error(); + // Uncomment for debug + echo "
$query
"; + return 0; + } + + $query = ''; + } + } + } + + return 1; + } else { + return 0; + } +} + + +function parse_mysqli_dump($connection, $url) +{ + if (file_exists($url)) { + $file_content = file($url); + $query = ''; + foreach ($file_content as $sql_line) { + if (trim($sql_line) != '' && strpos($sql_line, '-- ') === false) { + $query .= $sql_line; + if (preg_match("/;[\040]*\$/", $sql_line)) { + if (!$result = mysqli_query($connection, $query)) { + echo mysqli_error(); + // Uncomment for debug + echo "
$query
"; + return 0; + } + + $query = ''; + } + } + } + + return 1; + } else { + return 0; + } +} + + +function random_name($size) +{ + $temp = ''; + for ($a = 0; $a < $size; $a++) { + $temp = $temp.chr(rand(122, 97)); + } + + return $temp; +} + + +function print_logo_status($step, $step_total) +{ + global $banner; + + $header = " +
+
+
+ $banner +
+
"; + $header .= " +
+ Install step $step of $step_total +
"; + + return $header; +} + + +// +// This function adjusts path settings in pandora db for FreeBSD. +// +// All packages and configuration files except operating system's base files +// are installed under /usr/local in FreeBSD. So, path settings in pandora db +// for some programs should be changed from the Linux default. +// +function adjust_paths_for_freebsd($engine, $connection=false) +{ + $adjust_sql = [ + "update trecon_script set script = REPLACE(script,'/usr/share','/usr/local/share');", + "update tconfig set value = REPLACE(value,'/usr/bin','/usr/local/bin') where token='netflow_daemon' OR token='netflow_nfdump' OR token='netflow_nfexpire';", + "update talert_commands set command = REPLACE(command,'/usr/bin','/usr/local/bin');", + "update talert_commands set command = REPLACE(command,'/usr/share', '/usr/local/share');", + "update tplugin set execute = REPLACE(execute,'/usr/share','/usr/local/share');", + "update tevent_response set target = REPLACE(target,'/usr/share','/usr/local/share');", + "insert into tconfig (token, value) VALUES ('graphviz_bin_dir', '/usr/local/bin');", + ]; + + for ($i = 0; $i < count($adjust_sql); $i++) { + switch ($engine) { + case 'mysql': + $result = mysql_query($adjust_sql[$i]); + break; + + case 'mysqli': + $result = mysqli_query($connection, $adjust_sql[$i]); + break; + + case 'oracle': + // Delete the last semicolon from current query + $query = substr($adjust_sql[$i], 0, (strlen($adjust_sql[$i]) - 1)); + $sql = oci_parse($connection, $query); + $result = oci_execute($sql); + break; + + case 'pgsql': + pg_send_query($connection, $adjust_sql[$i]); + $result = pg_get_result($connection); + break; + } + + if (!$result) { + return 0; + } + } + + return 1; +} + + +function install_step1() +{ + global $banner; + + echo " +
+
+ ".print_logo_status(1, 6)." +
+

Welcome to Pandora FMS installation Wizard

+

This wizard helps you to quick install Pandora FMS console and main database in your system.

+

In four steps, this installer will check all dependencies and will create your configuration, ready to use.

+

For more information, please refer to documentation.
+ Pandora FMS Development Team

+ "; + if (file_exists('include/config.php')) { + echo "
Warning: You already have a config.php file. + Configuration and database would be overwritten if you continued.
"; + } + + echo '
'; + echo ''; + $writable = check_writable('include', 'Checking if ./include is writable'); + if (file_exists('include/config.php')) { + $writable += check_writable('include/config.php', 'Checking if include/config.php is writable'); + } + + echo '
'; + + echo "
Warning: This installer will overwrite and destroy + your existing Pandora FMS configuration and Database. Before continue, + please be sure that you have no valuable Pandora FMS data in your Database.
+
"; + + echo "
Upgrade: + If you want to upgrade from Pandora FMS 4.x to 5.0 version, please use the migration tool inside /extras directory in this setup. +
"; + + echo '
'; + + if ($writable == 0) { + echo "
"; + echo ""; + echo '
'; + } else { + echo "
ERROR:You need to setup permissions to be able to write in ./include directory
"; + } + + echo '
'; + + echo "
"; + echo " +
+
+ Pandora FMS is an OpenSource Software project registered at + SourceForge +
+
"; +} + + +function install_step1_licence() +{ + echo " +
+
+ ".print_logo_status(2, 6)." +
+

GPL2 Licence terms agreement

+

Pandora FMS is an OpenSource software project licensed under the GPL2 licence. Pandora FMS includes, as well, another software also licensed under LGPL and BSD licenses. Before continue, you must accept the licence terms.. +

For more information, please refer to our website at http://pandorafms.org and contact us if you have any kind of question about the usage of Pandora FMS

+

If you dont accept the licence terms, please, close your browser and delete Pandora FMS files.

+ "; + + if (!file_exists('COPYING')) { + echo "
Licence file 'COPYING' is not present in your distribution. This means you have some 'partial' Pandora FMS distribution. We cannot continue without accepting the licence file."; + echo '
'; + } else { + echo "
"; + echo "'; + echo '

'; + echo "

"; + } + + echo '
'; + + echo "
+
+
+ Pandora FMS is an OpenSource Software project registered at + SourceForge +
+
"; +} + + +function install_step2() +{ + echo " +
+
+ ".print_logo_status(3, 6)." +
"; + echo '

Checking software dependencies

'; + echo ''; + $res = 0; + $res += check_variable(phpversion(), '7.0', 'PHP version >= 7.0', 1); + $res += check_extension('gd', 'PHP GD extension'); + $res += check_extension('ldap', 'PHP LDAP extension'); + $res += check_extension('snmp', 'PHP SNMP extension'); + $res += check_extension('session', 'PHP session extension'); + $res += check_extension('gettext', 'PHP gettext extension'); + $res += check_extension('mbstring', 'PHP Multibyte String'); + $res += check_extension('zip', 'PHP Zip'); + $res += check_extension('zlib', 'PHP Zlib extension'); + $res += check_extension('json', 'PHP json extension'); + $res += check_extension('curl', 'CURL (Client URL Library)'); + $res += check_extension('filter', 'PHP filter extension'); + $res += check_extension('calendar', 'PHP calendar extension'); + if (PHP_OS == 'FreeBSD') { + $res += check_exists('/usr/local/bin/twopi', 'Graphviz Binary'); + } else if (PHP_OS == 'NetBSD') { + $res += check_exists('/usr/pkg/bin/twopi', 'Graphviz Binary'); + } else if (substr(PHP_OS, 0, 3) == 'WIN') { + $res += check_exists("..\\..\\..\\Graphviz\\bin\\twopi.exe", 'Graphviz Binary'); + } else { + $res += check_exists('/usr/bin/twopi', 'Graphviz Binary'); + } + + echo ''; + check_extension('mysqli', 'PHP MySQL(mysqli) extension'); + echo '
'; + echo "DB Engines"; + echo ''; + echo '
'; + + if ($res > 0) { + echo " +
You have some incomplete + dependencies. Please correct them or this installer + will not be able to finish your installation. +
+
+ Remember, if you install any PHP module to comply + with these dependences, you need to restart + your HTTP/Apache server after it to use the new + modules. +
+
+ Ignore it. +
"; + } else { + echo "
"; + echo " + "; + echo '
'; + } + + echo '
'; + echo "
"; + echo " +
+
+
+
+ Pandora FMS is an OpenSource Software project registered at + SourceForge +
+ "; +} + + +function install_step3() +{ + $options = ''; + if (extension_loaded('mysql')) { + $options .= ""; + } + + if (extension_loaded('mysqli')) { + $options .= ""; + } + + $error = false; + if (empty($options)) { + $error = true; + } + + echo " +
+
+ ".print_logo_status(4, 6)." +
+

Environment and database setup

+

+ This wizard will create your Pandora FMS database, + and populate it with all the data needed to run for the first time. +

+

+ You need a privileged user to create database schema, this is usually root user. + Information about root user will not be used or stored anymore. +

+

+ You can also deploy the scheme into an existing Database. + In this case you need a privileged Database user and password of that instance. +

+

+ Now, please, complete all details to configure your database and environment setup. +

+
+ Warning: This installer will overwrite and destroy your existing + Pandora FMS configuration and Database. Before continue, + please be sure that you have no valuable Pandora FMS data in your Database. +

+
"; + + if (extension_loaded('oci8')) { + echo "
For Oracle installation an existing Database with a privileged user is needed.
"; + } + + if (!$error) { + echo ""; + } + + echo ""; + echo '"; + + // the field dbgrant is only shown when the DB host is different from 127.0.0.1 or localhost + echo " + + "; + + echo " "; + + echo ""; + echo '
'; + echo 'DB Engine
'; + + if ($error) { + echo " +
+ Warning: You haven't a any DB engine with PHP. Please check the previous step to DB engine dependencies. +
"; + } else { + echo "'; + + echo '
'; + echo ' Installation in
'; + echo "'; + } + + echo "
DB User with privileges
+ + +
DB Password for this user
+ + +
DB Hostname
+ + +
DB Name (pandora by default)
+ + +
Drop Database if exists
+ +
Full path to HTTP publication directory
+ For example /var/www/pandora_console/ +
+ + +
'; + echo "URL path to Pandora FMS Console
+ For example '/pandora_console' +
+ +
+ "; + + if (!$error) { + echo "
"; + echo " + "; + echo '
'; + ?> + + '; + + echo ''; + + echo "
"; + echo "
+
+ Pandora FMS is an OpenSource Software project registered at + SourceForge +
+
"; +} + + +function install_step4() +{ + $pandora_config = 'include/config.php'; + + if ((! isset($_POST['user'])) || (! isset($_POST['dbname'])) || (! isset($_POST['host'])) + || (! isset($_POST['pass'])) || (!isset($_POST['engine'])) || (! isset($_POST['db_action'])) + ) { + $dbpassword = ''; + $dbuser = ''; + $dbhost = ''; + $dbname = ''; + $engine = ''; + $dbaction = ''; + $dbgrant = ''; + } else { + $engine = $_POST['engine']; + $dbpassword = $_POST['pass']; + $dbuser = $_POST['user']; + $dbhost = $_POST['host']; + $dbaction = $_POST['db_action']; + if (isset($_POST['dbgrant']) && $_POST['dbgrant'] != '') { + $dbgrant = $_POST['dbgrant']; + } else { + $dbgrant = $_SERVER['SERVER_ADDR']; + } + + if (isset($_POST['drop'])) { + $dbdrop = $_POST['drop']; + } else { + $dbdrop = 0; + } + + $dbname = $_POST['dbname']; + if (isset($_POST['url'])) { + $url = $_POST['url']; + } else { + $url = 'http://localhost'; + } + + if (isset($_POST['path'])) { + $path = $_POST['path']; + $path = str_replace('\\', '/', $path); + // Windows compatibility + } else { + $path = '/var/www'; + } + } + + $everything_ok = 0; + $step1 = 0; + $step2 = 0; + $step3 = 0; + $step4 = 0; + $step5 = 0; + $step6 = 0; + $step7 = 0; + + echo " +
+
+ ".print_logo_status(5, 6)." +
+

Creating database and default configuration file

+ "; + switch ($engine) { + case 'mysql': + if (! mysql_connect($dbhost, $dbuser, $dbpassword)) { + check_generic(0, 'Connection with Database'); + } else { + check_generic(1, 'Connection with Database'); + + // Drop database if needed and don't want to install over an existing DB + if ($dbdrop == 1) { + mysql_query("DROP DATABASE IF EXISTS `$dbname`"); + } + + // Create schema + if ($dbaction == 'db_new' || $dbdrop == 1) { + $step1 = mysql_query("CREATE DATABASE `$dbname`"); + check_generic($step1, "Creating database '$dbname'"); + } else { + $step1 = 1; + } + + if ($step1 == 1) { + $step2 = mysql_select_db($dbname); + check_generic($step2, "Opening database '$dbname'"); + + $step3 = parse_mysql_dump('pandoradb.sql'); + check_generic($step3, 'Creating schema'); + + $step4 = parse_mysql_dump('pandoradb_data.sql'); + check_generic($step4, 'Populating database'); + if (PHP_OS == 'FreeBSD') { + $step_freebsd = adjust_paths_for_freebsd($engine); + check_generic($step_freebsd, 'Adjusting paths in database for FreeBSD'); + } + + $random_password = random_name(8); + $host = $dbhost; + // set default granted origin to the origin of the queries + if (($dbhost != 'localhost') && ($dbhost != '127.0.0.1')) { + $host = $dbgrant; + // if the granted origin is different from local machine, set the valid origin + } + + $step5 = mysql_query( + "GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host + IDENTIFIED BY '".$random_password."'" + ); + mysql_query('FLUSH PRIVILEGES'); + check_generic($step5, "Established privileges for user pandora. A new random password has been generated: $random_password
Please write it down, you will need to setup your Pandora FMS server, editing the /etc/pandora/pandora_server.conf file
"); + + $step6 = is_writable('include'); + check_generic($step6, "Write permissions to save config file in './include'"); + + $cfgin = fopen('include/config.inc.php', 'r'); + $cfgout = fopen($pandora_config, 'w'); + $config_contents = fread($cfgin, filesize('include/config.inc.php')); + $dbtype = 'mysql'; + $config_new = ''; + $step7 = fputs($cfgout, $config_new); + $step7 = ($step7 + fputs($cfgout, $config_contents)); + if ($step7 > 0) { + $step7 = 1; + } + + fclose($cfgin); + fclose($cfgout); + chmod($pandora_config, 0600); + check_generic($step7, "Created new config file at '".$pandora_config."'"); + } + } + + if (($step7 + $step6 + $step5 + $step4 + $step3 + $step2 + $step1) == 7) { + $everything_ok = 1; + } + break; + + case 'mysqli': + $connection = mysqli_connect($dbhost, $dbuser, $dbpassword); + if (mysqli_connect_error() > 0) { + check_generic(0, 'Connection with Database'); + } else { + check_generic(1, 'Connection with Database'); + + // Drop database if needed and don't want to install over an existing DB + if ($dbdrop == 1) { + mysqli_query($connection, "DROP DATABASE IF EXISTS `$dbname`"); + } + + // Create schema + if ($dbaction == 'db_new' || $dbdrop == 1) { + $step1 = mysqli_query($connection, "CREATE DATABASE `$dbname`"); + check_generic($step1, "Creating database '$dbname'"); + } else { + $step1 = 1; + } + + if ($step1 == 1) { + $step2 = mysqli_select_db($connection, $dbname); + check_generic($step2, "Opening database '$dbname'"); + + $step3 = parse_mysqli_dump($connection, 'pandoradb.sql'); + check_generic($step3, 'Creating schema'); + + $step4 = parse_mysqli_dump($connection, 'pandoradb_data.sql'); + check_generic($step4, 'Populating database'); + if (PHP_OS == 'FreeBSD') { + $step_freebsd = adjust_paths_for_freebsd($engine, $connection); + check_generic($step_freebsd, 'Adjusting paths in database for FreeBSD'); + } + + $random_password = random_name(8); + $host = $dbhost; + // set default granted origin to the origin of the queries + if (($dbhost != 'localhost') && ($dbhost != '127.0.0.1')) { + $host = $dbgrant; + // if the granted origin is different from local machine, set the valid origin + } + + $step5 = mysqli_query( + $connection, + "GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host + IDENTIFIED BY '".$random_password."'" + ); + mysqli_query($connection, 'FLUSH PRIVILEGES'); + check_generic($step5, "Established privileges for user pandora. A new random password has been generated: $random_password
Please write it down, you will need to setup your Pandora FMS server, editing the /etc/pandora/pandora_server.conf file
"); + + $step6 = is_writable('include'); + check_generic($step6, "Write permissions to save config file in './include'"); + + $cfgin = fopen('include/config.inc.php', 'r'); + $cfgout = fopen($pandora_config, 'w'); + $config_contents = fread($cfgin, filesize('include/config.inc.php')); + $dbtype = 'mysql'; + $config_new = ''; + $step7 = fputs($cfgout, $config_new); + $step7 = ($step7 + fputs($cfgout, $config_contents)); + if ($step7 > 0) { + $step7 = 1; + } + + fclose($cfgin); + fclose($cfgout); + chmod($pandora_config, 0600); + check_generic($step7, "Created new config file at '".$pandora_config."'"); + } + } + + if (($step7 + $step6 + $step5 + $step4 + $step3 + $step2 + $step1) == 7) { + $everything_ok = 1; + } + break; + } + + echo '
'; + + if ($everything_ok == 1) { + echo "
"; + echo " + "; + echo '
'; + } else { + $info = "
There were some problems. + Installation was not completed. +

Please correct failures before trying again. + All database "; + if ($engine == 'oracle') { + $info .= 'objects '; + } else { + $info .= 'schemes '; + } + + $info .= 'created in this step have been dropped.

+
'; + echo $info; + + switch ($engine) { + case 'mysql': + if (mysql_error() != '') { + echo "
ERROR: ".mysql_error().'.
'; + } + + if ($step1 == 1) { + mysql_query("DROP DATABASE $dbname"); + } + break; + + case 'mysqli': + if (mysqli_error($connection) != '') { + echo "
ERROR: ".mysqli_error($connection).'.
'; + } + + if ($step1 == 1) { + mysqli_query($connection, "DROP DATABASE $dbname"); + } + break; + } + + echo '
'; + } + + echo '
'; + echo "
"; + echo " +
+
+ Pandora FMS is an Open Source Software project registered at + SourceForge +
+
"; +} + + +function install_step5() +{ + echo " +
+
+ ".print_logo_status(6, 6)." +
+

Installation complete

+

For security, you now must manually delete this installer + ('install.php') file before trying to access to your Pandora FMS console. +

You should also install Pandora FMS Servers before trying to monitor anything; + please read documentation on how to install it.

+

Default user is 'admin' with password 'pandora', + please change it both as soon as possible.

+

Don't forget to check http://pandorafms.com + for updates. +

Select if you want to rename 'install.php'.

+
+ + +
+


. +

+
"; + + echo "
+
+ Pandora FMS is an OpenSource Software project registered at + SourceForge +
+
"; +} From 3119278b2662c4bfc293261309bade41807d84d5 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 10 May 2019 00:01:14 +0200 Subject: [PATCH 55/63] Auto-updated build strings. Former-commit-id: 1dc55561e83817f91b38b437d57e479fb13f3ac3 --- 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 cebf58c0cc..e5ce7197b1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.734-190509 +Version: 7.0NG.734-190510 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 05ee21ba04..d6937b6849 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.734-190509" +pandora_version="7.0NG.734-190510" 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 fb8671b220..cbb9a72d25 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.734'; -use constant AGENT_BUILD => '190509'; +use constant AGENT_BUILD => '190510'; # 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 8b89542a17..a473681428 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.734 -%define release 190509 +%define release 190510 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 4c5fed356c..8f4c593eab 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.734 -%define release 190509 +%define release 190510 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 e18f072efc..92c4545bab 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.734" -PI_BUILD="190509" +PI_BUILD="190510" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 20da7b7ae4..a964fdec1e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190509} +{190510} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 7a34c41bbe..ff4e0beb79 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.734(Build 190509)") +#define PANDORA_VERSION ("7.0NG.734(Build 190510)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d792109417..88eb352bc8 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.734(Build 190509))" + VALUE "ProductVersion", "(7.0NG.734(Build 190510))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 11235f2a12..6b3a3f7da5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.734-190509 +Version: 7.0NG.734-190510 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 7f82def4f9..04b9f9bf47 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.734-190509" +pandora_version="7.0NG.734-190510" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 20e2fb9004..a7ab314bb4 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 = 'PC190509'; +$build_version = 'PC190510'; $pandora_version = 'v7.0NG.734'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 614151bc47..80deb2e787 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 73d08f06a5..36e47fffbf 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.734 -%define release 190509 +%define release 190510 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 231349ee24..e9dbbf97bb 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.734 -%define release 190509 +%define release 190510 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 1896c72705..078df43672 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.734" -PI_BUILD="190509" +PI_BUILD="190510" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 881f73940b..00fcc25297 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.734 PS190509"; +my $version = "7.0NG.734 PS190510"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index babf1f7eff..1977eb37b9 100644 --- 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.734 PS190509"; +my $version = "7.0NG.734 PS190510"; # save program name for logging my $progname = basename($0); From 793304b52d6c0d1a2a7127830210294bbe7ce55d Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Fri, 10 May 2019 12:26:09 +0200 Subject: [PATCH 56/63] Se habilita el boton de ehorus Former-commit-id: aceee670b00ad4291b7f4e9e0a90f17dca3feed9 --- pandora_console/godmode/setup/setup_ehorus.php | 4 ++-- pandora_console/include/functions_config.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/setup/setup_ehorus.php b/pandora_console/godmode/setup/setup_ehorus.php index 02d7b23ba4..c5a6616894 100644 --- a/pandora_console/godmode/setup/setup_ehorus.php +++ b/pandora_console/godmode/setup/setup_ehorus.php @@ -176,11 +176,11 @@ if ($config['ehorus_enabled']) { var is_checked = $('input:checkbox[name="ehorus_enabled"]').is(':checked'); if (event.target.value == '1' && is_checked) { showFields(); - $('input:checkbox[name="ehorus_enabled"]').attr('checked', false); + $('input:checkbox[name="ehorus_enabled"]').attr('checked', true); } else { hideFields(); - $('input:checkbox[name="ehorus_enabled"]').attr('checked', true); + $('input:checkbox[name="ehorus_enabled"]').attr('checked', false); }; } $('input:checkbox[name="ehorus_enabled"]').change(handleEnable); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index dc0e845afb..97d9e215d4 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1349,7 +1349,7 @@ function config_update_config() break; case 'ehorus': - if (!config_update_value('ehorus_enabled', (int) get_parameter('ehorus_enabled', 0))) { + if (!config_update_value('ehorus_enabled', (int) get_parameter('ehorus_enabled', 1))) { $error_update[] = __('Enable eHorus'); } From b51cdb93df44340711ff917460be311948b67390 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Fri, 10 May 2019 15:00:21 +0200 Subject: [PATCH 57/63] arreglo con la vista del formulario Former-commit-id: 0d5b5c099ce2e096d8e3d8e1c0a6220baa27e0a9 --- .../godmode/setup/setup_ehorus.php | 21 ++++++++++--------- pandora_console/include/functions_config.php | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pandora_console/godmode/setup/setup_ehorus.php b/pandora_console/godmode/setup/setup_ehorus.php index c5a6616894..d3463bde33 100644 --- a/pandora_console/godmode/setup/setup_ehorus.php +++ b/pandora_console/godmode/setup/setup_ehorus.php @@ -140,15 +140,15 @@ if ($config['ehorus_enabled'] && !$custom_field_exists) { ui_print_error_message($error_message); } +echo "
"; // Form enable. -echo ''; +echo '
'; html_print_input_hidden('update_config', 1); html_print_table($table_enable); -echo ''; +echo '
'; // Form remote. -if ($config['ehorus_enabled']) { - echo '
'; + echo '
'; echo '
'; echo ''.__('eHorus API').''; html_print_input_hidden('update_config', 1); @@ -157,20 +157,21 @@ if ($config['ehorus_enabled']) { html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"'); echo '
'; echo ''; + echo '
'; echo ''; -} ?>