From 913aa4334be02771dad8703214cbfae4c29612a5 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 18 May 2017 17:06:49 +0200 Subject: [PATCH 1/5] Save work and continue with more tests --- pandora_console/include/functions_db.php | 15 ++- pandora_console/include/functions_graph.php | 99 ++++++++----------- .../operation/agentes/stat_win.php | 11 ++- 3 files changed, 60 insertions(+), 65 deletions(-) diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index e682e1e138..f2c1627304 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -569,7 +569,13 @@ function db_uncompress_module_data($id_agente_modulo, $tstart = false, $tend = f if ((!isset($tstart)) || ($tstart === false)) { // Return data from the begining - $tstart = 0; + // Get first available utimestamp in active DB + $query_first_man_time = " SELECT utimestamp FROM tagente_datos "; + $query_first_man_time .= " WHERE id_agente_modulo = $id_agente_modulo"; + $query_first_man_time .= " ORDER BY utimestamp ASC LIMIT 1"; + + $first_man_time = db_get_all_rows_sql( $query_first_man_time, false); + $tstart = $first_man_time[0]['utimestamp']; } if ((!isset($tend)) || ($tend === false)) { @@ -581,7 +587,6 @@ function db_uncompress_module_data($id_agente_modulo, $tstart = false, $tend = f return false; } - $search_historydb = false; $table = "tagente_datos"; @@ -596,13 +601,11 @@ function db_uncompress_module_data($id_agente_modulo, $tstart = false, $tend = f $table = "tagente_datos_string"; } - // Get first available utimestamp in active DB $query = " SELECT utimestamp, datos FROM $table "; $query .= " WHERE id_agente_modulo=$id_agente_modulo AND utimestamp < $tstart"; $query .= " ORDER BY utimestamp DESC LIMIT 1"; - $ret = db_get_all_rows_sql( $query , $search_historydb); if ( ( $ret === false ) || (( isset($ret[0]["utimestamp"]) && ($ret[0]["utimestamp"] > $tstart )))) { @@ -610,6 +613,10 @@ function db_uncompress_module_data($id_agente_modulo, $tstart = false, $tend = f $search_historydb = true; $ret = db_get_all_rows_sql( $query , $search_historydb); + + if ($ret) { + $tstart = $ret[0]["utimestamp"]; + } } else { $first_data["utimestamp"] = $ret[0]["utimestamp"]; diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 8582655e82..8221d0b7c8 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -239,7 +239,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i global $series_type; global $max_value; global $min_value; - + $max_value = 0; $min_value = null; $flash_chart = $config['flash_charts']; @@ -252,12 +252,10 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i // Calculate chart data $last_known = $previous_data; - - + for ($i = 0; $i <= $resolution; $i++) { $timestamp = $datelimit + ($interval * $i); - $total = 0; $count = 0; @@ -458,20 +456,6 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i $series_type['unknown'.$series_suffix] = 'area'; } - //$chart[$timestamp]['count'] = 0; - ///////// - //$chart[$timestamp]['timestamp_bottom'] = $timestamp; - //$chart[$timestamp]['timestamp_top'] = $timestamp + $interval; - ///////// - - //Baseline was replaced by compare graphs feature - /*if ($baseline) { - $chart[$timestamp]['baseline'.$series_suffix] = array_shift ($baseline_data); - if ($chart[$timestamp]['baseline'.$series_suffix] == NULL) { - $chart[$timestamp]['baseline'.$series_suffix] = 0; - } - }*/ - if (!empty($event_ids)) { $chart_extra_data[count($chart)-1]['events'] = implode(',',$event_ids); } @@ -498,7 +482,8 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $show_alerts = false, $avg_only = 0, $date = 0, $unit = '', $baseline = 0, $return_data = 0, $show_title = true, $projection = false, $adapt_key = '', $compare = false, $series_suffix = '', $series_suffix_str = '', - $show_unknown = false, $percentil = null, $dashboard = false, $vconsole = false,$type_graph='area') { + $show_unknown = false, $percentil = null, $dashboard = false, $vconsole = false, + $type_graph='area', $fullscale = false) { global $config; global $chart; @@ -612,7 +597,24 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $min_necessary = 2; } - + + if ($fullscale) { + $all_data = db_uncompress_module_data($agent_module_id, time() - $period); + + $new_uncompress_data = array(); + $index = 0; + foreach ($all_data as $uncompress_data) { + foreach ($uncompress_data['data'] as $mod_data) { + $new_uncompress_data[$index]['datos'] = $mod_data['datos']; + $new_uncompress_data[$index]['utimestamp'] = $mod_data['utimestamp']; + $index++; + } + } + $new_uncompress_data[$index - 1]['id_agente_modulo'] = $agent_module_id; + + $data = $new_uncompress_data; + } + // Check available data if (count ($data) < $min_necessary) { if (!$graphic_type) { @@ -655,6 +657,11 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, if (empty($unit)) { $unit = modules_get_unit($agent_module_id); } + + if ($fullscale) { + $resolution = count($data); //Number of points of the graph + $interval = (int) ($period / $resolution); + } // Calculate chart data grafico_modulo_sparse_data_chart ($chart, $chart_data_extra, $long_index, @@ -663,9 +670,12 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $show_events, $show_alerts, $show_unknown, $baseline, $baseline_data, $events, $series_suffix, $start_unknown, $percentil); - - - + + html_debug("DATA: ", true); + html_debug(count($data), true); + html_debug("CHART: ", true); + html_debug(count($chart), true); + // Return chart data and don't draw if ($return_data == 1) { return $chart; @@ -762,12 +772,6 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, else { $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit; } - //Baseline was replaced by compare graph feature - /*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]; if ($show_unknown) { $legend['unknown'.$series_suffix] = __('Unknown').$series_suffix_str; @@ -790,7 +794,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', $fullscale = false) { global $config; global $graphic_type; @@ -820,7 +824,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $show_alerts, $avg_only, $date-$period, $unit, $baseline, $return_data, $show_title, $projection, $adapt_key, $compare, $series_suffix, $series_suffix_str, - $show_unknown, $percentil, $dashboard, $vconsole,$type_graph); + $show_unknown, $percentil, $dashboard, $vconsole,$type_graph, + $fullscale); switch ($compare) { case 'separated': @@ -853,7 +858,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $show_alerts, $avg_only, $date, $unit, $baseline, $return_data, $show_title, $projection, $adapt_key, $compare, '', '', $show_unknown, - $percentil, $dashboard, $vconsole,$type_graph); + $percentil, $dashboard, $vconsole, $type_graph, $fullscale); if ($return_data) { @@ -3598,8 +3603,7 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, global $long_index; global $series_type; global $chart_extra_data; - - + $chart = array(); $color = array(); $legend = array(); @@ -3834,13 +3838,6 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, $series_type['alert'.$series_suffix] = 'points'; } - //The order filling the array is very important to get the same colors - //in legends and graphs!!! - //Boolean graph doesn't have max!!! - /*if (!$avg_only) { - $chart[$timestamp]['max'.$series_suffix] = 0; - }*/ - // Data and zeroes (draw a step) if ($zero == 1 && $count > 0) { @@ -3875,11 +3872,6 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, $series_type['sum' . $series_suffix] = 'boolean'; - //Boolean graph doesn't have min!!! - /*if (!$avg_only) { - $chart[$timestamp]['min'.$series_suffix] = 0; - }*/ - if (!empty($event_ids)) { $chart_extra_data[count($chart)-1]['events'] = implode(',',$event_ids); } @@ -3943,17 +3935,7 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, $chart_extra_data['legend_alerts'] = $legend['alert'.$series_suffix]; } - if (!$avg_only) { - //Boolean graph doesn't have max!!! - //$legend['max'.$series_suffix] = __('Max').$series_suffix_str .': '.__('Last').': '.$graph_stats['max']['last'].' '.$unit.' ; '.__('Avg').': '.$graph_stats['max']['avg'].' '.$unit.' ; '.__('Max').': '.$graph_stats['max']['max'].' '.$unit.' ; '.__('Min').': '.$graph_stats['max']['min'].' '.$unit; - $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit; - // Boolean graph doesn't have min!!! - // $legend['min'.$series_suffix] = __('Min').$series_suffix_str .': '.__('Last').': '.number_format($graph_stats['min']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['min']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['min']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['min']['min'], $config['graph_precision']).' '.$unit; - } - else { - $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit; - - } + $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit; if ($show_unknown) { $legend['unknown'.$series_suffix] = __('Unknown').$series_suffix_str; @@ -3985,13 +3967,12 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, array('border' => '#999999', 'color' => '#999999', 'alpha' => CHART_DEFAULT_ALPHA); } - //$color['baseline'.$series_suffix] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10); } function grafico_modulo_boolean ($agent_module_id, $period, $show_events, $width, $height , $title='', $unit_name, $show_alerts, $avg_only = 0, $pure=0, $date = 0, $only_image = false, $homeurl = '', $adapt_key = '', $compare = false, - $show_unknown = false, $menu = true) { + $show_unknown = false, $menu = true, $fullscale = false) { global $config; global $graphic_type; diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 935917c11a..cc22351bcd 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -167,6 +167,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $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); + $fullscale = get_parameter ("fullscale", 0); // To avoid the horizontal overflow $width -= 20; @@ -211,7 +212,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $width, $height, $label_graph, $unit, $draw_alerts, $avg_only, false, $date, false, $urlImage, 'adapter_' . $graph_type, $time_compare, - $unknown_graph); + $unknown_graph, true, $fullscale); echo '
'; if ($show_events_graph) echo graphic_module_events($id, $width, $height, @@ -226,7 +227,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); 'adapter_' . $graph_type, $time_compare, $unknown_graph, true, 'white', (($show_percentil)? $config['percentil'] : null), - false, false, $config['type_module_charts']); + false, false, $config['type_module_charts'], $fullscale); echo '
'; if ($show_events_graph) echo graphic_module_events($id, $width, $height, @@ -398,6 +399,12 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $table->rowclass[] = ''; break; } + + $data = array(); + $data[0] = __('Show full scale graph (TIP)'); + $data[1] = html_print_checkbox ("fullscale", 1, (bool) $fullscale, true); + $table->data[] = $data; + $table->rowclass[] = ''; $form_table = html_print_table($table, true); From 16fe10d1afb4d73d4c1dd0e431b8d283e2602d3a Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Fri, 19 May 2017 12:04:54 +0200 Subject: [PATCH 2/5] Added fullscale to boolean charts. Continue with the tests. --- pandora_console/include/functions_graph.php | 33 +++++++++++++++------ 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 8221d0b7c8..833dac6517 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -671,11 +671,6 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $baseline_data, $events, $series_suffix, $start_unknown, $percentil); - html_debug("DATA: ", true); - html_debug(count($data), true); - html_debug("CHART: ", true); - html_debug(count($chart), true); - // Return chart data and don't draw if ($return_data == 1) { return $chart; @@ -3594,7 +3589,8 @@ function fs_error_image ($width = 300, $height = 110) { function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, $unit_name, $show_alerts, $avg_only = 0, - $date = 0, $series_suffix = '', $series_suffix_str = '', $show_unknown = false) { + $date = 0, $series_suffix = '', $series_suffix_str = '', $show_unknown = false, + $fullscale = false) { global $config; global $chart; @@ -3660,6 +3656,26 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, if ($data === false) { $data = array (); } + + if ($fullscale) { + $all_data = db_uncompress_module_data($agent_module_id, time() - $period); + + $new_uncompress_data = array(); + $index = 0; + foreach ($all_data as $uncompress_data) { + foreach ($uncompress_data['data'] as $mod_data) { + $new_uncompress_data[$index]['datos'] = $mod_data['datos']; + $new_uncompress_data[$index]['utimestamp'] = $mod_data['utimestamp']; + $index++; + } + } + $new_uncompress_data[$index - 1]['id_agente_modulo'] = $agent_module_id; + + $data = $new_uncompress_data; + + $resolution = count($data); //Number of points of the graph + $interval = (int) ($period / $resolution); + } // Uncompressed module data if ($uncompressed_module) { @@ -3993,7 +4009,6 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events, else $unit = $unit_name; - $series_suffix_str = ''; if ($compare !== false) { $series_suffix = '2'; @@ -4001,7 +4016,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events, // Build the data of the previous period grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, $unit_name, $show_alerts, $avg_only, $date-$period, $series_suffix, - $series_suffix_str, $show_unknown); + $series_suffix_str, $show_unknown, $fullscale); switch ($compare) { case 'separated': // Store the chart calculated @@ -4027,7 +4042,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events, } grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, - $unit_name, $show_alerts, $avg_only, $date, '', '', $show_unknown); + $unit_name, $show_alerts, $avg_only, $date, '', '', $show_unknown, $fullscale); if ($compare === 'overlapped') { $i = 0; From 5bb3cd2ad6918e6adfe280da3f83752ec4caa4b7 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Tue, 23 May 2017 15:02:53 +0200 Subject: [PATCH 3/5] Added some code to fullscale graphs --- pandora_console/include/functions_graph.php | 64 ++++++++++++--------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 833dac6517..f2b18646ce 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -232,7 +232,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i $projection, $avg_only = false, $uncompressed_module = false, $show_events = false, $show_alerts = false, $show_unknown = false, $baseline = false, $baseline_data = array(), $events = array(), $series_suffix = '', $start_unknown = false, - $percentil = null) { + $percentil = null, $fullscale = false) { global $config; global $chart_extra_data; @@ -350,9 +350,15 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i } elseif ($period < SECONDS_1MONTH) { $time_format = "M \nd H\h"; + if ($fullscale) { + $time_format = "M \nd H:i"; + } } else { $time_format = "M \nd H\h"; + if ($fullscale) { + $time_format = "M \nd H:i"; + } } } else { @@ -368,9 +374,15 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i } elseif ($period < SECONDS_1MONTH) { $time_format = "M d H\h"; + if ($fullscale) { + $time_format = "M d H:i"; + } } else { $time_format = "M d H\h"; + if ($fullscale) { + $time_format = "M d H:i"; + } } } @@ -550,13 +562,30 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, } // Get module data - $data = db_get_all_rows_filter ('tagente_datos', - array ('id_agente_modulo' => (int)$agent_module_id, - "utimestamp > $datelimit", - "utimestamp < $date", - 'order' => 'utimestamp ASC'), - array ('datos', 'utimestamp'), 'AND', $search_in_history_db); - + if ($fullscale) { + $uncompress_data = db_uncompress_module_data((int)$agent_module_id, $datelimit, get_system_time()); + + $new_data = array(); + $index = 0; + foreach ($uncompress_data as $key => $u_data) { + foreach ($u_data['data'] as $key2 => $u_data2) { + if ($u_data2['datos'] != "") { + $new_data[$index]['datos'] = $u_data2['datos']; + $new_data[$index]['utimestamp'] = $u_data2['utimestamp']; + $index++; + } + } + } + $data = $new_data; + } + else { + $data = db_get_all_rows_filter ('tagente_datos', + array ('id_agente_modulo' => (int)$agent_module_id, + "utimestamp > $datelimit", + "utimestamp < $date", + 'order' => 'utimestamp ASC'), + array ('datos', 'utimestamp'), 'AND', $search_in_history_db); + } // Get module warning_min and critical_min $warning_min = db_get_value('min_warning','tagente_modulo','id_agente_modulo',$agent_module_id); @@ -598,23 +627,6 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $min_necessary = 2; } - if ($fullscale) { - $all_data = db_uncompress_module_data($agent_module_id, time() - $period); - - $new_uncompress_data = array(); - $index = 0; - foreach ($all_data as $uncompress_data) { - foreach ($uncompress_data['data'] as $mod_data) { - $new_uncompress_data[$index]['datos'] = $mod_data['datos']; - $new_uncompress_data[$index]['utimestamp'] = $mod_data['utimestamp']; - $index++; - } - } - $new_uncompress_data[$index - 1]['id_agente_modulo'] = $agent_module_id; - - $data = $new_uncompress_data; - } - // Check available data if (count ($data) < $min_necessary) { if (!$graphic_type) { @@ -669,7 +681,7 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $projection, $avg_only, $uncompressed_module, $show_events, $show_alerts, $show_unknown, $baseline, $baseline_data, $events, $series_suffix, $start_unknown, - $percentil); + $percentil, $fullscale); // Return chart data and don't draw if ($return_data == 1) { From 53f4c6edb84b47de729aaa7a809b4d24ad786291 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Tue, 23 May 2017 15:15:28 +0200 Subject: [PATCH 4/5] Added fullscale setting in boolean chart --- pandora_console/include/functions_graph.php | 22 +++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index f2b18646ce..8e67ed7935 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -3670,15 +3670,17 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, } if ($fullscale) { - $all_data = db_uncompress_module_data($agent_module_id, time() - $period); + $all_data = db_uncompress_module_data($agent_module_id, $datelimit, $date); $new_uncompress_data = array(); $index = 0; foreach ($all_data as $uncompress_data) { foreach ($uncompress_data['data'] as $mod_data) { - $new_uncompress_data[$index]['datos'] = $mod_data['datos']; - $new_uncompress_data[$index]['utimestamp'] = $mod_data['utimestamp']; - $index++; + if ($mod_data['datos'] != "") { + $new_uncompress_data[$index]['datos'] = $mod_data['datos']; + $new_uncompress_data[$index]['utimestamp'] = $mod_data['utimestamp']; + $index++; + } } } $new_uncompress_data[$index - 1]['id_agente_modulo'] = $agent_module_id; @@ -3834,9 +3836,15 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, } elseif ($period < SECONDS_1MONTH) { $time_format = 'M d H\h'; + if ($fullscale) { + $time_format = 'M d H:i'; + } } else { $time_format = 'M d H\h'; + if ($fullscale) { + $time_format = 'M d H:i'; + } } $timestamp_short = date($time_format, $timestamp); @@ -3944,9 +3952,15 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, } elseif ($period < SECONDS_1MONTH) { $time_format = 'M d H\h'; + if ($fullscale) { + $time_format = 'M d H:i'; + } } else { $time_format = 'M d H\h'; + if ($fullscale) { + $time_format = 'M d H:i'; + } } // Flash chart From d744cb92205bceae5f23389418ac31737c7afb6b Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Tue, 23 May 2017 15:16:34 +0200 Subject: [PATCH 5/5] Added end date to fullscale chart view --- pandora_console/include/functions_graph.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 8e67ed7935..48496def25 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -563,7 +563,7 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, // Get module data if ($fullscale) { - $uncompress_data = db_uncompress_module_data((int)$agent_module_id, $datelimit, get_system_time()); + $uncompress_data = db_uncompress_module_data((int)$agent_module_id, $datelimit, $date); $new_data = array(); $index = 0;