diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index b7271da6b5..9e06ac94e2 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -91,7 +91,7 @@ $inventory_modules = array(); $date = null; // Only avg is selected by default for the simple graphs $only_avg = true; -$percentil_95 = false; +$percentil = false; $time_compare_overlapped = false; //Added for events items @@ -198,7 +198,7 @@ switch ($action) { case 'simple_graph': $only_avg = isset($style['only_avg']) ? (bool) $style['only_avg'] : true; - $percentil_95 = isset($style['percentil_95']) ? $style['percentil_95'] : 0; + $percentil = isset($style['percentil']) ? $config['percentil'] : 0; // The break hasn't be forgotten. case 'simple_baseline_graph': case 'projection_graph': @@ -1261,8 +1261,8 @@ You can of course remove the warnings, that's why we include the source and do n - - + + @@ -2531,7 +2531,7 @@ function chooseType() { case 'simple_graph': $("#row_time_compare_overlapped").show(); $("#row_only_avg").show(); - if ($("#checkbox-percentil_95").prop("checked")) + if ($("#checkbox-percentil").prop("checked")) $("#row_percentil").show(); // The break hasn't be forgotten, this element // only should be shown on the simple graphs. diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 07f908c559..4721e618ce 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1163,7 +1163,7 @@ switch ($action) { // Warning. We are using this column to hold this value to avoid // the modification of the database for compatibility reasons. $style['only_avg'] = (int) get_parameter('only_avg'); - $style['percentil_95'] = (int) get_parameter('percentil_95'); + $style['percentil'] = (int) get_parameter('percentil'); if ($label != '') $style['label'] = $label; else @@ -1493,7 +1493,7 @@ switch ($action) { // Warning. We are using this column to hold this value to avoid // the modification of the database for compatibility reasons. $style['only_avg'] = (int) get_parameter('only_avg'); - $style['percentil_95'] = (int) get_parameter('percentil_95'); + $style['percentil'] = (int) get_parameter('percentil'); if ($label != '') $style['label'] = $label; else diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index c81e94a7b2..91f08ab175 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -464,6 +464,11 @@ $table_chars->data[$row][1] .= __('No').' ' . html_print_radio_button ('only_average', 0, '', $config["only_average"], true); $row++; +$table_chars->data[$row][0] = __('Percentil'); +$table_chars->data[$row][0] .= ui_print_help_tip(__('Allows only show the average in graphs'), true); +$table_chars->data[$row][1] = html_print_input_text ('percentil', $config['percentil'], '', 20, 20, true); +$row++; + echo "
"; echo "" . __('Charts configuration') . ""; html_print_table ($table_chars); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 3f1ebd44f9..9282ad1c3c 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1596,8 +1596,6 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '', break; } - //html_debug_print($command_str); - exec($command_str, $output, $rc); // Parse the output of snmpwalk diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 3d6d90c0ea..277def1c08 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -532,6 +532,8 @@ function config_update_config () { if (!config_update_value ('click_display', (bool) get_parameter('click_display', false))) $error_update[] = __('Display lateral menus with left click'); //Daniel maya 02/06/2016 Display menu with click --END + if (!config_update_value ('percentil', (int) get_parameter('percentil', 0))) + $error_update[] = __('Default percentil'); //-------------------------------------------------- diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index de20f3be14..9291cacdba 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -484,7 +484,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i $avg = array_map(function($item) { return $item['sum'];}, $chart); $percentil_result = get_percentile($percentil, $avg); - + //Fill the data of chart array_walk($chart, function(&$item) use ($percentil_result, $series_suffix) { $item['percentil' . $series_suffix] = $percentil_result; }); @@ -766,9 +766,8 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, /*if ($baseline) { $legend['baseline'.$series_suffix] = __('Baseline'); }*/ - - $legend['no_data'.$series_suffix] = __('No data').$series_suffix_str; - $chart_extra_data['legend_no_data'] = $legend['no_data'.$series_suffix_str]; + //$legend['no_data'.$series_suffix] = __('No data').$series_suffix_str; + //$chart_extra_data['legend_no_data'] = $legend['no_data'.$series_suffix_str]; if ($show_unknown) { $legend['unknown'.$series_suffix] = __('Unknown').$series_suffix_str; diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 700f239546..d5beded9e6 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -5830,7 +5830,7 @@ function reporting_simple_graph($report, $content, $type = 'dinamic', true, true, 'white', - ($content['style']['percentil_95'] == 1) ? 95 : null); + ($content['style']['percentil'] == 1) ? $config['percentil'] : null); } break; case 'data': diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index da2569f316..b3fc71a68a 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -144,7 +144,7 @@ $interface_traffic_modules = array( $start_date = (string) get_parameter("start_date", date("Y-m-d")); $zoom = (int) get_parameter ("zoom", 1); $baseline = get_parameter ("baseline", 0); - $show_percentil_95 = get_parameter ("show_percentil_95", 0); + $show_percentil = get_parameter ("show_percentil", 0); if ($zoom > 1) { $height = $height * ($zoom / 2.1); @@ -187,7 +187,7 @@ $interface_traffic_modules = array( 1, false, false, - (($show_percentil_95)? 95 : null), + (($show_percentil)? $config['percentil'] : null), true); echo ''; @@ -236,8 +236,8 @@ $interface_traffic_modules = array( $table->rowclass[] = ''; $data = array(); - $data[0] = __('Show percentil 95º'); - $data[1] = html_print_checkbox ("show_percentil_95", 1, (bool) $show_percentil_95, true); + $data[0] = __('Show percentil'); + $data[1] = html_print_checkbox ("show_percentil", 1, (bool) $show_percentil, true); $table->data[] = $data; $table->rowclass[] =''; diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 39e7c21ec7..6e6fe8c972 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -159,7 +159,7 @@ $id = get_parameter('id'); $zoom = get_parameter ("zoom", 1); $baseline = get_parameter ("baseline", 0); $show_events_graph = get_parameter ("show_events_graph", 0); - $show_percentil_95 = get_parameter ("show_percentil_95", 0); + $show_percentil = get_parameter ("show_percentil", 0); $time_compare_separated = get_parameter ("time_compare_separated", 0); $time_compare_overlapped = get_parameter ("time_compare_overlapped", 0); $unknown_graph = get_parameter_checkbox ("unknown_graph", 1); @@ -221,7 +221,7 @@ $id = get_parameter('id'); false, $urlImage, 1, false, 'adapter_' . $graph_type, $time_compare, $unknown_graph, true, 'white', - (($show_percentil_95)? 95 : null)); + (($show_percentil)? $config['percentil'] : null)); echo '
'; if ($show_events_graph) echo graphic_module_events($id, $width, $height, @@ -369,8 +369,8 @@ $id = get_parameter('id'); case 'boolean': case 'sparse': $data = array(); - $data[0] = __('Show percentil 95º'); - $data[1] = html_print_checkbox ("show_percentil_95", 1, (bool) $show_percentil_95, true); + $data[0] = __('Show percentil'); + $data[1] = html_print_checkbox ("show_percentil", 1, (bool) $show_percentil, true); $table->data[] = $data; $table->rowclass[] ='';