From c4a543ceaa3aee9b4358b74f71327a310adb837b Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 18 Apr 2011 12:17:03 +0000 Subject: [PATCH] 2011-04-18 Miguel de Dios * include/functions_reporting.php: changed to use new engine. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4235 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 4 ++ .../include/functions_reporting.php | 37 +++++++++++++------ 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a836df3ade..e9efced3c7 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2011-04-18 Miguel de Dios + + * include/functions_reporting.php: changed to use new engine. + 2011-04-18 Sergio Martin * include/graphs/functions_pchart.php diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 9c1cb59052..12d166bae1 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -25,7 +25,6 @@ require_once ($config["homedir"]."/include/functions.php"); require_once ($config["homedir"]."/include/functions_db.php"); require_once ($config["homedir"]."/include/functions_agents.php"); -include_once ($config["homedir"]."/include/fgraph.php"); require_once ('functions_graph.php'); @@ -1267,11 +1266,15 @@ function monitor_health_reporting ($id_group, $period = 0, $date = 0, $return = $output .= print_table ($table, true); - //Floating it was ugly, moved it to the bottom - $output .= ''; + $data = array(); + $data[__('Monitors OK')] = $down_percentage; + $data[__('Monitors BAD')] = $not_down_percentage; + + $output .= pie3d_graph($config['flash_charts'], $data, 280, 150); if (!$return) echo $output; + return $output; } @@ -2043,6 +2046,12 @@ function render_report_html_item ($content, $table, $report, $mini = false) { $data_graph[__('On the edge')] = 0; $data_graph[__('Unknown')] = 0; + $data_horin_graph = array (); + $data_horin_graph[__('Inside limits')]['g'] = 0; + $data_horin_graph[__('Out of limits')]['g'] = 0; + $data_horin_graph[__('On the edge')]['g'] = 0; + $data_horin_graph[__('Unknown')]['g'] = 0; + $sla_failed = false; foreach ($slas as $sla) { //Get the sla_value in % and store it on $sla_value @@ -2053,15 +2062,19 @@ function render_report_html_item ($content, $table, $report, $mini = false) { //Fill the array data_graph for the pie graph if ($sla_value === false) { $data_graph[__('Unknown')]++; + $data_horin_graph[__('Unknown')]['g']++; } else if ($sla_value <= ($sla['sla_limit']+10) && $sla_value >= ($sla['sla_limit']-10)) { $data_graph[__('On the edge')]++; + $data_horin_graph[__('On the edge')]['g']++; } else if ($sla_value > ($sla['sla_limit']+10)) { $data_graph[__('Inside limits')]++; + $data_horin_graph[__('Inside limits')]['g']++; } else if ($sla_value < ($sla['sla_limit']-10)) { $data_graph[__('Out of limits')]++; + $data_horin_graph[__('Out of limits')]['g']++; } //Do not show right modules if 'only_display_wrong' is active @@ -2125,10 +2138,9 @@ function render_report_html_item ($content, $table, $report, $mini = false) { $data[0] .= "
"; $data[0] .= printSmallFont(get_agentmodule_name ($sla['id_agent_module'])); - $data[1] = ""; + $data[1] = graph_sla_slicebar ($sla['id_agent_module'], $content['period'], + $sla['sla_min'], $sla['sla_max'], $daysWeek, $content['time_from'], + $content['time_to'], $sla['sla_limit'], 550, 25); array_push ($table2->data, $data); } @@ -3036,8 +3048,10 @@ function render_report_html_item ($content, $table, $report, $mini = false) { else if ($order_uptodown == 0 || $order_uptodown == 3) { $i = 0; $data_pie_graph = array(); + $data_hbar = array(); foreach ($agent_name as $an) { $data_pie_graph[$an] = $data_top[$i]; + $data_hbar[$an]['g'] = $data_top[$i]; if ($show_graph == 0 || $show_graph == 1) { $data = array(); $data[0] = printSmallFont($an); @@ -3068,8 +3082,8 @@ function render_report_html_item ($content, $table, $report, $mini = false) { $table->colspan[4][0] = 3; $height = count($data_pie_graph)*20+35; $data = array(); - $data[0] = ""; + $data[0] = hbar_graph($config['flash_charts'], $data_hbar, 600, $height); + array_push ($table->data, $data); } @@ -3315,8 +3329,9 @@ function render_report_html_item ($content, $table, $report, $mini = false) { $table->colspan[4][0] = 3; $height = count($data_pie_graph)*20+35; $data = array(); - $data[0] = ""; + + $data[0] = hbar_graph($config['flash_charts'], $data_horin_graph, 600, $height); + array_push ($table->data, $data); }