From 5807e554593d8207137d182489d55d886c62a976 Mon Sep 17 00:00:00 2001 From: Hirofumi Kosaka Date: Fri, 19 May 2017 16:49:54 +0900 Subject: [PATCH 01/81] Modified SNMP Console to prefer agent aliases as SNMP agent if registered. #149 --- pandora_console/operation/snmpconsole/snmp_view.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index 26fb5d102c..202933d082 100755 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -162,7 +162,7 @@ $severities = get_priorities (); $alerted = array (__('Not fired'), __('Fired')); foreach ($all_traps as $trap) { $agent = agents_get_agent_with_ip ($trap['source']); - $agents[$trap["source"]] = $agent !== false ? $agent["nombre"] : $trap["source"]; + $agents[$trap["source"]] = $agent !== false ? ($agent["alias"] ? $agent["alias"] : $agent["nombre"]) : $trap["source"]; $oid = enterprise_hook ('get_oid', array ($trap)); if ($oid === ENTERPRISE_NOT_HOOK) { $oid = $trap["oid"]; @@ -678,7 +678,7 @@ if ($traps !== false) { continue; } $data[1] = ''; - $data[1] .= ''.$agent["nombre"].ui_print_help_tip($trap['source'], true, "images/tip-blanco.png");''; + $data[1] .= ''.($agent["alias"] ? $agent["alias"] : $agent["nombre"]).ui_print_help_tip($trap['source'], true, "images/tip-blanco.png");''; } //OID @@ -1014,4 +1014,4 @@ echo '
 
'; } } - \ No newline at end of file + From d209bd2f4537bd2cbb89c2854a72d945e31c9259 Mon Sep 17 00:00:00 2001 From: Hirofumi Kosaka Date: Mon, 22 May 2017 15:50:49 +0900 Subject: [PATCH 02/81] Bug Fix: SNMP Alert could not refer agents. #150 --- pandora_server/lib/PandoraFMS/Core.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 543ae4e264..855610d82f 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -976,7 +976,9 @@ sub pandora_execute_action ($$$$$$$$$;$) { _field13_ => $field13, _field14_ => $field14, _field15_ => $field15, - _agent_ => (defined ($agent)) ? $agent->{'alias'} : '', + _agentname_ => (defined ($agent)) ? $agent->{'nombre'} : '', + _agentalias_ => (defined ($agent)) ? $agent->{'alias'} : '', + _agent_ => (defined ($agent)) ? ($agent->{'alias'} ? $agent->{'alias'} : $agent->{'nombre'}) : '', _agentcustomid_ => (defined ($agent)) ? $agent->{'custom_id'} : '', '_agentcustomfield_\d+_' => undef, _agentdescription_ => (defined ($agent)) ? $agent->{'comentarios'} : '', @@ -1213,6 +1215,9 @@ sub pandora_execute_action ($$$$$$$$$;$) { } $agent_name = subst_alert_macros ($agent_name, \%macros, $pa_config, $dbh, $agent, $module); my $fullagent = get_agent_from_name ($dbh, $agent_name); + if( ! $fullagent && $macros{'_agentname_'} ) { + $fullagent = get_agent_from_name ($dbh, $macros{'_agentname_'} ); + } # Field 5 (priority) my $priority = $field5; @@ -3423,6 +3428,7 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) { if (defined($this_agent)){ %agent = ( 'nombre' => $this_agent->{'nombre'}, + 'alias' => $this_agent->{'alias'}, 'id_agente' => $this_agent->{'id_agente'}, 'direccion' => $trap_agent, 'id_grupo' => $this_agent->{'id_grupo'}, From 85b98a10fa7c4fabcce20d3ddcba11d459fad6ed Mon Sep 17 00:00:00 2001 From: enriquecd Date: Fri, 2 Jun 2017 12:51:22 +0200 Subject: [PATCH 03/81] Change jquery ajax call method in welcome window dont show get to post - #963 --- pandora_console/general/login_help_dialog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/general/login_help_dialog.php b/pandora_console/general/login_help_dialog.php index 9e097a6fbc..631d9d5ce1 100644 --- a/pandora_console/general/login_help_dialog.php +++ b/pandora_console/general/login_help_dialog.php @@ -119,7 +119,7 @@ $(document).ready (function () { // Update config['skip_login_help_dialog'] to don't display more this message if (skip_login_help) { - jQuery.get ("ajax.php", + jQuery.post ("ajax.php", {"page": "general/login_help_dialog", "skip_login_help": 1}, function (data) {} From 38464bf615d98f4e55355a9ec6498b78c96392fc Mon Sep 17 00:00:00 2001 From: enriquecd Date: Mon, 5 Jun 2017 18:36:12 +0200 Subject: [PATCH 04/81] Change ajax call method get to post for autorefresh and use new timecount param - #868 --- pandora_console/operation/visual_console/render_view.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index 79101d82ee..cb1102fbd4 100755 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -245,11 +245,12 @@ $ignored_params['refr'] = ''; //cb(); url = js_html_entity_decode( href ) + duration; //$(document).attr ("location", url); - $.get(window.location.href.replace("render_view","pure_ajax"), function(respuestaSolicitud){ + $.post(window.location.href.replace("refr=300","refr="+new_count), function(respuestaSolicitud){ $('#background_').html(respuestaSolicitud); - startCountDown(refr, false); }); - } + $("#main_pure").css('background-color',''); + + } }); } @@ -260,6 +261,7 @@ $ignored_params['refr'] = ''; $('select#refr').change(function (event) { refr = Number.parseInt(event.target.value, 10); + new_count = event.target.value; startCountDown(refr, false); }); } From f0492c370ce50261787a5c8f3fb145d30c19bb2a Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Tue, 6 Jun 2017 15:48:58 +0200 Subject: [PATCH 05/81] Changed format --- pandora_console/include/ajax/module.php | 28 +++++++------------------ 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 6eb5b0e17a..3b77ca8f19 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -266,21 +266,16 @@ if ($get_module_detail) { foreach ($columns as $col => $attr) { if ($attr[1] != "modules_format_data") { $data[] = date('d F Y h:i:s A', $row['utimestamp']); - } elseif (($config['command_snapshot']) && (preg_match ("/[\n]+/i", $row[$attr[0]]))) { // Its a single-data, multiline data (data snapshot) ? - // Detect string data with \n and convert to
's $datos = $row[$attr[0]]; - //$datos = preg_replace ('/\n/i','
',$row[$attr[0]]); - //$datos = preg_replace ('/\s/i',' ',$datos); // Because this *SHIT* of print_table monster, I cannot format properly this cells // so, eat this, motherfucker :)) - - $datos = io_safe_input($datos); + $datos = preg_replace("/\n/", "

", $datos); // I dont why, but using index (value) method, data is automatically converted to html entities ¿? $data[] = $datos; @@ -288,7 +283,6 @@ if ($get_module_detail) { elseif ($is_web_content_string) { //Fixed the goliat sends the strings from web //without HTML entities - $data[] = io_safe_input($row[$attr[0]]); } else { @@ -299,9 +293,6 @@ if ($get_module_detail) { $data[] = io_safe_input($row[$attr[0]]); } else if (is_numeric($row[$attr[0]]) && !modules_is_string_type($row['module_type']) ) { - - //~ $data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision'])); - //~ $data[] = (double) $row[$attr[0]]; switch($row['module_type']) { case 15: $value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id); @@ -320,17 +311,12 @@ if ($get_module_detail) { $data[] = 'No data'; } else { - - if(is_snapshot_data($row[$attr[0]])){ - $data[] = ""; - } - else{ - $data[] = $row[$attr[0]]; - } - - - - + if(is_snapshot_data($row[$attr[0]])){ + $data[] = ""; + } + else{ + $data[] = $row[$attr[0]]; + } } } } From 5e099a0da3738cba140509b463fac80cecacae29 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 7 Jun 2017 11:43:11 +0200 Subject: [PATCH 06/81] added graph colors in dahsboard --- pandora_console/include/constants.php | 1 + .../include/functions_custom_graphs.php | 5 ++-- pandora_console/include/functions_graph.php | 23 +++++++++++++++---- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index cee055d867..aa287b344a 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -467,6 +467,7 @@ define("OPTION_SINGLE_SELECT_TIME", 7); define("OPTION_CUSTOM_INPUT", 8); define("OPTION_AGENT_AUTOCOMPLETE", 9); define("OPTION_SELECT_MULTISELECTION", 10); +define("OPTION_COLOR_PICKER", 11); /* Transactional map constants */ define("NODE_TYPE", 0); diff --git a/pandora_console/include/functions_custom_graphs.php b/pandora_console/include/functions_custom_graphs.php index 361975b29c..499a8a817f 100644 --- a/pandora_console/include/functions_custom_graphs.php +++ b/pandora_console/include/functions_custom_graphs.php @@ -164,7 +164,7 @@ function custom_graphs_print($id_graph, $height, $width, $period, $background_color = 'white', $modules_param = array(), $homeurl = '', $name_list = array(), $unit_list = array(), $show_last = true, $show_max = true, $show_min = true, $show_avg = true, $ttl = 1, - $dashboard = false, $vconsole = false, $percentil = null, $from_interface = false) { + $dashboard = false, $vconsole = false, $percentil = null, $from_interface = false,$id_widget_dashboard=false) { global $config; @@ -260,7 +260,8 @@ function custom_graphs_print($id_graph, $height, $width, $period, $dashboard, $vconsole, $percentil, - $from_interface); + $from_interface, + $id_widget_dashboard); if ($return) return $output; diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index c6721d1476..ba089a9457 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -791,7 +791,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $only_image = false, $homeurl = '', $ttl = 1, $projection = false, $adapt_key = '', $compare = false, $show_unknown = false, $menu = true, $backgroundColor = 'white', $percentil = null, - $dashboard = false, $vconsole = false, $type_graph = 'area') { + $dashboard = false, $vconsole = false, $type_graph = 'area',$id_widget_dashboard = false) { global $config; global $graphic_type; @@ -855,8 +855,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $date, $unit, $baseline, $return_data, $show_title, $projection, $adapt_key, $compare, '', '', $show_unknown, $percentil, $dashboard, $vconsole,$type_graph); - - + if ($return_data) { return $data_returned; } @@ -907,6 +906,13 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, } else { // Color commented not to restrict serie colors + if($id_widget_dashboard){ + $opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $id_widget_dashboard))); + $color['min']['color'] = $opcion['min']; + $color['sum']['color'] = $opcion['avg']; + $color['max']['color'] = $opcion['max']; + } + return area_graph($flash_chart, $chart, $width, $height, $color, $legend, $long_index, @@ -993,7 +999,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, $prediction_period = false, $background_color = 'white', $name_list = array(), $unit_list = array(), $show_last = true, $show_max = true, $show_min = true, $show_avg = true, $labels = array(), $dashboard = false, - $vconsole = false, $percentil = null, $from_interface = false) { + $vconsole = false, $percentil = null, $from_interface = false, $id_widget_dashboard=false) { global $config; global $graphic_type; @@ -1828,6 +1834,15 @@ function graphic_combined_module ($module_list, $weight_list, $period, $color[15] = array('border' => '#000000', 'color' => COL_GRAPH13, 'alpha' => CHART_DEFAULT_ALPHA); + + if($id_widget_dashboard){ + $opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $id_widget_dashboard))); + foreach ($module_list as $key => $value) { + if(!empty($opcion[$value])){ + $color[$key]['color'] = $opcion[$value]; + } + } + } $threshold_data = array(); From a27a9e8cb382fbe255a2bc5e6d198ab395dccd8e Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 8 Jun 2017 10:22:59 +0200 Subject: [PATCH 07/81] Fixed version in footer --- pandora_console/general/footer.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pandora_console/general/footer.php b/pandora_console/general/footer.php index 64564d300a..99cebe8f2d 100644 --- a/pandora_console/general/footer.php +++ b/pandora_console/general/footer.php @@ -32,13 +32,18 @@ if (!$config["MR"]) { echo ''; -if($current_package == 0){ -$build_package_version = $build_version; -} -else{ -$build_package_version = $current_package; +if(enterprise_installed()){ + enterprise_include_once("../include/functions_update_manager.php"); } +$current_package = update_manager_get_current_package(); + +if($current_package == 0){ + $build_package_version = $build_version; +} +else{ + $build_package_version = $current_package; +} echo sprintf(__('Pandora FMS %s - Build %s - MR %s', $pandora_version, $build_package_version, $config["MR"])); From 4bdc0df5c4749faf29ed565a73bf0dff8793998f Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 8 Jun 2017 17:55:04 +0200 Subject: [PATCH 08/81] Changed agent name by alias in alerts details --- pandora_console/godmode/alerts/alert_view.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_view.php b/pandora_console/godmode/alerts/alert_view.php index f420ea168c..6655f3009e 100644 --- a/pandora_console/godmode/alerts/alert_view.php +++ b/pandora_console/godmode/alerts/alert_view.php @@ -32,7 +32,7 @@ $id_alert = get_parameter ("id_alert", 0); // ID given as parameter $alert = alerts_get_alert_agent_module($id_alert); $template = alerts_get_alert_template ($alert['id_alert_template']); $actions = alerts_get_alert_agent_module_actions ($id_alert); -$agent_name = modules_get_agentmodule_agent_name ($alert['id_agent_module']); +$agent_alias = modules_get_agentmodule_agent_alias ($alert['id_agent_module']); $agent = modules_get_agentmodule_agent ($alert['id_agent_module']); $module_name = modules_get_agentmodule_name ($alert['id_agent_module']); @@ -65,7 +65,7 @@ $table_details->data[] = $data; $data[0] = __('Agent'); $data[1] =''.$agent_name.''; +'" title="'.$agent_alias.'">'.$agent_alias.''; $table_details->data[] = $data; $data[0] = __('Module'); From 4693702741f272f6cd74a8c0ca70c368741cf3c5 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 12 Jun 2017 13:43:53 +0200 Subject: [PATCH 09/81] Fixed sql error in tagente_datos_log4x --- pandora_console/include/functions_modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index d7926d2266..29b5a10676 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -1722,7 +1722,7 @@ function modules_get_agentmodule_data ($id_agent_module, $period, break; //log4x case 24: - $sql = sprintf ("SELECT datos AS data, utimestamp + $sql = sprintf ("SELECT message AS data, utimestamp FROM tagente_datos_log4x WHERE id_agente_modulo = %d AND utimestamp > %d AND utimestamp <= %d From 2ede05729856c567b05c09d5884859240478c5b7 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Tue, 13 Jun 2017 16:49:25 +0200 Subject: [PATCH 10/81] Add data image option to simple data visual console element - #412 --- .../general/check_image_module.php | 25 ++++ .../visual_console_builder.editor.js | 127 +++++++++++++++++- .../images/console/signes/data_image.png | Bin 0 -> 13215 bytes .../ajax/visual_console_builder.ajax.php | 2 + .../include/functions_visual_map.php | 56 +++++--- .../include/functions_visual_map_editor.php | 4 +- .../operation/visual_console/render_view.php | 2 +- 7 files changed, 190 insertions(+), 26 deletions(-) create mode 100644 pandora_console/general/check_image_module.php create mode 100644 pandora_console/images/console/signes/data_image.png diff --git a/pandora_console/general/check_image_module.php b/pandora_console/general/check_image_module.php new file mode 100644 index 0000000000..422b1de7ba --- /dev/null +++ b/pandora_console/general/check_image_module.php @@ -0,0 +1,25 @@ + + + diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 229ceeaa86..798d330196 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -84,6 +84,45 @@ function visual_map_main() { //Fixed to wait the load of images. $(window).load(function() { + $('#module').change(function(){ + var txt = $("#module").val(); + if(selectedItem == 'simple_value' || creationItem == 'simple_value'){ + $.ajax({ + async:false, + type: "POST", + url: "ajax.php", + data: {"page" : "general/check_image_module", + "get_image" : txt, + }, + success: function(data) { + if(data == 0){ + $("#data_image_check").html('Off'); + $('#data_image_container').css('display','none'); + $('#data_image_check').css('display','none'); + $('#data_image_check_label').css('display','none'); + $('.block_tinymce').remove(); + $('#process_value_row').css('display','table-row'); + if($('#process_value').val() != '0'){ + $('#period_row').css('display','table-row'); + } + } + else{ + $('#data_image_container').css('display','inline'); + $('#data_image_check').css('display','inline'); + $('#data_image_check_label').css('display','inline'); + $("#data_image_check").html('On'); + $('#process_value_row').css('display','none'); + $('#period_row').css('display','none'); + $('#text-label_ifr').contents().find('#tinymce').html('_VALUE_'); + $('.block_tinymce').remove(); + $('#label_row').append('
'); + } + } + }); + } + }); + + $('#radiobtn0001').click(function(){ $("#custom_graph option[value=0]").prop("selected", true); }); @@ -338,10 +377,32 @@ function update_button_palette_callback() { setModuleGraph(idItem); break; case 'simple_value': - $("#text_" + idItem).html(values['label']); + //checkpoint + if(($('#text-label_ifr').contents().find('#tinymce p').html() == '_VALUE_' || + $('#text-label_ifr').contents().find('#tinymce').html() == '_VALUE_') + && $('#data_image_check').html() != 'On'){ + alert('_VALUE_ exactly value is only enable for data image. Please change label text or select a data image module.'); + return; + } + $("#" + idItem).html(values['label']); + if(values['label'].replace( /<.*?>/g, '' ) == '_VALUE_'){ + $("#text_" + idItem).html(''); + $("#" + idItem).html(''); + } + else{ + $("#text_" + idItem).html( + '
'+values["label"]+'
' + ) + $("#" + idItem).html( + '
'+values["label"]+'
' + ) + + } + + //$("#simplevalue_" + idItem) //.html($('').attr('src', "images/spinner.gif")); - setModuleValue(idItem,values['process_simple_value'], values['period']); + setModuleValue(idItem,values['process_simple_value'], values['period'],values['width']); break; case 'label': $("#text_" + idItem).html(values['label']); @@ -489,6 +550,10 @@ function readFields() { values['background'] = $("#background_image").val(); values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period").val(); values['width'] = $("input[name=width]").val(); + values['width_data_image'] = $("#data_image_width").val(); + if(values['width_data_image'] != 0){ + values['width'] = values['width_data_image']; + } values['height'] = $("input[name=height]").val(); values['parent'] = $("select[name=parent]").val(); values['map_linked'] = $("select[name=map_linked]").val(); @@ -656,6 +721,7 @@ function create_button_palette_callback() { create_line('step_1', values); break; default: + insertDB(creationItem, values); break; } @@ -933,6 +999,14 @@ function toggle_item_palette() { $( "#text-label_ifr" ).contents().find( "span" ).css("line-height",$('#lineheight').val()); } + + if(creationItem != 'simple_value'){ + $("#data_image_check").html('Off'); + $("#data_image_check").css('display','none'); + $("#data_image_check_label").css('display','none'); + $("#data_image_container").css('display','none'); + $('.block_tinymce').remove(); + } } function fill_parent_select(id_item) { @@ -1655,12 +1729,13 @@ function setModuleGraph(id_data) { } -function setModuleValue(id_data, process_simple_value, period) { +function setModuleValue(id_data, process_simple_value, period,width_data_image) { var parameter = Array(); parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); parameter.push ({name: "action", value: "get_module_value"}); parameter.push ({name: "id_element", value: id_data}); parameter.push ({name: "period", value: period}); + parameter.push ({name: "width", value: width_data_image}); parameter.push ({name: "id_visual_console", value: id_visual_console}); if (process_simple_value != undefined) { parameter.push ({name: "process_simple_value", value: process_simple_value}); @@ -1672,7 +1747,9 @@ function setModuleValue(id_data, process_simple_value, period) { type: "POST", dataType: 'json', success: function (data) { - var currentValue = $("#text_" + id_data).html(); + + var currentValue = $("#text_" + id_data).html(); + //currentValue = currentValue.replace(/_VALUE_/gi, data.value); $("#text_" + id_data).html(currentValue); //$("#text_" + id_data).html('Data value'); @@ -2183,10 +2260,14 @@ function createItem(type, values, id_data) { case 'simple_value': sizeStyle = ''; imageSize = ''; + if($('#data_image_check').html() == 'On'){ + values['label'] = ''; + + } item = $('
' + ' ' + values['label'] + ' ' + '
' ); - setModuleValue(id_data,values.process_simple_value,values.period); + setModuleValue(id_data,values.process_simple_value,values.period,values.width_data_image); break; case 'label': item = $('
0){ + $("#data_image_check").css('display','inline'); + $("#data_image_check_label").css('display','inline'); + $('#data_image_container').css('display','inline'); + $("#data_image_check").html('On'); + $('.block_tinymce').remove(); + $('#label_row').append('
'); + $('#process_value_row').css('display','none'); + $('#period_row').css('display','none'); + } + else{ + $("#data_image_check").html('Off'); + $("#data_image_check").css('display','none'); + $("#data_image_check_label").css('display','none'); + $('#data_image_container').css('display','none'); + $('.block_tinymce').remove(); + $('#process_value_row').css('display','table-row'); + if($('#process_value').val() != 0){ + $('#period_row').css('display','table-row'); + } + } + } + else{ + $("#data_image_check").css('display','none'); + $("#data_image_check_label").css('display','none'); + $('#data_image_container').css('display','none'); + } + }); //Set the limit of draggable in the div with id "background" and set drag diff --git a/pandora_console/images/console/signes/data_image.png b/pandora_console/images/console/signes/data_image.png new file mode 100644 index 0000000000000000000000000000000000000000..e3542c1ea329e5974eb533c7bb76790c6bcb567a GIT binary patch literal 13215 zcmW+-V{|3m5{+%!$;6o(+qN;WZQGdG#>93enb@{9v7H-E{OGfU|>O^U|=s_pz|3RnEQ7yuyZ3YFy2fsFkHuE!(mAvzB2vbY{EUh zyjg|9lLwGns_ZZ7ZkonM>FH(YJ(P4fY?ZX=d*Vc#Fglrm_iQnqaa=4#^KAC=Zkm)7 z4DaC<-wKPr$sxfD7%_Sd2;lTH$heV;>3aK2v}uqnOfFU)Z`>EM6wo`En^Sii+dG7Q zLYDtjVdxV|A}KFWhQ=#CjdT2_4h{y`+a1A#GhS3Cglmj5C?_2~HA;xE@BU@7X@c^u)JUzmT4aUR2hN^<^U> z;+HcVb+D_3TwVW(hLbbRTOQF&W|Av!$#Xu9_IZO@D%N665hk2Nv%#)HGh_r7Dohq8 ze3lroEq-=e-{)AO%^2WBbkenwT~WPk^TY!3`PWz1vVtw92worX>r#-i<8M4vXXN*jF)yPPap+_<}9^ZP}lb?ArhMy+PGE^`r9 z^lNjafgDbTqpREgUD=NN0sLUYI&QMUaVGtg(;u&-vwi6JtFD3Ca%$P)W;pVF5!Hoa z(~YiomyFq~RX=U-{-63>(z2wcS_cvY)8FLda}V}Z^FChKq@{)v_`m)HCDU#D1x^Jg zHHV7Gnx4>^JvmwV;n;_Gp)2|P_2yW$9ly!{Yq@h<`7bdZ{?lsw`f9Wd>NA>qVAuqG zK&0Jz;U{DM!Pc1H^x@gLQ!cB4yI1Uym+zf{w+k^=J2B8CXePsuEqy zB5(H}Q#lPJlbraiarHsl;;4e2IK(U{%1MNum4@#HQF`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_*L!43So9!{#Z(_p9M%aKr=8?!R19IF=)18=0;cl-h;sa3C zkSom73R81?t%W%7<^jBUvOu_by&n)-2K!vL-M$alKG}Fq7=PQ@6e2u$uA98LF6ne} zpE&&h%c7pVGm}uc+fr_S#e-aM)L9{%w{lxX4|4PHK*5l34lAM!-MO*~W6&yRC5k`z zRdwz$_}w6C*km&vtfacyHpep?8P0!G1F?yE-AxOot{-*1fXIr;H4)+O!c* z3bhgJm0dyC25*F?->5+wOM+A%YeqSu6#SEKP;t z&QWEqBbPjWIGA0gA(zZ9nr==dGr`2r;o+aGi{(1G5n(*Hx%nnj~v6Vh;v07dAnp{;?{|6-G<+mH}hhAXd zS01SEN3WsLd%``#s)FSkf2|V_PK6Ugyl2HO%ZO84Q4yuhST=0Zs1LG>yRq?JOn7)W zgI=c~{D%oUfj)7}u*a|o!2Xv#sl$ciGx^63*cFecDI69y3g|}*Fc}F&@j6kXkpBS| CY=8v- literal 0 HcmV?d00001 diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index 2a786200ad..efc5267119 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -422,6 +422,7 @@ switch ($action) { $values['type'] = visual_map_get_simple_value_type( $process_simple_value); $values['period'] = $period; + $values['width'] = $width; } case 'percentile_bar': case 'percentile_item': @@ -897,6 +898,7 @@ switch ($action) { //This allows min, max and avg process in a simple value $values['type'] = visual_map_get_simple_value_type($process_simple_value); $values['period'] = $period; + $values['width'] = $width; break; case 'label': $values['type'] = LABEL; diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 60125340ff..6967633915 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -1438,17 +1438,25 @@ function visual_map_print_item($mode = "read", $layoutData, if(get_parameter('action') == 'edit'){ - - //echo 'Data value'; - - echo $io_safe_output_text; + //html_debug($layoutData); + //echo 'Data value'; + if(strip_tags($io_safe_output_text) != '_VALUE_'){ + echo $io_safe_output_text; + } + else{ + echo ""; + } } else{ - - echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text); - + if(strip_tags($io_safe_output_text) != '_VALUE_'){ + echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text); } + else{ + echo str_replace('>', ' style="width:'.$layoutData['width'].'px">',$value); + } + + } //Restore db connection @@ -1575,6 +1583,8 @@ function visual_map_get_simple_value_type($process_simple_value) { function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY) { global $config; + + $unit_text = db_get_sql ('SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module); $unit_text = trim(io_safe_output($unit_text)); @@ -1583,23 +1593,35 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY) case SIMPLE_VALUE: $value = db_get_value ('datos', 'tagente_estado', 'id_agente_modulo', $id_module); + + if ($value === false) { $value = __('Unknown'); + + $value = preg_replace ('/\n/i','
',$value); + $value = preg_replace ('/\s/i',' ',$value); } else { - if ( is_numeric($value) ) { - if ($config['simple_module_value']) { - $value = remove_right_zeros(number_format($value, $config['graph_precision'])); + if(strpos($value, 'data:image') !== false){ + $value = ''; + } + else{ + + if ( is_numeric($value) ) { + if ($config['simple_module_value']) { + $value = remove_right_zeros(number_format($value, $config['graph_precision'])); + } } + if (!empty($unit_text)) { + $value .= " " . $unit_text; + } + + $value = preg_replace ('/\n/i','
',$value); + $value = preg_replace ('/\s/i',' ',$value); + } - if (!empty($unit_text)) { - $value .= " " . $unit_text; - } + } - - $value = preg_replace ('/\n/i','
',$value); - $value = preg_replace ('/\s/i',' ',$value); - return $value; break; case SIMPLE_VALUE_MAX: diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 83f7c99a81..c145b08f88 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -310,8 +310,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['module_row']['html'] = '' . __('Module') . ' ' . - html_print_select(array(), 'module', '', '', __('Any'), 0, true) . - ''; + html_print_select(array(), 'module', '', '', __('Any'), 0, true). ' + '; $form_items['type_graph'] = array(); diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index 79101d82ee..550be5504a 100755 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -278,7 +278,7 @@ $ignored_params['refr'] = ''; $(".overlay").removeClass("overlay").addClass("overlaydisabled"); - $('.item:not(.icon) img').each( function() { + $('.item:not(.icon) img:not(.b64img)').each( function() { if ($(this).css('float')=='left' || $(this).css('float')=='right') { $(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px'); $(this).css('margin-left',''); From c7c158297d8ee0be3fd15fc798806b148c488c65 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 14 Jun 2017 19:12:17 +0200 Subject: [PATCH 11/81] Fix module editor can not show name with quotes - #1019 --- .../godmode/agentes/module_manager_editor_common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index fb2ed5c845..dfcff7adc9 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -148,7 +148,7 @@ $table_simple->colspan[6][1] = 3; $table_simple->data[0][0] = __('Name'); $table_simple->data[0][1] = html_print_input_text_extended ('name', - io_safe_output($name), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', $largeClassDisabledBecauseInPolicy, true); + io_safe_input(html_entity_decode($name)), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', $largeClassDisabledBecauseInPolicy, true); //$table_simple->data[0][1] = html_print_input_text ('name', // io_safe_output($name), '', 45, 100, true, $disabledBecauseInPolicy); From e68858e4c22fd0e9b630e3b9e5171308fbad07a4 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 15 Jun 2017 15:12:27 +0200 Subject: [PATCH 12/81] new feature in snmp browser --- .../include/functions_snmp_browser.php | 97 ++++++++++++++++++- .../operation/snmpconsole/snmp_browser.php | 1 + 2 files changed, 97 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index c15ceb2966..b8644e044e 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -116,7 +116,7 @@ function snmp_browser_print_tree ($tree, $id = 0, $depth = 0, $last = 0, $last_a echo ""; } - echo ' ' . $level . ''; + echo ' ' . $level . ''. html_print_checkbox("create_$sub_id", 0, false, true, false, '');; if (isset ($sub_level['__VALUE__'])) { echo ''; } @@ -618,3 +618,98 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height } ?> + + diff --git a/pandora_console/operation/snmpconsole/snmp_browser.php b/pandora_console/operation/snmpconsole/snmp_browser.php index 148a6e7179..262367cca3 100644 --- a/pandora_console/operation/snmpconsole/snmp_browser.php +++ b/pandora_console/operation/snmpconsole/snmp_browser.php @@ -47,6 +47,7 @@ if (is_ajax()) { } else { snmp_browser_print_tree ($snmp_tree); + echo html_print_submit_button(__('Create network component'),'create_network_component', false, '', true); } return; } From 7bf9860aaa609e8c25c8b9d19e678c77176ef182 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 15 Jun 2017 15:40:12 +0200 Subject: [PATCH 13/81] Changed agent name by alias --- pandora_console/operation/snmpconsole/snmp_view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index 61506e85a3..5a6d8547ed 100755 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -774,7 +774,7 @@ if ($traps !== false) { continue; } $data[1] = ''; - $data[1] .= ''.$agent["nombre"].ui_print_help_tip($trap['source'], true, "images/tip-blanco.png");''; + $data[1] .= ''.$agent["alias"].ui_print_help_tip($trap['source'], true, "images/tip-blanco.png");''; } //OID From 4398b47d92607d256de85b2b5d9aa99a411797b0 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 20 Jun 2017 10:31:14 +0200 Subject: [PATCH 14/81] updated --- .../include/functions_snmp_browser.php | 119 +++++++++++------- pandora_console/include/styles/pandora.css | 5 +- .../operation/snmpconsole/snmp_browser.php | 22 +++- 3 files changed, 102 insertions(+), 44 deletions(-) diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index b8644e044e..0dd694c04b 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -116,7 +116,7 @@ function snmp_browser_print_tree ($tree, $id = 0, $depth = 0, $last = 0, $last_a echo ""; } - echo ' ' . $level . ''. html_print_checkbox("create_$sub_id", 0, false, true, false, '');; + echo html_print_checkbox("create_$sub_id", 0, false, true, false, '') .' ' . $level . ''; if (isset ($sub_level['__VALUE__'])) { echo ''; } @@ -622,69 +622,104 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height + From 7e383262bb8c323166b33955f0c082c083828e05 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Tue, 20 Jun 2017 13:56:20 +0200 Subject: [PATCH 16/81] Change tserver_export_data to varchar 600 - #1015 --- .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 6 ++++++ pandora_console/pandoradb.sql | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 588a68da48..2a6896b217 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1370,3 +1370,9 @@ CREATE TABLE IF NOT EXISTS `treset_pass` ( UPDATE tgis_map_connection SET conection_data = '{"type":"OSM","url":"http://tile.openstreetmap.org/${z}/${x}/${y}.png"}' where id_tmap_connection = 1; ALTER TABLE tpolicy_modules MODIFY post_process double(24,15) default 0; + +-- --------------------------------------------------------------------- +-- Table `tserver_export` +-- --------------------------------------------------------------------- + +ALTER TABLE tserver_export MODIFY `name` varchar(600) BINARY NOT NULL default ''; \ No newline at end of file diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 1ef3c1f7e8..3bc2788f2c 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1381,7 +1381,7 @@ CREATE TABLE IF NOT EXISTS `tmodule` ( -- --------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tserver_export` ( `id` int(10) unsigned NOT NULL auto_increment, - `name` varchar(100) NOT NULL default '', + `name` varchar(600) BINARY NOT NULL default '', `preffix` varchar(100) NOT NULL default '', `interval` int(5) unsigned NOT NULL default '300', `ip_server` varchar(100) NOT NULL default '', From b38b41b94216d212e7ae2b0832956989ec4a6481 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 20 Jun 2017 15:32:24 +0200 Subject: [PATCH 17/81] updated files --- pandora_console/include/functions_snmp_browser.php | 8 ++++++-- pandora_console/include/styles/pandora.css | 2 +- pandora_console/operation/snmpconsole/snmp_browser.php | 5 ++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index 0dd694c04b..7318e871cf 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -684,7 +684,11 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height $('input[name*=create_network_component]').addClass("sub add"); if(data.length !== 0){ - $('#prueba').text(data); + $('#error_text').text(""); + data.forEach( function(valor, indice, array) { + console.log(valor); + $('#error_text').append('
'+ valor ); + }); $("#dialog_error") .dialog({ resizable: true, @@ -703,7 +707,7 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height resizable: true, draggable: true, modal: true, - height: 300, + height: 250, width: 500, overlay: { opacity: 0.5, diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 0803ba4354..b2f7592fd5 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -742,7 +742,7 @@ input.camera { background-image: url(../../images/input_camera.png) !important; } input.spinn { - background-image: url(../../images/input_update.png) !important; + background-image: url(../../images/spinner.gif) !important; } #toolbox #auto_save { diff --git a/pandora_console/operation/snmpconsole/snmp_browser.php b/pandora_console/operation/snmpconsole/snmp_browser.php index 37b7eca939..191c0caab9 100644 --- a/pandora_console/operation/snmpconsole/snmp_browser.php +++ b/pandora_console/operation/snmpconsole/snmp_browser.php @@ -54,8 +54,8 @@ if (is_ajax()) { echo "
"; echo "
"; echo "

ERROR

"; - echo "

".__('Error creating the following modules:')."

"; - echo "

"; + echo "

".__('Error creating the following modules:')."

"; + echo "

"; echo "
"; echo '
'; @@ -65,7 +65,6 @@ if (is_ajax()) { echo "
"; echo "

SUCCESS

"; echo "

".__('Modules successfully created')."

"; - echo "

"; echo "
"; echo '
'; } From b7f4ecbe698a5667885de20ece911c228d0d6e2f Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 20 Jun 2017 15:46:35 +0200 Subject: [PATCH 18/81] update css and added gif --- pandora_console/images/spinner_green.gif | Bin 0 -> 2281 bytes pandora_console/include/styles/pandora.css | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 pandora_console/images/spinner_green.gif diff --git a/pandora_console/images/spinner_green.gif b/pandora_console/images/spinner_green.gif new file mode 100644 index 0000000000000000000000000000000000000000..5182e7e42ebd564ce3143e9144870b38e40b0e1c GIT binary patch literal 2281 zcmcJQYfMvT9L7(fcMjzoS}wiP7KAdZL3(812$r7HQV=>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@h%HWHxAr2wFqBTE_zGKRvS)XCM;2-oyV7I{_(ZntvcdbX|icVVZ`D~;<`w2g4Hkrr^A58TfYai+yj3K!U#!*&A#hSPz$1IAp3#y8EvN*FiK4#J+ zBxNzUN_a$knie+hju#ioCDBQegtC=Sn6U2uk1?P-x+ns=2Qi|N4BVi>y9G`j_yoOw zg5-R_ekev$;35i;1cpHJnPY4ZW2{v#8P%k^$iFnCFm`F~-Wp=?*)Qhg0z%6E?e3)< z$>5m({;IlCD>}kNHj50TiV?lSNHD29mf@00h98+o3Ych~Jf3MF6A#cbQZB-6cqLC< zPDkHzE+XZP~mB`(X_{N&|Tc&{s&BWPb2^U literal 0 HcmV?d00001 diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index b2f7592fd5..9c9caec505 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -742,7 +742,7 @@ input.camera { background-image: url(../../images/input_camera.png) !important; } input.spinn { - background-image: url(../../images/spinner.gif) !important; + background-image: url(../../images/spinner_green.gif) !important; } #toolbox #auto_save { From c942fce06864a7b4c9d65d84ea0ca0606d92781d Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 20 Jun 2017 15:47:29 +0200 Subject: [PATCH 19/81] added snmp_browser.ajax --- .../include/ajax/snmp_browser.ajax.php | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 pandora_console/include/ajax/snmp_browser.ajax.php diff --git a/pandora_console/include/ajax/snmp_browser.ajax.php b/pandora_console/include/ajax/snmp_browser.ajax.php new file mode 100644 index 0000000000..3376245093 --- /dev/null +++ b/pandora_console/include/ajax/snmp_browser.ajax.php @@ -0,0 +1,126 @@ + $target_oid) { + $oid = snmp_browser_get_oid ($target_ip, $community, + htmlspecialchars_decode($target_oid), $snmp_version, $snmp3_auth_user, + $snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass, + $snmp3_privacy_method, $snmp3_privacy_pass); + + + $name_check = db_get_value ('name', 'tnetwork_component', + 'name', $oid['oid']); + + if(empty($oid['description'])) { + $description = ''; + } else { + $description = io_safe_input($oid['description']); + } + + if(!$name_check){ + $id = network_components_create_network_component ($oid['oid'],17,1, + array ('description' => $description, + 'module_interval' => 300, + 'max' => 0, + 'min' => 0, + 'tcp_send' => $snmp_version, + 'tcp_rcv' => '', + 'tcp_port' => 0, + 'snmp_oid' => $oid['numeric_oid'], + 'snmp_community' => $community, + 'id_module_group' => 3, + 'id_modulo' => 2, + 'id_plugin' => 0, + 'plugin_user' => '', + 'plugin_pass' => '', + 'plugin_parameter' => '', + 'macros' => '', + 'max_timeout' => 0, + 'max_retries' => 0, + 'history_data' => '', + 'dynamic_interval' => 0, + 'dynamic_max' => 0, + 'dynamic_min' => 0, + 'dynamic_two_tailed' => 0, + 'min_warning' => 0, + 'max_warning' => 0, + 'str_warning' => '', + 'min_critical' => 0, + 'max_critical' => 0, + 'str_critical' => '', + 'min_ff_event' => 0, + 'custom_string_1' => '', + 'custom_string_2' => '', + 'custom_string_3' => '', + 'post_process' => 0, + 'unit' => '', + 'wizard_level' => 'nowizard', + 'macros' => '', + 'critical_instructions' => '', + 'warning_instructions' => '', + 'unknown_instructions' => '', + 'critical_inverse' => 0, + 'warning_inverse' => 0, + 'id_category' => 0, + 'tags' => '', + 'disabled_types_event' => '{"going_unknown":1}', + 'min_ff_event_normal' => 0, + 'min_ff_event_warning' => 0, + 'min_ff_event_critical' => 0, + 'each_ff' => 0)); + } + + if(empty($id)) { + array_push($fail_modules,$name_check); + } + } + } + + echo json_encode($fail_modules); + return; +} + + + +?> \ No newline at end of file From bd537cd8917a111891bfa7b3b984a180f7bea441 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Tue, 20 Jun 2017 17:45:01 +0200 Subject: [PATCH 20/81] Change connection data for mysql queries - #1030 --- pandora_console/extensions/db_status.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pandora_console/extensions/db_status.php b/pandora_console/extensions/db_status.php index ca69e0282b..e5e1d84331 100755 --- a/pandora_console/extensions/db_status.php +++ b/pandora_console/extensions/db_status.php @@ -127,7 +127,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d ui_print_error_message( __('Unsuccessful installed tables into the testing DB')); } - else { + else {/* if (enterprise_installed()) { $install_tables_enterprise = extension_db_status_execute_sql_file( @@ -139,7 +139,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d __('Unsuccessful installed enterprise tables into the testing DB')); } } - + */ extension_db_check_tables_differences( $connection_test, $connection_system, @@ -159,6 +159,7 @@ function extension_db_check_tables_differences($connection_test, global $config; + // --------- Check the tables -------------------------------------- mysql_select_db($db_name_test, $connection_test); $result = mysql_query("SHOW TABLES", $connection_test); @@ -170,9 +171,8 @@ function extension_db_check_tables_differences($connection_test, //~ $tables_test = array_merge($tables_test, //~ extension_db_status_extension_tables()); - - mysql_select_db($db_name_system, $connection_system); - $result = mysql_query("SHOW TABLES", $connection_system); + mysql_select_db($db_name_system, $connection_test); + $result = mysql_query("SHOW TABLES", $connection_test); $tables_system = array(); while ($row = mysql_fetch_array ($result)) { $tables_system[] = $row[0]; @@ -227,8 +227,8 @@ function extension_db_check_tables_differences($connection_test, - mysql_select_db($db_name_system, $connection_system); - $result = mysql_query("EXPLAIN " . $table, $connection_system); + mysql_select_db($db_name_system, $connection_test); + $result = mysql_query("EXPLAIN " . $table, $connection_test); $fields_system = array(); if (!empty($result)) { while ($row = mysql_fetch_array ($result)) { From ff7de5ed4f31da83ed75d0e24043642917edc3b5 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Wed, 21 Jun 2017 11:06:52 +0200 Subject: [PATCH 21/81] Added alias to snmp alert agent object --- pandora_server/lib/PandoraFMS/Core.pm | 47 ++++++++++++++------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 9c311c9c5d..1fd6250c56 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -3391,6 +3391,30 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) { if (($internal_counter + 1 >= $min_alerts) && ($times_fired + 1 <= $max_alerts)) { ($times_fired++, $internal_counter++); + my %agent; + + my $this_agent = get_agent_from_addr ($dbh, $trap_agent); + + if (defined($this_agent)){ + %agent = ( + 'nombre' => $this_agent->{'nombre'}, + 'id_agente' => $this_agent->{'id_agente'}, + 'direccion' => $trap_agent, + 'id_grupo' => $this_agent->{'id_grupo'}, + 'comentarios' => '', + 'alias' => $this_agent->{'alias'} + ); + } else { + %agent = ( + 'nombre' => $trap_agent, + 'direccion' => $trap_agent, + 'comentarios' => '', + 'id_agente' => 0, + 'id_grupo' => 0, + 'alias' => $trap_agent + ); + } + my %alert = ( 'snmp_alert' => 1, 'name' => '', @@ -3419,27 +3443,6 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) { 'id' => $alert->{'id_alert'}, 'priority' => $alert->{'priority'}, ); - - my %agent; - - my $this_agent = get_agent_from_addr ($dbh, $trap_agent); - if (defined($this_agent)){ - %agent = ( - 'nombre' => $this_agent->{'nombre'}, - 'id_agente' => $this_agent->{'id_agente'}, - 'direccion' => $trap_agent, - 'id_grupo' => $this_agent->{'id_grupo'}, - 'comentarios' => '' - ); - } else { - %agent = ( - 'nombre' => $trap_agent, - 'direccion' => $trap_agent, - 'comentarios' => '', - 'id_agente' => 0, - 'id_grupo' => 0 - ); - } # Execute alert my $action = get_db_single_row ($dbh, 'SELECT * @@ -3455,7 +3458,7 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) { if ($action->{'id_alert_command'} != 3){ pandora_event ($pa_config, "SNMP alert fired (" . $alert->{'description'} . ")", 0, 0, $alert->{'priority'}, 0, 0, 'alert_fired', 0, $dbh); - } + } # Update alert status db_do ($dbh, 'UPDATE talert_snmp SET times_fired = ?, last_fired = ?, internal_counter = ? WHERE id_as = ?', From e86c87d23b787156a62d0ba7dbacc174eeb903ff Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Wed, 21 Jun 2017 13:50:05 +0200 Subject: [PATCH 22/81] Added refresh by user --- pandora_console/general/header.php | 6 ++++-- pandora_console/include/config_process.php | 2 +- pandora_console/include/functions_config.php | 3 --- pandora_console/operation/users/user_edit.php | 12 ++++++------ 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 971ca50465..b5b3479dd9 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -191,7 +191,9 @@ config_check(); $_GET['refr'] = null; } - if ($config['autorefresh_white_list'] !== null && array_search($_GET['sec2'], $config['autorefresh_white_list']) !== false) { + $select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'"); + $autorefresh_list = json_decode($select[0]['autorefresh_white_list']); + if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) { $autorefresh_img = html_print_image("images/header_refresh.png", true, array("class" => 'bot', "alt" => 'lightning', 'title' => __('Configure autorefresh'))); if ($_GET['refr']) { @@ -354,7 +356,7 @@ config_check(); var new_chat = ; $(document).ready (function () { $("a.autorefresh_txt").toggle (); $("#combo_refr").toggle (); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 4398f0c3e5..d9a6294d17 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -252,7 +252,7 @@ if (isset($_POST['vc_refr'])) { //======= Autorefresh code ============================================= -$select = db_process_sql("SELECT value FROM tconfig WHERE token='autorefresh_white_list'"); +$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'"); $autorefresh_list = json_decode($select[0]['value']); $config['autorefresh_white_list'] = array(); $config['autorefresh_white_list'] = $autorefresh_list; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index c6828ffd1b..08bd6f7aac 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -855,9 +855,6 @@ function config_process_config () { config_update_value ('status_images_set', 'default'); } - if(!isset ($config['autorefresh_white_list'])){ - config_update_value ('autorefresh_white_list', ''); - } // Load user session if (isset ($_SESSION['id_usuario'])) $config["id_user"] = $_SESSION["id_usuario"]; diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php index b2f3c91874..4e76d32899 100644 --- a/pandora_console/operation/users/user_edit.php +++ b/pandora_console/operation/users/user_edit.php @@ -94,11 +94,11 @@ if (isset ($_GET["modified"]) && !$view_mode) { //save autorefresh list $autorefresh_list = get_parameter_post ("autorefresh_list"); if(($autorefresh_list[0] === '') || ($autorefresh_list[0] === '0')){ - db_process_sql("UPDATE tconfig SET value ='' WHERE token='autorefresh_white_list'"); - }else{ - db_process_sql("UPDATE tconfig SET value ='".json_encode($autorefresh_list)."' WHERE token='autorefresh_white_list'"); + $upd_info['autorefresh_white_list'] = ""; + } + else{ + $upd_info['autorefresh_white_list'] = json_encode($autorefresh_list); } - $is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $id); @@ -382,8 +382,8 @@ $autorefresh_list_out['operation/visual_console/render_view'] = "render_view"; $autorefresh_list_out['operation/events/events'] = "events"; if(!isset($autorefresh_list)){ - $select = db_process_sql("SELECT value FROM tconfig WHERE token='autorefresh_white_list'"); - $autorefresh_list = json_decode($select[0]['value']); + $select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'"); + $autorefresh_list = json_decode($select[0]['autorefresh_white_list']); if($autorefresh_list === null){ $autorefresh_list[0] = __('None'); }else{ From 2737b6567a7aae6dd1cc7619eb3ab7029d9083eb Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Wed, 21 Jun 2017 14:35:22 +0200 Subject: [PATCH 23/81] Added Borja line to fix module graph period in visual console with non-administrator users --- .../visual_console_builder.editor.js | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 4926a215ca..ba1669da9f 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -510,6 +510,9 @@ function readFields() { values['process_simple_value'] = $("select[name=process_value]").val(); values['background'] = $("#background_image").val(); values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period").val(); + if (values['period'] == null) { + values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period_select").val(); + } values['width'] = $("input[name=width]").val(); values['height'] = $("input[name=height]").val(); values['parent'] = $("select[name=parent]").val(); @@ -563,14 +566,14 @@ function create_button_palette_callback() { var validate = true; switch (creationItem) { case 'box_item': - if (($("input[name='width_box']").val() == '')) { - alert('Undefined width'); - validate = false; - } - if (($("input[name='height_box']").val() == '')) { - alert('Undefined height'); - validate = false; - } + if (($("input[name='width_box']").val() == '')) { + alert('Undefined width'); + validate = false; + } + if (($("input[name='height_box']").val() == '')) { + alert('Undefined height'); + validate = false; + } break; case 'group_item': case 'static_graph': @@ -630,7 +633,7 @@ function create_button_palette_callback() { validate = false; } break; - case 'module_graph': + case 'module_graph': if (values['width_module_graph'] == '') { alert('Undefined width'); validate = false; From ec2872b83b142c1779eeef803b28b45e1f3b0f80 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Wed, 21 Jun 2017 16:41:31 +0200 Subject: [PATCH 24/81] Added second check to period field in module charts (admin have diferent field name) --- pandora_console/operation/agentes/stat_win.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 63cb403e04..5199f58506 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -150,7 +150,10 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $avg_only = $show_other; } - $period = get_parameter ("period", SECONDS_1DAY); + $period = get_parameter ("period"); + if ($period == "") { + $period = get_parameter ("period_select", SECONDS_1DAY); + } $id = get_parameter ("id", 0); $width = get_parameter ("width", STATWIN_DEFAULT_CHART_WIDTH); $height = get_parameter ("height", STATWIN_DEFAULT_CHART_HEIGHT); From e6efe5825bca9099edc8626f6fb43dbc0336cb1a Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 22 Jun 2017 09:28:07 +0200 Subject: [PATCH 25/81] Added active filters to snmp console --- pandora_console/include/functions_snmp.php | 107 ++++++++++++++++++ .../operation/snmpconsole/snmp_view.php | 22 +++- 2 files changed, 124 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_snmp.php b/pandora_console/include/functions_snmp.php index 71a232280e..fe5333f162 100644 --- a/pandora_console/include/functions_snmp.php +++ b/pandora_console/include/functions_snmp.php @@ -279,4 +279,111 @@ function snmp_update_translation($oid, $new_oid, $description, $post_process) { } } } + +/* + * Print the event filter tag cloud (enterprise feature) + * @param $filter_resume: Array with the active filters + * @param $filter_refs: Array of all arrays to humanize some tags + */ +function print_snmp_tags_active_filters ($filter_resume = array()) { + global $config; + + $tags_set = array(); + + // Alert + if (isset($filter_resume['filter_fired'])) { + array_push ($tags_set, array( + 'title' => __('Alert'), + 'value' => $filter_resume['filter_fired'] + )); + } + // Severity + if (isset($filter_resume['filter_severity'])) { + array_push ($tags_set, array( + 'title' => __('Severity'), + 'value' => $filter_resume['filter_severity'] + )); + } + // Pagination + if ($filter_resume['pagination'] == "") { + $filter_resume['pagination'] = $config["block_size"]; + } + array_push ($tags_set, array( + 'title' => __('Pagination'), + 'value' => $filter_resume['pagination'] + )); + // Free search + if (isset($filter_resume['free_search_string']) && $filter_resume['free_search_string'] != "") { + array_push ($tags_set, array( + 'title' => __('Search'), + 'value' => $filter_resume['free_search_string'] + )); + } + // Status + if (isset($filter_resume['filter_status']) && $filter_resume['filter_status'] != "") { + array_push ($tags_set, array( + 'title' => __('Status'), + 'value' => $filter_resume['filter_status'] + )); + } + // Group by + if (isset($filter_resume['group_by'])) { + if ($filter_resume['group_by'] == 0) { + array_push ($tags_set, array( + 'title' => __('Group by Enterprise String / IP'), + 'value' => __('No') + )); + } + else { + array_push ($tags_set, array( + 'title' => __('Group by Enterprise String / IP'), + 'value' => __('Yes') + )); + } + } + // Date from + if (isset($filter_resume['date_from_trap']) && $filter_resume['date_from_trap'] != "") { + if (isset($filter_resume['time_from_trap']) && $filter_resume['time_from_trap'] != "") { + array_push ($tags_set, array( + 'title' => __('From'), + 'value' => $filter_resume['date_from_trap'] . " " . $filter_resume['time_from_trap'] + )); + } + else { + array_push ($tags_set, array( + 'title' => __('From'), + 'value' => $filter_resume['date_from_trap'] + )); + } + } + // Date to + if (isset($filter_resume['date_to_trap']) && $filter_resume['date_to_trap'] != "") { + if (isset($filter_resume['time_to_trap']) && $filter_resume['time_to_trap'] != "") { + array_push ($tags_set, array( + 'title' => __('To'), + 'value' => $filter_resume['date_to_trap'] . " " . $filter_resume['time_to_trap'] + )); + } + else { + array_push ($tags_set, array( + 'title' => __('To'), + 'value' => $filter_resume['date_to_trap'] + )); + } + } + // Trap type + if (isset($filter_resume['trap_type'])) { + array_push ($tags_set, array( + 'title' => __('Trap type'), + 'value' => $filter_resume['trap_type'] + )); + } + $title = ''; + if(!$config['pure']){ + $title = isset($filter_resume['title']) + ? __('Active filter') . " (" . $filter_resume['title'] . ")" + : __('Active filters'); + } + if (sizeof($filter_resume) > 0) ui_print_tags_view($title, $tags_set); +} ?> diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index 61506e85a3..79aca85153 100755 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -518,15 +518,22 @@ $filter .= html_print_submit_button(__('Update'), 'search', false, 'class="sub u $filter .= ''; $filter .= ''; - - - +$filter_resume = array(); +$filter_resume['filter_fired'] = $alerted[$filter_fired]; +$filter_resume['filter_severity'] = $severities[$filter_severity]; +$filter_resume['pagination'] = $paginations[$pagination]; +$filter_resume['free_search_string'] = $free_search_string; +$filter_resume['filter_status'] = $status_array[$filter_status]; +$filter_resume['group_by'] = $group_by; +$filter_resume['date_from_trap'] = $date_from_trap; +$filter_resume['time_from_trap'] = $time_from_trap; +$filter_resume['date_to_trap'] = $date_to_trap; +$filter_resume['time_to_trap'] = $time_to_trap; +$filter_resume['trap_type'] = $trap_types[$trap_type]; $traps = db_get_all_rows_sql($sql); $trapcount = (int) db_get_value_sql($sql_count); - - // No traps if (empty ($traps)) { // Header @@ -546,6 +553,9 @@ if (empty ($traps)) { if(!empty ($traps2)){ ui_toggle($filter, __('Toggle filter(s)')); + + print_snmp_tags_active_filters($filter_resume); + ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no SNMP traps in database that contains this filter') ) ); } else { ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no SNMP traps in database') ) ); @@ -651,6 +661,8 @@ if (empty ($traps)) { ui_toggle($filter, __('Toggle filter(s)')); unset ($table); +print_snmp_tags_active_filters($filter_resume); + if (($config['dbtype'] == 'oracle') && ($traps !== false)) { for ($i = 0; $i < count($traps); $i++) { unset($traps[$i]['rnum']); From b19164cbd2e11a6e49f5e7a5927b51c96b35a8c1 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 22 Jun 2017 11:55:30 +0200 Subject: [PATCH 26/81] Fixed visual console render img --- pandora_console/operation/visual_console/render_view.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index 79101d82ee..78c29d1e68 100755 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -284,8 +284,13 @@ $ignored_params['refr'] = ''; $(this).css('margin-left',''); } else { - $(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px'); - $(this).css('margin-top',''); + if(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2 < 0){ + $(this).css('margin-left',''); + $(this).css('margin-top',''); + } else { + $(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px'); + $(this).css('margin-top',''); + } } }); From 42b822a07a03d825b365d4e79026297979766fac Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 22 Jun 2017 15:27:00 +0200 Subject: [PATCH 27/81] Erase functionality --- pandora_console/godmode/setup/setup_auth.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index c7e29ea909..1b18f0f7ec 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -51,7 +51,8 @@ if (is_ajax ()) { $row['control'] = __('Yes').' '.html_print_radio_button('fallback_local_auth', 1, '', $config['fallback_local_auth'], true).'  '; $row['control'] .= __('No').' '.html_print_radio_button('fallback_local_auth', 0, '', $config['fallback_local_auth'], true); $table->data['fallback_local_auth'] = $row; - + + if (enterprise_installed()) { // Autocreate remote users $row = array(); $row['name'] = __('Autocreate remote users'); @@ -59,8 +60,7 @@ if (is_ajax ()) { $row['control'] .= __('No').' '.html_print_radio_button_extended('autocreate_remote_users', 0, '', $config['autocreate_remote_users'], false, '', '', true); $table->data['autocreate_remote_users'] = $row; - if (enterprise_installed()) { - add_enterprise_auth_autocreate_profiles($table, $type_auth); + add_enterprise_auth_autocreate_profiles($table, $type_auth); } } From 8d378b4b608ed8d10e1ced13f86e2273b91d79bd Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 26 Jun 2017 11:29:56 +0200 Subject: [PATCH 28/81] Fixed display of data --- .../operation/agentes/gis_view.php | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/agentes/gis_view.php b/pandora_console/operation/agentes/gis_view.php index 96b3167013..9784d65fc0 100644 --- a/pandora_console/operation/agentes/gis_view.php +++ b/pandora_console/operation/agentes/gis_view.php @@ -141,9 +141,29 @@ $result = db_get_all_rows_sql ($sql, true); if ($result === false) { - ui_print_empty_data( __('This agent doesn\'t have any GIS data.') ); + + $sql2 = sprintf (" + SELECT current_longitude AS longitude, current_latitude AS latitude, current_altitude AS altitude, + start_timestamp, description, number_of_packages, manual_placement + FROM tgis_data_status + WHERE tagente_id_agente = %d + ORDER BY start_timestamp DESC + LIMIT %d OFFSET %d", $agentId, $config['block_size'], (int)get_parameter ('offset')); + + $result2 = db_get_all_rows_sql ($sql2, true); + + if ($result2 === false) { + ui_print_empty_data( __('This agent doesn\'t have any GIS data.') ); + } else { + $result2[0]['end_timestamp'] = date('Y-m-d H:i:s'); + $result = $result2; + } } -else { + +if ($result !== false) { + if(!$countData){ + $countData = 1; + } ui_pagination ($countData, false) ; $table->data = array(); foreach ($result as $key => $row) { From 1a34c7413c84ab17e4050056c4cfe76ee6863a3a Mon Sep 17 00:00:00 2001 From: enriquecd Date: Mon, 26 Jun 2017 12:22:05 +0200 Subject: [PATCH 29/81] Fix creation prediction modules, add prediction_module param when create - #698 --- pandora_console/godmode/agentes/configurar_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 4484e6a1ba..e2e63b6e62 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -886,7 +886,7 @@ if ($update_module || $create_module) { $post_process = (string) get_parameter ('post_process', 0.0); if(get_parameter ('prediction_module')){ - $prediction_module = get_parameter ('prediction_module'); + $prediction_module = 1; } else{ $prediction_module = 0; From f681f63ccb59229e80c9e77dea7aec5739dfbd89 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 26 Jun 2017 15:42:34 +0200 Subject: [PATCH 30/81] fixed error in plugin server agent for alias --- pandora_server/lib/PandoraFMS/PluginServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/PluginServer.pm b/pandora_server/lib/PandoraFMS/PluginServer.pm index 1c6c86496d..9063be2c43 100644 --- a/pandora_server/lib/PandoraFMS/PluginServer.pm +++ b/pandora_server/lib/PandoraFMS/PluginServer.pm @@ -215,7 +215,7 @@ sub data_consumer ($$) { } # Agent and module macros - my %macros = (_agent_ => (defined ($agent)) ? $agent->{'nombre'} : '', + my %macros = (_agent_ => (defined ($agent)) ? $agent->{'alias'} : '', _agentdescription_ => (defined ($agent)) ? $agent->{'comentarios'} : '', _agentstatus_ => undef, _agentgroup_ => (defined ($group)) ? $group->{'nombre'} : '', From d678760e5dfb5fd7aea7e71cdb610e5ea651425c Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 27 Jun 2017 00:01:15 +0200 Subject: [PATCH 31/81] 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.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 76c6e61636..ff1e4b93ee 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.705-170626 +Version: 7.0NG.705-170627 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 cb3372dbbc..45452f3c28 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.705-170626" +pandora_version="7.0NG.705-170627" 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 985ecf5eb7..6c4867ca3f 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.705'; -use constant AGENT_BUILD => '170626'; +use constant AGENT_BUILD => '170627'; # 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 fbfd3ddd92..331b2bce33 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.705 -%define release 170626 +%define release 170627 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 ab567caf28..8503cc7573 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.705 -%define release 170626 +%define release 170627 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 327b043758..8e865bc37b 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.705" -PI_BUILD="170626" +PI_BUILD="170627" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 5a2bbeaf8c..2690bc6785 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170626} +{170627} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d44713407a..8dfd593b3e 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.705(Build 170626)") +#define PANDORA_VERSION ("7.0NG.705(Build 170627)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 5b1d8caa46..064226e8ec 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.705(Build 170626))" + VALUE "ProductVersion", "(7.0NG.705(Build 170627))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 3f0f172b9d..694b102472 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.705-170626 +Version: 7.0NG.705-170627 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 6cb5c9332a..e1886fbfa8 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.705-170626" +pandora_version="7.0NG.705-170627" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 5b66b95415..839804dd06 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC170626'; +$build_version = 'PC170627'; $pandora_version = 'v7.0NG.705'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index ece2cab814..9d75442d5b 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Tue, 27 Jun 2017 10:51:35 +0200 Subject: [PATCH 32/81] fixed autovalidate event in pandora_revent with extra_id --- pandora_console/include/functions_api.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 89fb8843da..ccadee5349 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -8843,7 +8843,7 @@ function api_set_create_tag ($id, $trash1, $other, $returnType) { //http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_event&id=name_event&other=2|system|3|admin|2|1|10|0|comments||Pandora||critical_inst|warning_inst|unknown_inst|other||&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora function api_set_create_event($id, $trash1, $other, $returnType) { - + if ($other['type'] == 'string') { returnError('error_parameter', 'Error in the parameters.'); return; @@ -8998,6 +8998,13 @@ function api_set_create_event($id, $trash1, $other, $returnType) { } if ($other['data'][18] != '') { $values['id_extra'] = $other['data'][18]; + $sql_validation = 'SELECT id_evento FROM tevento where estado=0 and id_extra ="'. $other['data'][18] .'";'; + $validation = db_get_all_rows_sql($sql_validation); + if($validation){ + foreach ($validation as $val) { + api_set_validate_event_by_id($val['id_evento']); + } + } } else { $values['id_extra'] = ''; @@ -9178,12 +9185,10 @@ function api_get_netflow_get_summary ($discard_1, $discard_2, $params) { //http://localhost/pandora_console/include/api.php?op=set&op2=validate_event_by_id&id=23&apipass=1234&user=admin&pass=pandora function api_set_validate_event_by_id ($id, $trash1, $trash2, $returnType) { global $config; - $data['type'] = 'string'; $check_id = db_get_value('id_evento', 'tevento', 'id_evento', $id); if ($check_id) { //event exists - $status = db_get_value('estado', 'tevento', 'id_evento', $id); if ($status == 1) { //event already validated $data['data'] = "Event already validated"; From 242667e162edd5104a5977816532a0f344942161 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Tue, 27 Jun 2017 11:10:07 +0200 Subject: [PATCH 33/81] Fixed selector --- pandora_console/extensions/agents_alerts.php | 2 +- pandora_console/godmode/reporting/reporting_builder.php | 2 +- pandora_console/operation/agentes/exportdata.php | 2 +- pandora_console/operation/events/events_list.php | 2 +- pandora_console/operation/events/sound_events.php | 5 ++++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pandora_console/extensions/agents_alerts.php b/pandora_console/extensions/agents_alerts.php index 91dc8a630c..97f1bc7589 100755 --- a/pandora_console/extensions/agents_alerts.php +++ b/pandora_console/extensions/agents_alerts.php @@ -93,7 +93,7 @@ function mainAgentsAlerts() { $groups = users_get_groups (); $filter_groups .= ''.__('Group').''; - $filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, false, '', '', true, false, true, '', false , 'width: 100px; margin-right: 10px;; margin-top: 5px;'); + $filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, false, '', '', true, false, true, '', false , 'margin-right: 10px; margin-top: 5px;'); $check = ''.__('Show modules without alerts').''; $check .= html_print_checkbox('slides_ids[]', $d['id'], $show_modules, true, false, '', true); diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index ca470dc79b..b7994e6a1c 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -430,7 +430,7 @@ switch ($action) { $table_aux->colspan[0][0] = 4; $table_aux->data[0][0] = "". __("Group") . ""; - $table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, 'width:150px', false, false, 'id_grupo', $strict_user). '
'; + $table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, "", false, false, 'id_grupo', $strict_user). '
'; $table_aux->data[0][2] = "". __("Free text for search: ") . ui_print_help_tip( __('Search by report name or description, list matches.'),true) . ""; diff --git a/pandora_console/operation/agentes/exportdata.php b/pandora_console/operation/agentes/exportdata.php index 0532def5f4..b79b558ef5 100644 --- a/pandora_console/operation/agentes/exportdata.php +++ b/pandora_console/operation/agentes/exportdata.php @@ -238,7 +238,7 @@ if (empty($export_btn) || $show_form) { $table->data[0][1] = html_print_select_groups($config['id_user'], "RR", users_can_manage_group_all(), "group", $group, '', '', 0, true, false, true, - 'w130', false); + '', false); //Agent selector $table->data[1][0] = ''.__('Source agent').''; diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 901ebf97db..b2ba0a338e 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -613,7 +613,7 @@ $data = array(); $data[0] = __('Group') . $jump; $data[0] .= html_print_select_groups($config["id_user"], $access, true, - 'id_group', $id_group, '', '', 0, true, false, false, 'w130', false, false, false, false, 'id_grupo', $strict_user). $jump; + 'id_group', $id_group, '', '', 0, true, false, false, '', false, false, false, false, 'id_grupo', $strict_user). $jump; //********************************************************************** // TODO // This code is disabled for to enabled in Pandora 5.1 diff --git a/pandora_console/operation/events/sound_events.php b/pandora_console/operation/events/sound_events.php index 173de7c339..f9a89364a1 100644 --- a/pandora_console/operation/events/sound_events.php +++ b/pandora_console/operation/events/sound_events.php @@ -77,7 +77,7 @@ $table->style[1] = 'font-weight: bold; vertical-align: top;'; $table->style[2] = 'font-weight: bold; vertical-align: top;'; $table->data[0][0] = __('Group'); -$table->data[0][1] = html_print_select_groups(false, $access, true, 'group', '', 'changeGroup();', '', 0, true, false, true, '', false, 'width:120px;') . '
' . '
'; +$table->data[0][1] = html_print_select_groups(false, $access, true, 'group', '', 'changeGroup();', '', 0, true, false, true, '', false, 'max-width:200px;') . '
' . '
'; $table->data[0][2] = __('Type'); $table->data[0][3] = html_print_checkbox('alert_fired', 'alert_fired', true, true, false, 'changeType();') . __('Alert fired') . '
' . @@ -276,6 +276,9 @@ $(document).ready (function () { setInterval("check_event()", (10 * 1000)); //10 seconds between ajax request $("#table1").css("background-color", "#fff"); $("#table2").css("background-color", "#fff"); + + group_width = $("#group").width(); + $("#id_agents").width(group_width + 9); }); From 99ad58666173d37eb41e4f0618791c6317e001dc Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Tue, 27 Jun 2017 11:35:48 +0200 Subject: [PATCH 34/81] Fixed field --- pandora_console/godmode/agentes/modificar_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 8dae33a036..4fa9725bf9 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -150,7 +150,7 @@ if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "AW")) $return_all_group = false; else $return_all_group = true; -html_print_select_groups(false, "AR", $return_all_group, "ag_group", $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false, 'width:100px;'); +html_print_select_groups(false, "AR", $return_all_group, "ag_group", $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false); echo ""; echo __('Show Agents') . ' '; From bd6088135d694164c453c0754e0541b72caea1fd Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 28 Jun 2017 00:01:14 +0200 Subject: [PATCH 35/81] 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.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index ff1e4b93ee..d6e7a74594 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.705-170627 +Version: 7.0NG.705-170628 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 45452f3c28..358b939461 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.705-170627" +pandora_version="7.0NG.705-170628" 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 6c4867ca3f..8bfdae1e82 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.705'; -use constant AGENT_BUILD => '170627'; +use constant AGENT_BUILD => '170628'; # 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 331b2bce33..e90258470c 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.705 -%define release 170627 +%define release 170628 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 8503cc7573..45ee90fa8d 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.705 -%define release 170627 +%define release 170628 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 8e865bc37b..d93f57c2cf 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.705" -PI_BUILD="170627" +PI_BUILD="170628" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2690bc6785..e07a1586f4 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170627} +{170628} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8dfd593b3e..0e1e5a2470 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.705(Build 170627)") +#define PANDORA_VERSION ("7.0NG.705(Build 170628)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 064226e8ec..56918b7dc1 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.705(Build 170627))" + VALUE "ProductVersion", "(7.0NG.705(Build 170628))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 694b102472..01f8dfa870 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.705-170627 +Version: 7.0NG.705-170628 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 e1886fbfa8..0a65b0763d 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.705-170627" +pandora_version="7.0NG.705-170628" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 839804dd06..dfa4233953 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC170627'; +$build_version = 'PC170628'; $pandora_version = 'v7.0NG.705'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 9d75442d5b..609e0283b9 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Wed, 28 Jun 2017 11:31:45 +0200 Subject: [PATCH 36/81] Use session and not exec sql if already exists acl perms in session - #1017 --- pandora_console/include/functions.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index b4e25c9eac..1ef37e74bc 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1796,6 +1796,26 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) { $id_group = (int) $id_group; } + if($_SESSION['check_acl'] != null){ + if (empty ($_SESSION['check_acl'])) + return 0; + + $result = 0; + $acl_column = get_acl_column($access); + foreach ($_SESSION['check_acl'] as $row) { + // For each profile for this pair of group and user do... + if (isset($row[$acl_column])) { + $result += $row[$acl_column]; + } + } + + if ($result >= 1) { + return 1; + } + + return 0; + } + $parents_id = array($id_group); if ($id_group != 0 && $onlyOneGroup !== true) { $group = db_get_row_filter('tgrupo', array('id_grupo' => $id_group)); @@ -1844,8 +1864,13 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) { OR tusuario_perfil.id_grupo = 0)", $id_user, implode(', ', $parents_id)); } + + + $rowdup = db_get_all_rows_sql ($query); + $_SESSION['check_acl'] = $rowdup; + if (empty ($rowdup)) return 0; From 4244e23737d9f22a62b65d98581faac53a3edd56 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 28 Jun 2017 16:20:20 +0200 Subject: [PATCH 37/81] Changed to disabled agents in planned downtime --- pandora_server/lib/PandoraFMS/Core.pm | 102 +++++++++++--------------- 1 file changed, 43 insertions(+), 59 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 9c311c9c5d..e60faa416a 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1619,40 +1619,34 @@ Start the planned downtime, the once type. sub pandora_planned_downtime_set_disabled_elements($$$) { my ($pa_config, $dbh, $downtime) = @_; - my @downtime_agents = get_db_rows($dbh, 'SELECT * - FROM tplanned_downtime_agents - WHERE id_downtime = ' . $downtime->{'id'}); - - foreach my $downtime_agent (@downtime_agents) { - my $only_alerts = 0; + my $only_alerts = 0; - if ($downtime->{'only_alerts'} == 0) { - if ($downtime->{'type_downtime'} eq 'disable_agents_alerts') { - $only_alerts = 1; - } + if ($downtime->{'only_alerts'} == 0) { + if ($downtime->{'type_downtime'} eq 'disable_agents_alerts') { + $only_alerts = 1; } + } - if ($only_alerts == 0) { - - if($pa_config->{'include_agents'} == 0){ - db_do($dbh, 'UPDATE tplanned_downtime_agents - SET manually_disabled = 1 WHERE id_agent IN (SELECT id_agente FROM tagente WHERE disabled = 1 AND id_agente = ?) - AND id_downtime = ' . $downtime->{'id'}, $downtime_agent->{'id_agent'}); - } - - db_do ($dbh, 'UPDATE tagente - SET disabled = 1 - WHERE id_agente = ?', $downtime_agent->{'id_agent'}); + if ($only_alerts == 0) { + db_do($dbh,'UPDATE tplanned_downtime_agents tp, tagente ta + SET tp.manually_disabled = ta.disabled + WHERE tp.id_agent = ta.id_agente AND tp.id_downtime = ?',$downtime->{'id'}); + + db_do($dbh,'UPDATE tagente ta, tplanned_downtime_agents tpa + SET ta.disabled = 1 WHERE tpa.id_agent = ta.id_agente AND + tpa.id_downtime = ?',$downtime->{'id'}); + + } else { + my @downtime_agents = get_db_rows($dbh, 'SELECT * + FROM tplanned_downtime_agents + WHERE id_downtime = ' . $downtime->{'id'}); + + foreach my $downtime_agent (@downtime_agents) { + db_do ($dbh, 'UPDATE talert_template_modules tat, tagente_modulo tam + SET tat.disabled = 1 + WHERE tat.id_agent_module = tam.id_agente_modulo + AND tam.id_agente = ?', $downtime_agent->{'id_agent'}); } - else { - db_do ($dbh, 'UPDATE talert_template_modules - SET disabled = 1 - WHERE id_agent_module IN ( - SELECT id_agente_modulo - FROM tagente_modulo - WHERE id_agente = ?)', $downtime_agent->{'id_agent'}); - } - } } @@ -1666,39 +1660,29 @@ Start the planned downtime, the once type. sub pandora_planned_downtime_unset_disabled_elements($$$) { my ($pa_config, $dbh, $downtime) = @_; - my @downtime_agents = get_db_rows($dbh, 'SELECT * - FROM tplanned_downtime_agents - WHERE id_downtime = ' . $downtime->{'id'}); - - foreach my $downtime_agent (@downtime_agents) { - my $only_alerts = 0; + my $only_alerts = 0; - if ($downtime->{'only_alerts'} == 0) { - if ($downtime->{'type_downtime'} eq 'disable_agents_alerts') { - $only_alerts = 1; - } + if ($downtime->{'only_alerts'} == 0) { + if ($downtime->{'type_downtime'} eq 'disable_agents_alerts') { + $only_alerts = 1; } + } - if ($only_alerts == 0) { - db_do ($dbh, 'UPDATE tagente - SET disabled = 0 - WHERE id_agente = ?', $downtime_agent->{'id_agent'}); - - if($pa_config->{'include_agents'} == 0){ - db_do ($dbh, 'UPDATE tagente - SET disabled = 1 - WHERE id_agente IN (SELECT id_agent FROM tplanned_downtime_agents WHERE manually_disabled = 1 and id_downtime = ?)',$downtime_agent->{'id_downtime'}); - } + if ($only_alerts == 0) { + db_do($dbh,'UPDATE tagente ta, tplanned_downtime_agents tpa + set ta.disabled = 0 WHERE tpa.id_agent = ta.id_agente AND + tpa.manually_disabled = 0 AND tpa.id_downtime = ?',$downtime->{'id'}); + } else { + my @downtime_agents = get_db_rows($dbh, 'SELECT * + FROM tplanned_downtime_agents + WHERE id_downtime = ' . $downtime->{'id'}); + + foreach my $downtime_agent (@downtime_agents) { + db_do ($dbh, 'UPDATE talert_template_modules tat, tagente_modulo tam + SET tat.disabled = 0 + WHERE tat.id_agent_module = tam.id_agente_modulo + AND tam.id_agente = ?', $downtime_agent->{'id_agent'}); } - else { - db_do ($dbh, 'UPDATE talert_template_modules - SET disabled = 0 - WHERE id_agent_module IN ( - SELECT id_agente_modulo - FROM tagente_modulo - WHERE id_agente = ?)', $downtime_agent->{'id_agent'}); - } - } } From 9348562ee495c220c3765ceaa1199faba34f7fd7 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Wed, 28 Jun 2017 16:20:57 +0200 Subject: [PATCH 38/81] Added good match to tags list --- pandora_console/include/functions_events.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index a259260b2a..01610e5338 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -3394,9 +3394,9 @@ function events_sql_events_grouped_agents($id_agent, $server_id = -1, $sql_post .= " AND (utimestamp <= " . $udate_to . ")"; } } - + //Search by tag - if (!empty($tag_with)) { + if (!empty($tag_with) && (io_safe_output($tag_with) != "[]") && (io_safe_output($tag_with) != "[\"0\"]")) { $sql_post .= ' AND ( '; $first = true; foreach ($tag_with as $id_tag) { @@ -3406,7 +3406,7 @@ function events_sql_events_grouped_agents($id_agent, $server_id = -1, } $sql_post .= ' ) '; } - if (!empty($tag_without)) { + if (!empty($tag_without) && (io_safe_output($tag_without) != "[]") && (io_safe_output($tag_with) != "[\"0\"]")) { $sql_post .= ' AND ( '; $first = true; foreach ($tag_without as $id_tag) { From 39d090db1ed59d359f315dc7b682ab0b3a581c3d Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 28 Jun 2017 16:39:54 +0200 Subject: [PATCH 39/81] fixed minor error --- pandora_console/general/login_page.php | 10 +++++----- pandora_console/include/ajax/events.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index b6098dda01..f0b0e687e7 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -72,7 +72,7 @@ echo '
'; echo '
'; echo '
'; - if (PANDORA_ENTERPRISE) { + if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) { if(isset ($config['custom_logo'])){ echo 'pandora_console'; } @@ -88,7 +88,7 @@ echo '
'; echo '
    '; echo '
  • docs pandora
  • '; echo '
  • ' . __('Docs') . '
  • '; - if (defined ('PANDORA_ENTERPRISE')) { + if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) { echo '
  • support pandora
  • '; } else { echo '
  • support pandora
  • '; @@ -234,7 +234,7 @@ echo '