From 9337d33ceba8b001cd1b3499dd9c383f0f72a266 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 21 Sep 2017 15:35:28 +0200 Subject: [PATCH] tip in graph interfaces --- .../include/functions_custom_graphs.php | 5 +- pandora_console/include/functions_graph.php | 1475 +++++++++-------- .../agentes/interface_traffic_graph_win.php | 11 +- 3 files changed, 779 insertions(+), 712 deletions(-) diff --git a/pandora_console/include/functions_custom_graphs.php b/pandora_console/include/functions_custom_graphs.php index 499a8a817f..adf077ec6a 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,$id_widget_dashboard=false) { + $dashboard = false, $vconsole = false, $percentil = null, $from_interface = false,$id_widget_dashboard=false, $fullscale = false) { global $config; @@ -261,7 +261,8 @@ function custom_graphs_print($id_graph, $height, $width, $period, $vconsole, $percentil, $from_interface, - $id_widget_dashboard); + $id_widget_dashboard, + $fullscale); if ($return) return $output; diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 050816b17e..0bc6717986 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1055,488 +1055,521 @@ 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, $id_widget_dashboard=false) { + $vconsole = false, $percentil = null, $from_interface = false, + $id_widget_dashboard=false, $fullscale = false) { global $config; global $graphic_type; + + if(!$fullscale){ + $time_format_2 = ''; + $temp_range = $period; - $time_format_2 = ''; - $temp_range = $period; - - if ($projection != false) { - if ($period < $prediction_period) - $temp_range = $prediction_period; - } - - // Set the title and time format - if ($temp_range <= SECONDS_1DAY) { - $time_format = 'Y M d H:i:s'; - } - elseif ($temp_range < SECONDS_15DAYS) { - $time_format = 'Y M d'; - $time_format_2 = 'H:i'; if ($projection != false) { + if ($period < $prediction_period) + $temp_range = $prediction_period; + } + + // Set the title and time format + if ($temp_range <= SECONDS_1DAY) { + $time_format = 'Y M d H:i:s'; + } + elseif ($temp_range < SECONDS_15DAYS) { + $time_format = 'Y M d'; + $time_format_2 = 'H:i'; + if ($projection != false) { + $time_format_2 = 'H\h'; + } + } + elseif ($temp_range <= SECONDS_1MONTH) { + $time_format = 'Y M d'; $time_format_2 = 'H\h'; } - } - elseif ($temp_range <= SECONDS_1MONTH) { - $time_format = 'Y M d'; - $time_format_2 = 'H\h'; - } - elseif ($temp_range <= SECONDS_1MONTH) { - $time_format = 'Y M d'; - $time_format_2 = 'H\h'; - } - elseif ($period < SECONDS_6MONTHS) { - $time_format = 'Y M d'; - $time_format_2 = 'H\h'; - } - else { - $time_format = "Y M d"; - $time_format_2 = 'H\h'; - } - - // Set variables - if ($date == 0) - $date = get_system_time(); - $datelimit = $date - $period; - - $resolution = $config['graph_res'] * 50; //Number of points of the graph - $interval = (int) ($period / $resolution); - - // If projection graph, fill with zero previous data to projection interval - if ($projection != false) { - $j = $datelimit; - $in_range = true; - while ($in_range) { - $timestamp_f = graph_get_formatted_date($j, $time_format, $time_format_2); - - $before_projection[$timestamp_f] = 0; - - if ($j > $date) { - $in_range = false; - } - $j = $j + $interval; + elseif ($temp_range <= SECONDS_1MONTH) { + $time_format = 'Y M d'; + $time_format_2 = 'H\h'; } - } - - // Added support for projection graphs (normal_module + 1(prediction data)) - if ($projection !== false) { - $module_number = count ($module_list) + 1; - } - else { - $module_number = count ($module_list); - } - - $names_number = count($name_list); - $units_number = count($unit_list); - - // interval - This is the number of "rows" we are divided the time to fill data. - // more interval, more resolution, and slower. - // periodo - Gap of time, in seconds. This is now to (now-periodo) secs - - // Init weights - for ($i = 0; $i < $module_number; $i++) { - if (! isset ($weight_list[$i])) { - $weight_list[$i] = 1; - } - else if ($weight_list[$i] == 0) { - $weight_list[$i] = 1; - } - } - - // Set data containers - for ($i = 0; $i < $resolution; $i++) { - $timestamp = $datelimit + ($interval * $i);/* - $timestamp_short = date($time_format, $timestamp); - $long_index[$timestamp_short] = date( - html_entity_decode($config['date_format'], ENT_QUOTES, "UTF-8"), $timestamp); - $timestamp = $timestamp_short;*/ - - $graph[$timestamp]['count'] = 0; - $graph[$timestamp]['timestamp_bottom'] = $timestamp; - $graph[$timestamp]['timestamp_top'] = $timestamp + $interval; - $graph[$timestamp]['min'] = 0; - $graph[$timestamp]['max'] = 0; - $graph[$timestamp]['event'] = 0; - $graph[$timestamp]['alert'] = 0; - } - - $long_index = array(); - - $graph_values = array(); - $module_name_list = array(); - $collector = 0; - $user = users_get_user_by_id($config['id_user']); - $user_flash_charts = $user['flash_chart']; - - if ($user_flash_charts == 1) - $flash_charts = true; - elseif($user_flash_charts == -1) - $flash_charts = $config['flash_charts']; - elseif($user_flash_charts == 0) - $flash_charts = false; - - if ($only_image) { - $flash_charts = false; - } - - // Calculate data for each module - for ($i = 0; $i < $module_number; $i++) { - $automatic_custom_graph_meta = false; - if ($config['metaconsole']) { - // Automatic custom graph from the report template in metaconsole - if (is_array($module_list[$i])) { - $server = metaconsole_get_connection_by_id ($module_list[$i]['server']); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } - } - - $search_in_history_db = db_search_in_history_db($datelimit); - - // If its a projection graph, - // first module will be data and second will be the projection - if ($projection != false && $i != 0) { - if ($automatic_custom_graph_meta) - $agent_module_id = $module_list[0]['module']; - else - $agent_module_id = $module_list[0]; - - $id_module_type = modules_get_agentmodule_type ($agent_module_id); - $module_type = modules_get_moduletype_name ($id_module_type); - $uncompressed_module = is_module_uncompressed ($module_type); + elseif ($period < SECONDS_6MONTHS) { + $time_format = 'Y M d'; + $time_format_2 = 'H\h'; } else { - if ($automatic_custom_graph_meta) - $agent_module_id = $module_list[$i]['module']; - else - $agent_module_id = $module_list[$i]; - - - $id_module_type = modules_get_agentmodule_type ($agent_module_id); - $module_type = modules_get_moduletype_name ($id_module_type); - $uncompressed_module = is_module_uncompressed ($module_type); + $time_format = "Y M d"; + $time_format_2 = 'H\h'; } - if ($uncompressed_module) { - $avg_only = 1; + // Set variables + if ($date == 0) + $date = get_system_time(); + $datelimit = $date - $period; + + $resolution = $config['graph_res'] * 50; //Number of points of the graph + $interval = (int) ($period / $resolution); + + // If projection graph, fill with zero previous data to projection interval + if ($projection != false) { + $j = $datelimit; + $in_range = true; + while ($in_range) { + $timestamp_f = graph_get_formatted_date($j, $time_format, $time_format_2); + + $before_projection[$timestamp_f] = 0; + + if ($j > $date) { + $in_range = false; + } + $j = $j + $interval; + } } - // Get event data (contains alert data too) - if ($show_events == 1 || $show_alerts == 1) { - $events = db_get_all_rows_filter ('tevento', - array ('id_agentmodule' => $agent_module_id, + // Added support for projection graphs (normal_module + 1(prediction data)) + if ($projection !== false) { + $module_number = count ($module_list) + 1; + } + else { + $module_number = count ($module_list); + } + + $names_number = count($name_list); + $units_number = count($unit_list); + + // interval - This is the number of "rows" we are divided the time to fill data. + // more interval, more resolution, and slower. + // periodo - Gap of time, in seconds. This is now to (now-periodo) secs + + // Init weights + for ($i = 0; $i < $module_number; $i++) { + if (! isset ($weight_list[$i])) { + $weight_list[$i] = 1; + } + else if ($weight_list[$i] == 0) { + $weight_list[$i] = 1; + } + } + + // Set data containers + for ($i = 0; $i < $resolution; $i++) { + $timestamp = $datelimit + ($interval * $i);/* + $timestamp_short = date($time_format, $timestamp); + $long_index[$timestamp_short] = date( + html_entity_decode($config['date_format'], ENT_QUOTES, "UTF-8"), $timestamp); + $timestamp = $timestamp_short;*/ + + $graph[$timestamp]['count'] = 0; + $graph[$timestamp]['timestamp_bottom'] = $timestamp; + $graph[$timestamp]['timestamp_top'] = $timestamp + $interval; + $graph[$timestamp]['min'] = 0; + $graph[$timestamp]['max'] = 0; + $graph[$timestamp]['event'] = 0; + $graph[$timestamp]['alert'] = 0; + } + $long_index = array(); + + $graph_values = array(); + $module_name_list = array(); + $collector = 0; + $user = users_get_user_by_id($config['id_user']); + $user_flash_charts = $user['flash_chart']; + + if ($user_flash_charts == 1) + $flash_charts = true; + elseif($user_flash_charts == -1) + $flash_charts = $config['flash_charts']; + elseif($user_flash_charts == 0) + $flash_charts = false; + + if ($only_image) { + $flash_charts = false; + } + + // Calculate data for each module + for ($i = 0; $i < $module_number; $i++) { + $automatic_custom_graph_meta = false; + if ($config['metaconsole']) { + // Automatic custom graph from the report template in metaconsole + if (is_array($module_list[$i])) { + $server = metaconsole_get_connection_by_id ($module_list[$i]['server']); + metaconsole_connect($server); + $automatic_custom_graph_meta = true; + } + } + + $search_in_history_db = db_search_in_history_db($datelimit); + + // If its a projection graph, + // first module will be data and second will be the projection + if ($projection != false && $i != 0) { + if ($automatic_custom_graph_meta) + $agent_module_id = $module_list[0]['module']; + else + $agent_module_id = $module_list[0]; + + $id_module_type = modules_get_agentmodule_type ($agent_module_id); + $module_type = modules_get_moduletype_name ($id_module_type); + $uncompressed_module = is_module_uncompressed ($module_type); + } + else { + if ($automatic_custom_graph_meta) + $agent_module_id = $module_list[$i]['module']; + else + $agent_module_id = $module_list[$i]; + + + $id_module_type = modules_get_agentmodule_type ($agent_module_id); + $module_type = modules_get_moduletype_name ($id_module_type); + $uncompressed_module = is_module_uncompressed ($module_type); + } + + if ($uncompressed_module) { + $avg_only = 1; + } + + // Get event data (contains alert data too) + if ($show_events == 1 || $show_alerts == 1) { + $events = db_get_all_rows_filter ('tevento', + array ('id_agentmodule' => $agent_module_id, + "utimestamp > $datelimit", + "utimestamp < $date", + 'order' => 'utimestamp ASC'), + array ('evento', 'utimestamp', 'event_type')); + if ($events === false) { + $events = array (); + } + } + + // Get module data + $data = db_get_all_rows_filter ('tagente_datos', + array ('id_agente_modulo' => $agent_module_id, "utimestamp > $datelimit", "utimestamp < $date", 'order' => 'utimestamp ASC'), - array ('evento', 'utimestamp', 'event_type')); - if ($events === false) { - $events = array (); - } - } - - // Get module data - $data = db_get_all_rows_filter ('tagente_datos', - array ('id_agente_modulo' => $agent_module_id, - "utimestamp > $datelimit", - "utimestamp < $date", - 'order' => 'utimestamp ASC'), - array ('datos', 'utimestamp'), 'AND', $search_in_history_db); - if ($data === false) { - $data = array (); - } - - // Uncompressed module data - if ($uncompressed_module) { - $min_necessary = 1; - - // Compressed module data - } - else { - // Get previous data - $previous_data = modules_get_previous_data ($agent_module_id, $datelimit); - if ($previous_data !== false) { - $previous_data['utimestamp'] = $datelimit; - array_unshift ($data, $previous_data); - } + array ('datos', 'utimestamp'), 'AND', $search_in_history_db); - // Get next data - $nextData = modules_get_next_data ($agent_module_id, $date); - if ($nextData !== false) { - array_push ($data, $nextData); - } - else if (count ($data) > 0) { - // Propagate the last known data to the end of the interval - $nextData = array_pop ($data); - array_push ($data, $nextData); - $nextData['utimestamp'] = $date; - array_push ($data, $nextData); + if ($data === false) { + $data = array (); } + + // Uncompressed module data + if ($uncompressed_module) { + $min_necessary = 1; - $min_necessary = 2; - } - - // Set initial conditions - $graph_values[$i] = array(); - - // Check available data - if (count ($data) < $min_necessary) { - continue; - } - - if (!empty($name_list) && $names_number == $module_number && isset($name_list[$i])) { - if ($labels[$agent_module_id] != '') - $module_name_list[$i] = $labels[$agent_module_id]; + // Compressed module data + } else { + // Get previous data + $previous_data = modules_get_previous_data ($agent_module_id, $datelimit); + if ($previous_data !== false) { + $previous_data['utimestamp'] = $datelimit; + array_unshift ($data, $previous_data); + } + + // Get next data + $nextData = modules_get_next_data ($agent_module_id, $date); + if ($nextData !== false) { + array_push ($data, $nextData); + } + else if (count ($data) > 0) { + // Propagate the last known data to the end of the interval + $nextData = array_pop ($data); + array_push ($data, $nextData); + $nextData['utimestamp'] = $date; + array_push ($data, $nextData); + } + + $min_necessary = 2; + } + + // Set initial conditions + $graph_values[$i] = array(); + + // Check available data + if (count ($data) < $min_necessary) { + continue; + } + + if (!empty($name_list) && $names_number == $module_number && isset($name_list[$i])) { + if ($labels[$agent_module_id] != '') + $module_name_list[$i] = $labels[$agent_module_id]; + else { + $agent_name = io_safe_output( + modules_get_agentmodule_agent_name ($agent_module_id)); + $alias = db_get_value ("alias","tagente","nombre",$agent_name); + $module_name = io_safe_output( + modules_get_agentmodule_name ($agent_module_id)); + + if ($flash_charts) + $module_name_list[$i] = '' . $alias . " / " . $module_name. ''; + else + $module_name_list[$i] = $alias . " / " . $module_name; + } + } + else { + //Get and process agent name $agent_name = io_safe_output( modules_get_agentmodule_agent_name ($agent_module_id)); $alias = db_get_value ("alias","tagente","nombre",$agent_name); + $agent_name = ui_print_truncate_text($agent_name, 'agent_small', false, true, false, '...', false); + + $agent_id = agents_get_agent_id ($agent_name); + + //Get and process module name $module_name = io_safe_output( modules_get_agentmodule_name ($agent_module_id)); + $module_name = sprintf(__("%s"), $module_name); + $module_name = ui_print_truncate_text($module_name, 'module_small', false, true, false, '...', false); - if ($flash_charts) - $module_name_list[$i] = '' . $alias . " / " . $module_name. ''; - else - $module_name_list[$i] = $alias . " / " . $module_name; - } - } - else { - //Get and process agent name - $agent_name = io_safe_output( - modules_get_agentmodule_agent_name ($agent_module_id)); - $alias = db_get_value ("alias","tagente","nombre",$agent_name); - $agent_name = ui_print_truncate_text($agent_name, 'agent_small', false, true, false, '...', false); - - $agent_id = agents_get_agent_id ($agent_name); - - //Get and process module name - $module_name = io_safe_output( - modules_get_agentmodule_name ($agent_module_id)); - $module_name = sprintf(__("%s"), $module_name); - $module_name = ui_print_truncate_text($module_name, 'module_small', false, true, false, '...', false); - - if ($flash_charts) { - if ($labels[$agent_module_id] != '') - $module_name_list[$i] = '' . - $labels[$agent_module_id] . ''; - else - $module_name_list[$i] = '' . - $alias . ' / ' . $module_name . ''; - } - else { - if ($labels[$agent_module_id] != '') - $module_name_list[$i] = $labels[$agent_module_id]; - else - $module_name_list[$i] = $alias . ' / ' . $module_name; - } - } - - // Data iterator - $j = 0; - - // Event iterator - $k = 0; - - // Set initial conditions - - //$graph_values[$i] = array(); - $temp_graph_values = array(); - - if ($data[0]['utimestamp'] == $datelimit) { - $previous_data = $data[0]['datos']; - $j++; - } - else { - $previous_data = 0; - } - - $max = 0; - $min = null; - $avg = 0; - $countAvg = 0; - - // Calculate chart data - $last_known = $previous_data; - - for ($l = 0; $l <= $resolution; $l++) { - $countAvg ++; - - $timestamp = $datelimit + ($interval * $l); - $timestamp_short = graph_get_formatted_date($timestamp, $time_format, $time_format_2); - - $long_index[$timestamp_short] = date( - html_entity_decode($config['date_format'], ENT_QUOTES, "UTF-8"), $timestamp); - //$timestamp = $timestamp_short; - - $total = 0; - $count = 0; - - // Read data that falls in the current interval - $interval_min = $last_known; - $interval_max = $last_known; - - while (isset ($data[$j]) && $data[$j]['utimestamp'] >= $timestamp && $data[$j]['utimestamp'] < ($timestamp + $interval)) { - if ($data[$j]['datos'] > $interval_max) { - $interval_max = $data[$j]['datos']; - } - else if ($data[$j]['datos'] < $interval_max) { - $interval_min = $data[$j]['datos']; - } - $total += $data[$j]['datos']; - $last_known = $data[$j]['datos']; - $count++; - $j++; - } - - // Average - if ($count > 0) { - $total /= $count; - } - - // Read events and alerts that fall in the current interval - $event_value = 0; - $alert_value = 0; - while (isset ($events[$k]) && $events[$k]['utimestamp'] >= $timestamp && $events[$k]['utimestamp'] <= ($timestamp + $interval)) { - if ($show_events == 1) { - $event_value++; - } - if ($show_alerts == 1 && substr ($events[$k]['event_type'], 0, 5) == 'alert') { - $alert_value++; - } - $k++; - } - - // Data - if ($count > 0) { - //$graph_values[$i][$timestamp] = $total * $weight_list[$i]; - $temp_graph_values[$timestamp_short] = $total * $weight_list[$i]; - } - else { - // Compressed data - if ($uncompressed_module || ($timestamp > time ())) { - $temp_graph_values[$timestamp_short] = 0; + if ($flash_charts) { + if ($labels[$agent_module_id] != '') + $module_name_list[$i] = '' . + $labels[$agent_module_id] . ''; + else + $module_name_list[$i] = '' . + $alias . ' / ' . $module_name . ''; } else { - $temp_graph_values[$timestamp_short] = $last_known * $weight_list[$i]; + if ($labels[$agent_module_id] != '') + $module_name_list[$i] = $labels[$agent_module_id]; + else + $module_name_list[$i] = $alias . ' / ' . $module_name; } } - //Extract max, min, avg - if ($max < $temp_graph_values[$timestamp_short]) { - $max = $temp_graph_values[$timestamp_short]; + // Data iterator + $j = 0; + + // Event iterator + $k = 0; + + // Set initial conditions + + //$graph_values[$i] = array(); + $temp_graph_values = array(); + + if ($data[0]['utimestamp'] == $datelimit) { + $previous_data = $data[0]['datos']; + $j++; + } + else { + $previous_data = 0; } - if (isset($min)) { - if ($min > $temp_graph_values[$timestamp_short]) { + $max = 0; + $min = null; + $avg = 0; + $countAvg = 0; + + // Calculate chart data + $last_known = $previous_data; + for ($l = 0; $l <= $resolution; $l++) { + $countAvg ++; + + $timestamp = $datelimit + ($interval * $l); + $timestamp_short = graph_get_formatted_date($timestamp, $time_format, $time_format_2); + + $long_index[$timestamp_short] = date( + html_entity_decode($config['date_format'], ENT_QUOTES, "UTF-8"), $timestamp); + //$timestamp = $timestamp_short; + + $total = 0; + $count = 0; + + // Read data that falls in the current interval + $interval_min = $last_known; + $interval_max = $last_known; + + while (isset ($data[$j]) && $data[$j]['utimestamp'] >= $timestamp && $data[$j]['utimestamp'] < ($timestamp + $interval)) { + if ($data[$j]['datos'] > $interval_max) { + $interval_max = $data[$j]['datos']; + } + else if ($data[$j]['datos'] < $interval_max) { + $interval_min = $data[$j]['datos']; + } + $total += $data[$j]['datos']; + $last_known = $data[$j]['datos']; + $count++; + $j++; + } + + // Average + if ($count > 0) { + $total /= $count; + } + + // Read events and alerts that fall in the current interval + $event_value = 0; + $alert_value = 0; + while (isset ($events[$k]) && $events[$k]['utimestamp'] >= $timestamp && $events[$k]['utimestamp'] <= ($timestamp + $interval)) { + if ($show_events == 1) { + $event_value++; + } + if ($show_alerts == 1 && substr ($events[$k]['event_type'], 0, 5) == 'alert') { + $alert_value++; + } + $k++; + } + + // Data + if ($count > 0) { + //$graph_values[$i][$timestamp] = $total * $weight_list[$i]; + $temp_graph_values[$timestamp_short] = $total * $weight_list[$i]; + } + else { + // Compressed data + if ($uncompressed_module || ($timestamp > time ())) { + $temp_graph_values[$timestamp_short] = 0; + } + else { + $temp_graph_values[$timestamp_short] = $last_known * $weight_list[$i]; + } + } + + //Extract max, min, avg + if ($max < $temp_graph_values[$timestamp_short]) { + $max = $temp_graph_values[$timestamp_short]; + } + + if (isset($min)) { + if ($min > $temp_graph_values[$timestamp_short]) { + $min = $temp_graph_values[$timestamp_short]; + } + } + else { $min = $temp_graph_values[$timestamp_short]; } + $avg += $temp_graph_values[$timestamp_short]; + + // Added to support projection graphs + if ($projection != false and $i != 0) { + $projection_data = array(); + $projection_data = array_merge($before_projection, $projection); + $graph_values[$i] = $projection_data; + } + else { + $graph_values[$i] = $temp_graph_values; + } + } + + //Add the max, min and avg in the legend + $avg = round($avg / $countAvg, 1); + + $graph_stats = get_graph_statistics($graph_values[$i]); + + if (!isset($config["short_module_graph_data"])) + $config["short_module_graph_data"] = true; + + if ($config["short_module_graph_data"]) { + $min = $graph_stats['min']; + $max = $graph_stats['max']; + $avg = $graph_stats['avg']; + $last = $graph_stats['last']; + + if ($min > 1000000) + $min = sprintf("%sM", remove_right_zeros(number_format($min / 1000000, remove_right_zeros))); + else if ($min > 1000) + $min = sprintf("%sK", remove_right_zeros(number_format($min / 1000, $config['graph_precision']))); + + if ($max > 1000000) + $max = sprintf("%sM", remove_right_zeros(number_format($max / 1000000, $config['graph_precision']))); + else if ($max > 1000) + $max = sprintf("%sK", remove_right_zeros(number_format($max / 1000, $config['graph_precision']))); + + if ($avg > 1000000) + $avg = sprintf("%sM", remove_right_zeros(number_format($avg / 1000000, $config['graph_precision']))); + else if ($avg > 1000) + $avg = sprintf("%sK", remove_right_zeros(number_format($avg / 1000, $config['graph_precision']))); + + if ($last > 1000000) + $last = sprintf("%sM", remove_right_zeros(number_format($last / 1000000, $config['graph_precision']))); + else if ($last > 1000) + $last = sprintf("%sK", remove_right_zeros(number_format($last / 1000, $config['graph_precision']))); } else { - $min = $temp_graph_values[$timestamp_short]; + $min = remove_right_zeros(number_format($graph_stats['min'], $config['graph_precision'])); + $max = remove_right_zeros(number_format($graph_stats['max'], $config['graph_precision'])); + $avg = remove_right_zeros(number_format($graph_stats['avg'], $config['graph_precision'])); + $last = remove_right_zeros(number_format($graph_stats['last'], $config['graph_precision'])); } - $avg += $temp_graph_values[$timestamp_short]; - // Added to support projection graphs - if ($projection != false and $i != 0) { - $projection_data = array(); - $projection_data = array_merge($before_projection, $projection); - $graph_values[$i] = $projection_data; + + if (!empty($unit_list) && $units_number == $module_number && isset($unit_list[$i])) { + $unit = $unit_list[$i]; } - else { - $graph_values[$i] = $temp_graph_values; + + if ($projection == false or ($projection != false and $i == 0)) { + $module_name_list[$i] .= ": "; + if ($show_max) + $module_name_list[$i] .= __("Max") . ": $max $unit; "; + if ($show_min) + $module_name_list[$i] .= __("Min") . ": $min $unit; "; + if ($show_avg) + $module_name_list[$i] .= __("Avg") . ": $avg $unit"; + } + + if ($weight_list[$i] != 1) { + //$module_name_list[$i] .= " (x". format_numeric ($weight_list[$i], 1).")"; + $module_name_list[$i] .= " (x". format_numeric ($weight_list[$i], 1).")"; + } + + //$graph_values[$module_name_list[$i]] = $graph_values[$i]; + //unset($graph_values[$i]); + + //$graph_values[$i] = $graph_values[$i]; + + if ($config['metaconsole']) { + // Automatic custom graph from the report template in metaconsole + if (is_array($module_list[0])) { + metaconsole_restore_db(); + } } } - //Add the max, min and avg in the legend - $avg = round($avg / $countAvg, 1); + $temp = array(); - $graph_stats = get_graph_statistics($graph_values[$i]); + if ($flash_charts === false && $stacked == CUSTOM_GRAPH_GAUGE) + $stacked = CUSTOM_GRAPH_BULLET_CHART; - if (!isset($config["short_module_graph_data"])) - $config["short_module_graph_data"] = true; - - if ($config["short_module_graph_data"]) { - $min = $graph_stats['min']; - $max = $graph_stats['max']; - $avg = $graph_stats['avg']; - $last = $graph_stats['last']; - - if ($min > 1000000) - $min = sprintf("%sM", remove_right_zeros(number_format($min / 1000000, remove_right_zeros))); - else if ($min > 1000) - $min = sprintf("%sK", remove_right_zeros(number_format($min / 1000, $config['graph_precision']))); - - if ($max > 1000000) - $max = sprintf("%sM", remove_right_zeros(number_format($max / 1000000, $config['graph_precision']))); - else if ($max > 1000) - $max = sprintf("%sK", remove_right_zeros(number_format($max / 1000, $config['graph_precision']))); - - if ($avg > 1000000) - $avg = sprintf("%sM", remove_right_zeros(number_format($avg / 1000000, $config['graph_precision']))); - else if ($avg > 1000) - $avg = sprintf("%sK", remove_right_zeros(number_format($avg / 1000, $config['graph_precision']))); - - if ($last > 1000000) - $last = sprintf("%sM", remove_right_zeros(number_format($last / 1000000, $config['graph_precision']))); - else if ($last > 1000) - $last = sprintf("%sK", remove_right_zeros(number_format($last / 1000, $config['graph_precision']))); - } - else { - $min = remove_right_zeros(number_format($graph_stats['min'], $config['graph_precision'])); - $max = remove_right_zeros(number_format($graph_stats['max'], $config['graph_precision'])); - $avg = remove_right_zeros(number_format($graph_stats['avg'], $config['graph_precision'])); - $last = remove_right_zeros(number_format($graph_stats['last'], $config['graph_precision'])); - } - - - if (!empty($unit_list) && $units_number == $module_number && isset($unit_list[$i])) { - $unit = $unit_list[$i]; - } - - if ($projection == false or ($projection != false and $i == 0)) { - $module_name_list[$i] .= ": "; - if ($show_max) - $module_name_list[$i] .= __("Max") . ": $max $unit; "; - if ($show_min) - $module_name_list[$i] .= __("Min") . ": $min $unit; "; - if ($show_avg) - $module_name_list[$i] .= __("Avg") . ": $avg $unit"; - } - - if ($weight_list[$i] != 1) { - //$module_name_list[$i] .= " (x". format_numeric ($weight_list[$i], 1).")"; - $module_name_list[$i] .= " (x". format_numeric ($weight_list[$i], 1).")"; - } - - //$graph_values[$module_name_list[$i]] = $graph_values[$i]; - //unset($graph_values[$i]); - - //$graph_values[$i] = $graph_values[$i]; - - if ($config['metaconsole']) { - // Automatic custom graph from the report template in metaconsole - if (is_array($module_list[0])) { - metaconsole_restore_db(); - } - } - } - - $temp = array(); - - if ($flash_charts === false && $stacked == CUSTOM_GRAPH_GAUGE) - $stacked = CUSTOM_GRAPH_BULLET_CHART; - - switch ($stacked) { - case CUSTOM_GRAPH_BULLET_CHART_THRESHOLD: - case CUSTOM_GRAPH_BULLET_CHART: - $datelimit = $date - $period; - if($stacked == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD){ - $acumulador = 0; + switch ($stacked) { + case CUSTOM_GRAPH_BULLET_CHART_THRESHOLD: + case CUSTOM_GRAPH_BULLET_CHART: + $datelimit = $date - $period; + if($stacked == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD){ + $acumulador = 0; + foreach ($module_list as $module_item) { + $module = $module_item; + $query_last_value = sprintf(' + SELECT datos + FROM tagente_datos + WHERE id_agente_modulo = %d + AND utimestamp < %d + ORDER BY utimestamp DESC', + $module, $date); + $temp_data = db_get_value_sql($query_last_value); + if ($acumulador < $temp_data){ + $acumulador = $temp_data; + } + } + } foreach ($module_list as $module_item) { - $module = $module_item; + $automatic_custom_graph_meta = false; + if ($config['metaconsole']) { + // Automatic custom graph from the report template in metaconsole + if (is_array($module_list[$i])) { + $server = metaconsole_get_connection_by_id ($module_item['server']); + metaconsole_connect($server); + $automatic_custom_graph_meta = true; + } + } + + if ($automatic_custom_graph_meta) + $module = $module_item['module']; + else + $module = $module_item; + + $search_in_history_db = db_search_in_history_db($datelimit); + + $temp[$module] = modules_get_agentmodule($module); $query_last_value = sprintf(' SELECT datos FROM tagente_datos @@ -1545,291 +1578,281 @@ function graphic_combined_module ($module_list, $weight_list, $period, ORDER BY utimestamp DESC', $module, $date); $temp_data = db_get_value_sql($query_last_value); - if ($acumulador < $temp_data){ - $acumulador = $temp_data; + + if ($temp_data) { + if (is_numeric($temp_data)) + $value = $temp_data; + else + $value = count($value); } - } - } - foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; - if ($config['metaconsole']) { - // Automatic custom graph from the report template in metaconsole - if (is_array($module_list[$i])) { - $server = metaconsole_get_connection_by_id ($module_item['server']); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; + else { + if ($flash_charts === false) + $value = 0; + else + $value = false; } - } - - if ($automatic_custom_graph_meta) - $module = $module_item['module']; - else - $module = $module_item; - - $search_in_history_db = db_search_in_history_db($datelimit); - - $temp[$module] = modules_get_agentmodule($module); - $query_last_value = sprintf(' - SELECT datos - FROM tagente_datos - WHERE id_agente_modulo = %d - AND utimestamp < %d - ORDER BY utimestamp DESC', - $module, $date); - $temp_data = db_get_value_sql($query_last_value); - - if ($temp_data) { - if (is_numeric($temp_data)) - $value = $temp_data; - else - $value = count($value); - } - else { - if ($flash_charts === false) - $value = 0; - else - $value = false; - } - - if ( !empty($labels) && isset($labels[$module]) ){ - $label = io_safe_input($labels[$module]); - }else{ - $alias = db_get_value ("alias","tagente","id_agente",$temp[$module]['id_agente']); - $label = $alias . ': ' . $temp[$module]['nombre']; - } - - $temp[$module]['label'] = $label; - $temp[$module]['value'] = $value; - $temp_max = reporting_get_agentmodule_data_max($module,$period,$date); - if ($temp_max < 0) - $temp_max = 0; - if (isset($acumulador)){ - $temp[$module]['max'] = $acumulador; - }else{ - $temp[$module]['max'] = ($temp_max === false) ? 0 : $temp_max; - } + if ( !empty($labels) && isset($labels[$module]) ){ + $label = io_safe_input($labels[$module]); + }else{ + $alias = db_get_value ("alias","tagente","id_agente",$temp[$module]['id_agente']); + $label = $alias . ': ' . $temp[$module]['nombre']; + } + + + $temp[$module]['label'] = $label; + $temp[$module]['value'] = $value; + $temp_max = reporting_get_agentmodule_data_max($module,$period,$date); + if ($temp_max < 0) + $temp_max = 0; + if (isset($acumulador)){ + $temp[$module]['max'] = $acumulador; + }else{ + $temp[$module]['max'] = ($temp_max === false) ? 0 : $temp_max; + } - $temp_min = reporting_get_agentmodule_data_min($module,$period,$date); - if ($temp_min < 0) - $temp_min = 0; - $temp[$module]['min'] = ($temp_min === false) ? 0 : $temp_min; - - if ($config['metaconsole']) { - // Automatic custom graph from the report template in metaconsole - if (is_array($module_list[0])) { - metaconsole_restore_db(); - } - } - - } - - break; - case CUSTOM_GRAPH_HBARS: - case CUSTOM_GRAPH_VBARS: - $datelimit = $date - $period; - - $label = ''; - foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; - if ($config['metaconsole']) { - // Automatic custom graph from the report template in metaconsole - if (is_array($module_list[$i])) { - $server = metaconsole_get_connection_by_id ($module_item['server']); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } - } - - if ($automatic_custom_graph_meta) - $module = $module_item['module']; - else - $module = $module_item; - - - $module_data = modules_get_agentmodule($module); - $query_last_value = sprintf(' - SELECT datos - FROM tagente_datos - WHERE id_agente_modulo = %d - AND utimestamp < %d - ORDER BY utimestamp DESC', - $module, $date); - $temp_data = db_get_value_sql($query_last_value); - - $agent_name = io_safe_output( - modules_get_agentmodule_agent_name ($module)); - - if (!empty($labels) && isset($labels[$module]) ){ - $label = $labels[$module]; - }else { - $alias = db_get_value ("alias","tagente","id_agente",$module_data['id_agente']); - $label = $alias . " - " .$module_data['nombre']; - } + $temp_min = reporting_get_agentmodule_data_min($module,$period,$date); + if ($temp_min < 0) + $temp_min = 0; + $temp[$module]['min'] = ($temp_min === false) ? 0 : $temp_min; - $temp[$label]['g'] = round($temp_data,4); - - - if ($config['metaconsole']) { - // Automatic custom graph from the report template in metaconsole - if (is_array($module_list[0])) { - metaconsole_restore_db(); - } - } - - } - break; - case CUSTOM_GRAPH_PIE: - $datelimit = $date - $period; - $total_modules = 0; - foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; - if ($config['metaconsole']) { - // Automatic custom graph from the report template in metaconsole - if (is_array($module_list[$i])) { - $server = metaconsole_get_connection_by_id ($module_item['server']); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } - } - - if ($automatic_custom_graph_meta) - $module = $module_item['module']; - else - $module = $module_item; - - $data_module = modules_get_agentmodule($module); - $query_last_value = sprintf(' - SELECT datos - FROM tagente_datos - WHERE id_agente_modulo = %d - AND utimestamp > %d - AND utimestamp < %d - ORDER BY utimestamp DESC', - $module, $datelimit, $date); - $temp_data = db_get_value_sql($query_last_value); - - if ( $temp_data ){ - if (is_numeric($temp_data)) - $value = $temp_data; - else - $value = count($value); - } - else { - $value = false; - } - $total_modules += $value; - - if ( !empty($labels) && isset($labels[$module]) ){ - $label = io_safe_output($labels[$module]); - }else { - $alias = db_get_value ("alias","tagente","id_agente",$data_module['id_agente']); - $label = io_safe_output($alias . ": " . $data_module['nombre']); - } - - $temp[$label] = array('value'=>$value, - 'unit'=>$data_module['unit']); - if ($config['metaconsole']) { - // Automatic custom graph from the report template in metaconsole - if (is_array($module_list[0])) { - metaconsole_restore_db(); - } - } - } - $temp['total_modules'] = $total_modules; - - break; - case CUSTOM_GRAPH_GAUGE: - $datelimit = $date - $period; - $i = 0; - foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; - if ($config['metaconsole']) { - // Automatic custom graph from the report template in metaconsole - if (is_array($module_list[$i])) { - $server = metaconsole_get_connection_by_id ($module_item['server']); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } - } - - if ($automatic_custom_graph_meta) - $module = $module_item['module']; - else - $module = $module_item; - - $temp[$module] = modules_get_agentmodule($module); - $query_last_value = sprintf(' - SELECT datos - FROM tagente_datos - WHERE id_agente_modulo = %d - AND utimestamp < %d - ORDER BY utimestamp DESC', - $module, $date); - $temp_data = db_get_value_sql($query_last_value); - if ( $temp_data ) { - if (is_numeric($temp_data)) - $value = $temp_data; - else - $value = count($value); - } - else { - $value = false; - } - $temp[$module]['label'] = ($labels[$module] != '') ? $labels[$module] : $temp[$module]['nombre']; - - $temp[$module]['value'] = $value; - $temp[$module]['label'] = ui_print_truncate_text($temp[$module]['label'],"module_small",false,true,false,".."); - - if ($temp[$module]['unit'] == '%') { - $temp[$module]['min'] = 0; - $temp[$module]['max'] = 100; - } - else { - $min = $temp[$module]['min']; - if ($temp[$module]['max'] == 0) - $max = reporting_get_agentmodule_data_max($module,$period,$date); - else - $max = $temp[$module]['max']; - $temp[$module]['min'] = ($min == 0 ) ? 0 : $min; - $temp[$module]['max'] = ($max == 0 ) ? 100 : $max; - } - $temp[$module]['gauge'] = uniqid('gauge_'); - - if ($config['metaconsole']) { - // Automatic custom graph from the report template in metaconsole - if (is_array($module_list[0])) { - metaconsole_restore_db(); - } - } - $i++; - } - break; - default: - if (!is_null($percentil) && $percentil) { - foreach ($graph_values as $graph_group => $point) { - foreach ($point as $timestamp_point => $point_value) { - $temp[$timestamp_point][$graph_group] = $point_value; + if ($config['metaconsole']) { + // Automatic custom graph from the report template in metaconsole + if (is_array($module_list[0])) { + metaconsole_restore_db(); + } } - $percentile_value = get_percentile($config['percentil'], $point); - $percentil_result[$graph_group] = array_fill ( 0, count($point), $percentile_value); - $series_type[$graph_group] = 'line'; + } + + break; + case CUSTOM_GRAPH_HBARS: + case CUSTOM_GRAPH_VBARS: + $datelimit = $date - $period; + + $label = ''; + foreach ($module_list as $module_item) { + $automatic_custom_graph_meta = false; + if ($config['metaconsole']) { + // Automatic custom graph from the report template in metaconsole + if (is_array($module_list[$i])) { + $server = metaconsole_get_connection_by_id ($module_item['server']); + metaconsole_connect($server); + $automatic_custom_graph_meta = true; + } + } + + if ($automatic_custom_graph_meta) + $module = $module_item['module']; + else + $module = $module_item; + + + $module_data = modules_get_agentmodule($module); + $query_last_value = sprintf(' + SELECT datos + FROM tagente_datos + WHERE id_agente_modulo = %d + AND utimestamp < %d + ORDER BY utimestamp DESC', + $module, $date); + $temp_data = db_get_value_sql($query_last_value); + $agent_name = io_safe_output( - modules_get_agentmodule_agent_alias ($module_list[$graph_group])); - $module_name = io_safe_output( - modules_get_agentmodule_name ($module_list[$graph_group])); - $module_name_list['percentil'.$graph_group] = __('Percentile %dº', $config['percentil']) . __(' of module ') . $agent_name .' / ' . $module_name . ' (' . $percentile_value . ' ' . $unit . ') '; + modules_get_agentmodule_agent_name ($module)); + + if (!empty($labels) && isset($labels[$module]) ){ + $label = $labels[$module]; + }else { + $alias = db_get_value ("alias","tagente","id_agente",$module_data['id_agente']); + $label = $alias . " - " .$module_data['nombre']; + } + + $temp[$label]['g'] = round($temp_data,4); + + + if ($config['metaconsole']) { + // Automatic custom graph from the report template in metaconsole + if (is_array($module_list[0])) { + metaconsole_restore_db(); + } + } + } - } - else { - foreach ($graph_values as $graph_group => $point) { - foreach ($point as $timestamp_point => $point_value) { - $temp[$timestamp_point][$graph_group] = $point_value; + break; + case CUSTOM_GRAPH_PIE: + $datelimit = $date - $period; + $total_modules = 0; + foreach ($module_list as $module_item) { + $automatic_custom_graph_meta = false; + if ($config['metaconsole']) { + // Automatic custom graph from the report template in metaconsole + if (is_array($module_list[$i])) { + $server = metaconsole_get_connection_by_id ($module_item['server']); + metaconsole_connect($server); + $automatic_custom_graph_meta = true; + } + } + + if ($automatic_custom_graph_meta) + $module = $module_item['module']; + else + $module = $module_item; + + $data_module = modules_get_agentmodule($module); + $query_last_value = sprintf(' + SELECT datos + FROM tagente_datos + WHERE id_agente_modulo = %d + AND utimestamp > %d + AND utimestamp < %d + ORDER BY utimestamp DESC', + $module, $datelimit, $date); + $temp_data = db_get_value_sql($query_last_value); + + if ( $temp_data ){ + if (is_numeric($temp_data)) + $value = $temp_data; + else + $value = count($value); + } + else { + $value = false; + } + $total_modules += $value; + + if ( !empty($labels) && isset($labels[$module]) ){ + $label = io_safe_output($labels[$module]); + }else { + $alias = db_get_value ("alias","tagente","id_agente",$data_module['id_agente']); + $label = io_safe_output($alias . ": " . $data_module['nombre']); + } + + $temp[$label] = array('value'=>$value, + 'unit'=>$data_module['unit']); + if ($config['metaconsole']) { + // Automatic custom graph from the report template in metaconsole + if (is_array($module_list[0])) { + metaconsole_restore_db(); + } } } + $temp['total_modules'] = $total_modules; + + break; + case CUSTOM_GRAPH_GAUGE: + $datelimit = $date - $period; + $i = 0; + foreach ($module_list as $module_item) { + $automatic_custom_graph_meta = false; + if ($config['metaconsole']) { + // Automatic custom graph from the report template in metaconsole + if (is_array($module_list[$i])) { + $server = metaconsole_get_connection_by_id ($module_item['server']); + metaconsole_connect($server); + $automatic_custom_graph_meta = true; + } + } + + if ($automatic_custom_graph_meta) + $module = $module_item['module']; + else + $module = $module_item; + + $temp[$module] = modules_get_agentmodule($module); + $query_last_value = sprintf(' + SELECT datos + FROM tagente_datos + WHERE id_agente_modulo = %d + AND utimestamp < %d + ORDER BY utimestamp DESC', + $module, $date); + $temp_data = db_get_value_sql($query_last_value); + if ( $temp_data ) { + if (is_numeric($temp_data)) + $value = $temp_data; + else + $value = count($value); + } + else { + $value = false; + } + $temp[$module]['label'] = ($labels[$module] != '') ? $labels[$module] : $temp[$module]['nombre']; + + $temp[$module]['value'] = $value; + $temp[$module]['label'] = ui_print_truncate_text($temp[$module]['label'],"module_small",false,true,false,".."); + + if ($temp[$module]['unit'] == '%') { + $temp[$module]['min'] = 0; + $temp[$module]['max'] = 100; + } + else { + $min = $temp[$module]['min']; + if ($temp[$module]['max'] == 0) + $max = reporting_get_agentmodule_data_max($module,$period,$date); + else + $max = $temp[$module]['max']; + $temp[$module]['min'] = ($min == 0 ) ? 0 : $min; + $temp[$module]['max'] = ($max == 0 ) ? 100 : $max; + } + $temp[$module]['gauge'] = uniqid('gauge_'); + + if ($config['metaconsole']) { + // Automatic custom graph from the report template in metaconsole + if (is_array($module_list[0])) { + metaconsole_restore_db(); + } + } + $i++; + } + break; + default: + if (!is_null($percentil) && $percentil) { + foreach ($graph_values as $graph_group => $point) { + foreach ($point as $timestamp_point => $point_value) { + $temp[$timestamp_point][$graph_group] = $point_value; + } + + $percentile_value = get_percentile($config['percentil'], $point); + $percentil_result[$graph_group] = array_fill ( 0, count($point), $percentile_value); + $series_type[$graph_group] = 'line'; + $agent_name = io_safe_output( + modules_get_agentmodule_agent_alias ($module_list[$graph_group])); + $module_name = io_safe_output( + modules_get_agentmodule_name ($module_list[$graph_group])); + $module_name_list['percentil'.$graph_group] = __('Percentile %dº', $config['percentil']) . __(' of module ') . $agent_name .' / ' . $module_name . ' (' . $percentile_value . ' ' . $unit . ') '; + } + } + else { + foreach ($graph_values as $graph_group => $point) { + foreach ($point as $timestamp_point => $point_value) { + $temp[$timestamp_point][$graph_group] = $point_value; + } + } + } + break; + } + } + else{ + $temp = fullscale_data_combined($module_list, $period, $date); + + $resolution = count($temp); //Number of points of the graph + $interval = (int) ($period / $resolution); + $module_name_list = array(); + $flash_charts = true; + + foreach ($module_list as $key => $value) { + $agent_name = io_safe_output( modules_get_agentmodule_agent_name ($value) ); + $alias = db_get_value ("alias","tagente","nombre",$agent_name); + $module_name = io_safe_output( modules_get_agentmodule_name ($value) ); + + if ($flash_charts){ + $module_name_list[$key] = '' . $alias . " / " . $module_name. ''; } - break; + else{ + $module_name_list[$key] = $alias . " / " . $module_name; + } + } } $graph_values = $temp; @@ -2081,6 +2104,41 @@ function graphic_combined_module ($module_list, $weight_list, $period, } } +function fullscale_data_combined($module_list, $period, $date){ + + // Set variables + if ($date == 0){ + $date = get_system_time(); + } + + $datelimit = $date - $period; + + foreach ($module_list as $key_module => $value_module) { + $data_uncompress = db_uncompress_module_data($value_module, $datelimit, $date); + foreach ($data_uncompress as $key_data => $value_data) { + foreach ($value_data['data'] as $k => $v) { + $real_date = date("Y M d H:i:s", $v['utimestamp']); + $data_all[$real_date][$key_module] = $v['datos']; + } + } + } + + $data_prev = array(); + + foreach ($data_all as $key => $value) { + foreach ($module_list as $key_module => $value_module) { + if(!isset($value[$key_module])){ + $data_all[$key][$key_module] = $data_prev[$key_module]; + } + else{ + $data_prev[$key_module] = $value[$key_module]; + } + } + } + + return $data_all; +} + /** * Print a graph with access data of agents * @@ -4331,7 +4389,6 @@ function fullscale_data ( &$chart_data, &$chart_extra_data, &$long_index, $series_type['percentil' . $series_suffix] = 'line'; } } - //html_debug_print($chart_data); } function grafico_modulo_boolean ($agent_module_id, $period, $show_events, diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index 8d676b4340..1a0a1343f9 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -150,6 +150,7 @@ $interface_traffic_modules = array( $zoom = (int) get_parameter ("zoom", 1); $baseline = get_parameter ("baseline", 0); $show_percentil = get_parameter ("show_percentil", 0); + $fullscale = get_parameter("fullscale", 0); if ($zoom > 1) { $height = $height * ($zoom / 2.1); @@ -200,7 +201,9 @@ $interface_traffic_modules = array( false, false, (($show_percentil)? $config['percentil'] : null), - true); + true, + false, + $fullscale); echo ''; @@ -258,6 +261,12 @@ $interface_traffic_modules = array( $data[1] = html_print_checkbox ("show_percentil", 1, (bool) $show_percentil, true); $table->data[] = $data; $table->rowclass[] =''; + + $data = array(); + $data[0] = __('Full scale'); + $data[1] = html_print_checkbox ("fullscale", 1, (bool) $fullscale, true); + $table->data[] = $data; + $table->rowclass[] =''; $data = array(); $data[0] = __('Zoom factor');