From 1acd14b4e55cb4a857f987fc8f1e276b848987be Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 27 Apr 2010 10:51:17 +0000 Subject: [PATCH] 2010-04-27 Miguel de Dios * include/functions_reporting.php: cleaned source code of "render_report_html_item" function for new types of report items. * include/functions.php: cleaned source code of "get_report_types" function and added new types of report items. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2614 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 +- pandora_console/include/functions.php | 18 +- .../include/functions_reporting.php | 759 +++++++++--------- 3 files changed, 402 insertions(+), 385 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index bbe12873fb..b766b5dc05 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,9 +1,17 @@ +2010-04-27 Miguel de Dios + + * include/functions_reporting.php: cleaned source code of + "render_report_html_item" function for new types of report items. + + * include/functions.php: cleaned source code of "get_report_types" function + and added new types of report items. + 2010-04-27 Sergio Martin * pandoradb_data.sql: Changed the group All values on tables with default group form 1 to 0 -2010-04-26 Miguel de Dios +2010-04-27 Miguel de Dios * operation/agentes/ver_agente.php: removed hack for translate "any" text. diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 923b70cb4e..d48edcc144 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -619,11 +619,6 @@ function get_report_types () { $types['min_value'] = __('Min. Value'); $types['sumatory'] = __('Sumatory'); $types['agent_detailed'] = __('Agent detailed view'); -// $types['agent_detailed_event'] = __('Agent detailed event'); -// $types['list_events_module'] = __('List events of module'); -// $types['list_events_agent'] = __('List events of agent'); -// $types['list_alerts_agent'] = __('List alerts of agent'); -// $types['list_alerts_module'] = __('List alerts of module'); $types['text'] = __('Text'); $types['sql'] = __('SQL query'); $types['url'] = __('Import text from URL'); @@ -632,15 +627,20 @@ function get_report_types () { $types['TTO'] = __('TTO'); $types['MTBF'] = __('MTBF'); $types['MTTR'] = __('MTTR'); + $types['alert_report_module'] = __('Alert report module'); + $types['alert_report_agent'] = __('Alert report agent'); + $types['event_report_agent'] = __('Event report agent'); + $types['event_report_module'] = __('Event report module'); +// $types['agent_detailed_event'] = __('Agent detailed event'); +// $types['list_events_module'] = __('List events of module'); +// $types['list_events_agent'] = __('List events of agent'); +// $types['list_alerts_agent'] = __('List alerts of agent'); +// $types['list_alerts_module'] = __('List alerts of module'); // $types['agent_detailed_event_pie_char'] = __('Agent detailed pie chart events'); // $types['agent_detailed_event_last_hours'] = __('Agent detailed event in last hours'); // $types['agent_detailed_alert_last_hours'] = __('Agent detailed alerts in last hours'); // $types['agent_detailed_num_modules'] = __('Agent detailed num modules'); // $types['agent_detailed_num_alerts'] = __('Agent detailed num alerts'); - $types['alert_report_module'] = __('Alert report module'); - $types['alert_report_agent'] = __('Alert report agent'); - $types['event_report_agent'] = __('Event report agent'); - $types['event_report_module'] = __('Event report module'); return $types; } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index e8bbecf39e..9b0492e142 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1179,394 +1179,403 @@ function get_agent_module_info_with_filter ($id_agent,$filter = '') { * */ -function render_report_html_item ($content, $table, $report){ +function render_report_html_item ($content, $table, $report) { global $config; - $module_name = get_db_value ('nombre', 'tagente_modulo', 'id_agente_modulo', $content['id_agent_module']); + $module_name = get_db_value ('nombre', 'tagente_modulo', 'id_agente_modulo', $content['id_agent_module']); debugPrint($module_name); $agent_name = get_agentmodule_agent_name ($content['id_agent_module']); switch ($content["type"]) { - case 1: - case 'simple_graph': - $table->colspan[1][0] = 4; - $data = array (); - $data[0] = '

'.__('Simple graph').'

'; - $data[1] = '

'.$agent_name.' - '.$module_name.'

'; - $data[2] = '

'.human_time_description ($content['period']).'

'; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[2][0] = 4; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $data = array (); - $data[0] = ''; - array_push ($table->data, $data); - - break; - case 2: - case 'custom_graph': - $graph = get_db_row ("tgraph", "id_graph", $content['id_gs']); - $data = array (); - $data[0] = '

'.__('Custom graph').'

'; - $data[1] = "

".$graph["name"]."

"; - $data[2] = "

".human_time_description ($content['period'])."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[1][0] = 3; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $result = get_db_all_rows_field_filter ("tgraph_source", "id_graph", $content['id_gs']); - $modules = array (); - $weights = array (); - if ($result === false) - $result = array(); - - foreach ($result as $content2) { - array_push ($modules, $content2['id_agent_module']); - array_push ($weights, $content2["weight"]); - } - - $graph_width = get_db_sql ("SELECT width FROM tgraph WHERE id_graph = ".$content["id_gs"]); - $graph_height= get_db_sql ("SELECT height FROM tgraph WHERE id_graph = ".$content["id_gs"]); + case 1: + case 'simple_graph': + //RUNNING + $table->colspan[1][0] = 4; + $data = array (); + $data[0] = '

'.__('Simple graph').'

'; + $data[1] = '

'.$agent_name.' - '.$module_name.'

'; + $data[2] = '

'.human_time_description ($content['period']).'

'; + array_push ($table->data, $data); + + // Put description at the end of the module (if exists) + if ($content["description"] != ""){ + $table->colspan[2][0] = 4; + $data_desc = array(); + $data_desc[0] = $content["description"]; + array_push ($table->data, $data_desc); + } + + $data = array (); + $data[0] = ''; + array_push ($table->data, $data); + + break; - - $table->colspan[2][0] = 3; - $data = array (); - $data[0] = ''; - array_push ($table->data, $data); - - break; - case 3: - case 'SLA': - - $table->style[1] = 'text-align: right'; - $data = array (); - $data[0] = '

'.__('S.L.A.').'

'; - $data[1] = '

'.human_time_description ($content['period']).'

';; - $n = array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[1][0] = 3; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $slas = get_db_all_rows_field_filter ('treport_content_sla_combined', - 'id_report_content', $content['id_rc']); - if ($slas === false) { + case 2: + case 'custom_graph': + //RUNNING + $graph = get_db_row ("tgraph", "id_graph", $content['id_gs']); + $data = array (); + $data[0] = '

'.__('Custom graph').'

'; + $data[1] = "

".$graph["name"]."

"; + $data[2] = "

".human_time_description ($content['period'])."

"; + array_push ($table->data, $data); + + // Put description at the end of the module (if exists) + if ($content["description"] != ""){ + $table->colspan[1][0] = 3; + $data_desc = array(); + $data_desc[0] = $content["description"]; + array_push ($table->data, $data_desc); + } + + $result = get_db_all_rows_field_filter ("tgraph_source", "id_graph", $content['id_gs']); + $modules = array (); + $weights = array (); + if ($result === false) + $result = array(); + + foreach ($result as $content2) { + array_push ($modules, $content2['id_agent_module']); + array_push ($weights, $content2["weight"]); + } + + $graph_width = get_db_sql ("SELECT width FROM tgraph WHERE id_graph = ".$content["id_gs"]); + $graph_height= get_db_sql ("SELECT height FROM tgraph WHERE id_graph = ".$content["id_gs"]); + + + $table->colspan[2][0] = 3; + $data = array (); + $data[0] = ''; + array_push ($table->data, $data); + + break; + case 3: + case 'SLA': + //RUNNING + $table->style[1] = 'text-align: right'; + $data = array (); + $data[0] = '

'.__('S.L.A.').'

'; + $data[1] = '

'.human_time_description ($content['period']).'

';; + $n = array_push ($table->data, $data); + + // Put description at the end of the module (if exists) + if ($content["description"] != ""){ + $table->colspan[1][0] = 3; + $data_desc = array(); + $data_desc[0] = $content["description"]; + array_push ($table->data, $data_desc); + } + + $slas = get_db_all_rows_field_filter ('treport_content_sla_combined', + 'id_report_content', $content['id_rc']); + if ($slas === false) { + $data = array (); + $table->colspan[2][0] = 3; + $data[0] = __('There are no SLAs defined'); + array_push ($table->data, $data); + $slas = array (); + } + + $sla_failed = false; + foreach ($slas as $sla) { + $data = array (); + + $data[0] = ''.__('Agent')." : "; + $data[0] .= get_agentmodule_agent_name ($sla['id_agent_module'])."
"; + $data[0] .= ''.__('Module')." : "; + $data[0] .= get_agentmodule_name ($sla['id_agent_module'])."
"; + $data[0] .= ''.__('SLA Max. (value)')." : "; + $data[0] .= $sla['sla_max']."
"; + $data[0] .= ''.__('SLA Min. (value)')." : "; + $data[0] .= $sla['sla_min']."
"; + $data[0] .= ''.__('SLA Limit')." : "; + $data[0] .= $sla['sla_limit']; + $sla_value = get_agentmodule_sla ($sla['id_agent_module'], $content['period'], + $sla['sla_min'], $sla['sla_max'], $report["datetime"]); + if ($sla_value === false) { + $data[1] = ''; + $data[1] .= __('Unknown'); + } else { + if ($sla_value >= $sla['sla_limit']) + $data[1] = ''; + else { + $sla_failed = true; + $data[1] = ''; + } + $data[1] .= format_numeric ($sla_value). " %"; + } + $data[1] .= ""; + + $n = array_push ($table->data, $data); + } + if (!empty ($slas)) { + $data = array (); + if ($sla_failed == false) + $data[0] = ''.__('OK').''; + else + $data[0] = ''.__('Fail').''; + $n = array_push ($table->data, $data); + $table->colspan[$n - 1][0] = 3; + $table->rowstyle[$n - 1] = 'text-align: right'; + } + + break; +// case 4: +// case 'event_report': +// $id_agent = get_agent_id ($agent_name); +// $data = array (); +// $data[0] = "

".__('Event report')."

"; +// $data[1] = "

".human_time_description ($content['period'])."

"; +// array_push ($table->data, $data); +// +// // Put description at the end of the module (if exists) +// if ($content["description"] != ""){ +// $table->colspan[1][0] = 3; +// $data_desc = array(); +// $data_desc[0] = $content["description"]; +// array_push ($table->data, $data_desc); +// } +// +// $table->colspan[2][0] = 3; +// $data = array (); +// $table_report = event_reporting ($report['id_group'], $content['period'], $report["datetime"], true); +// +// $table_report->class = 'databox'; +// $table_report->width = '100%'; +// $data[0] = print_table ($table_report, true); +// array_push ($table->data, $data); +// +// break; +// case 5: +// case 'alert_report': +// $data = array (); +// $data[0] = "

".__('Alert report')."

"; +// $data[1] = "

".$report["group_name"]."

"; +// $data[2] = "

".human_time_description ($content['period'])."

"; +// array_push ($table->data, $data); +// +// // Put description at the end of the module (if exists) +// if ($content["description"] != ""){ +// $table->colspan[1][0] = 3; +// $data_desc = array(); +// $data_desc[0] = $content["description"]; +// array_push ($table->data, $data_desc); +// } +// +// $data = array (); +// $table->colspan[2][0] = 3; +// $data[0] = alert_reporting ($report['id_group'], $content['period'], $report["datetime"], true); +// array_push ($table->data, $data); +// +// break; + case 6: + case 'monitor_report': + //RUNNING + $data = array (); + $data[0] = "

".__('Monitor report')."

"; + $data[1] = "

$agent_name - $module_name

"; + $data[2] = "

".human_time_description ($content['period'])."

"; + array_push ($table->data, $data); + + // Put description at the end of the module (if exists) + if ($content["description"] != ""){ + $table->colspan[1][0] = 3; + $data_desc = array(); + $data_desc[0] = $content["description"]; + array_push ($table->data, $data_desc); + } + + $data = array (); + $monitor_value = format_numeric (get_agentmodule_sla ($content['id_agent_module'], $content['period'], 1, false, $report["datetime"])); + $data[0] = '

'; + $data[0] .= $monitor_value.' %

'; + $monitor_value = format_numeric (100 - $monitor_value, 2) ; + $data[1] = '

'; + $data[1] .= $monitor_value.' %

'; + array_push ($table->data, $data); + + break; + case 7: + case 'avg_value': + //RUNNING + $data = array (); + $data[0] = "

".__('Avg. Value')."

"; + $data[1] = "

$agent_name - $module_name

"; + $data[2] = "

".human_time_description ($content['period'])."

"; + array_push ($table->data, $data); + + // Put description at the end of the module (if exists) + if ($content["description"] != ""){ + $table->colspan[1][0] = 3; + $data_desc = array(); + $data_desc[0] = $content["description"]; + array_push ($table->data, $data_desc); + } + $data = array (); $table->colspan[2][0] = 3; - $data[0] = __('There are no SLAs defined'); + $value = format_numeric (get_agentmodule_data_average ($content['id_agent_module'], $content['period'], $report["datetime"])); + $data[0] = '

'.$value.'

'; array_push ($table->data, $data); - $slas = array (); - } - - $sla_failed = false; - foreach ($slas as $sla) { - $data = array (); - $data[0] = ''.__('Agent')." : "; - $data[0] .= get_agentmodule_agent_name ($sla['id_agent_module'])."
"; - $data[0] .= ''.__('Module')." : "; - $data[0] .= get_agentmodule_name ($sla['id_agent_module'])."
"; - $data[0] .= ''.__('SLA Max. (value)')." : "; - $data[0] .= $sla['sla_max']."
"; - $data[0] .= ''.__('SLA Min. (value)')." : "; - $data[0] .= $sla['sla_min']."
"; - $data[0] .= ''.__('SLA Limit')." : "; - $data[0] .= $sla['sla_limit']; - $sla_value = get_agentmodule_sla ($sla['id_agent_module'], $content['period'], - $sla['sla_min'], $sla['sla_max'], $report["datetime"]); - if ($sla_value === false) { - $data[1] = ''; - $data[1] .= __('Unknown'); - } else { - if ($sla_value >= $sla['sla_limit']) - $data[1] = ''; - else { - $sla_failed = true; - $data[1] = ''; - } - $data[1] .= format_numeric ($sla_value). " %"; + break; + case 8: + case 'max_value': + //RUNNING + $data = array (); + $data[0] = "

".__('Max. Value')."

"; + $data[1] = "

$agent_name - $module_name

"; + $data[2] = "

".human_time_description ($content['period'])."

"; + array_push ($table->data, $data); + + // Put description at the end of the module (if exists) + if ($content["description"] != ""){ + $table->colspan[1][0] = 3; + $data_desc = array(); + $data_desc[0] = $content["description"]; + array_push ($table->data, $data_desc); } - $data[1] .= "
"; - $n = array_push ($table->data, $data); - } - if (!empty ($slas)) { $data = array (); - if ($sla_failed == false) - $data[0] = ''.__('OK').''; - else - $data[0] = ''.__('Fail').''; - $n = array_push ($table->data, $data); - $table->colspan[$n - 1][0] = 3; - $table->rowstyle[$n - 1] = 'text-align: right'; - } - - break; - case 4: - case 'event_report': - $id_agent = get_agent_id ($agent_name); - $data = array (); - $data[0] = "

".__('Event report')."

"; - $data[1] = "

".human_time_description ($content['period'])."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[1][0] = 3; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $table->colspan[2][0] = 3; - $data = array (); - $table_report = event_reporting ($report['id_group'], $content['period'], $report["datetime"], true); - - $table_report->class = 'databox'; - $table_report->width = '100%'; - $data[0] = print_table ($table_report, true); - array_push ($table->data, $data); - - break; - case 5: - case 'alert_report': - $data = array (); - $data[0] = "

".__('Alert report')."

"; - $data[1] = "

".$report["group_name"]."

"; - $data[2] = "

".human_time_description ($content['period'])."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[1][0] = 3; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $data = array (); - $table->colspan[2][0] = 3; - $data[0] = alert_reporting ($report['id_group'], $content['period'], $report["datetime"], true); - array_push ($table->data, $data); - - break; - case 6: - case 'monitor_report': - $data = array (); - $data[0] = "

".__('Monitor report')."

"; - $data[1] = "

$agent_name - $module_name

"; - $data[2] = "

".human_time_description ($content['period'])."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[1][0] = 3; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $data = array (); - $monitor_value = format_numeric (get_agentmodule_sla ($content['id_agent_module'], $content['period'], 1, false, $report["datetime"])); - $data[0] = '

'; - $data[0] .= $monitor_value.' %

'; - $monitor_value = format_numeric (100 - $monitor_value, 2) ; - $data[1] = '

'; - $data[1] .= $monitor_value.' %

'; - array_push ($table->data, $data); - - break; - case 7: - case 'avg_value': - $data = array (); - $data[0] = "

".__('Avg. Value')."

"; - $data[1] = "

$agent_name - $module_name

"; - $data[2] = "

".human_time_description ($content['period'])."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[1][0] = 3; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $data = array (); - $table->colspan[2][0] = 3; - $value = format_numeric (get_agentmodule_data_average ($content['id_agent_module'], $content['period'], $report["datetime"])); - $data[0] = '

'.$value.'

'; - array_push ($table->data, $data); - - break; - case 8: - case 'max_value': - $data = array (); - $data[0] = "

".__('Max. Value')."

"; - $data[1] = "

$agent_name - $module_name

"; - $data[2] = "

".human_time_description ($content['period'])."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[1][0] = 3; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $data = array (); - $table->colspan[2][0] = 3; - $value = format_numeric (get_agentmodule_data_max ($content['id_agent_module'], $content['period'], $report["datetime"])); - $data[0] = '

'.$value.'

'; - array_push ($table->data, $data); - - break; - case 9: - case 'min_value': - $data = array (); - $data[0] = "

".__('Min. Value')."

"; - $data[1] = "

$agent_name - $module_name

"; - $data[2] = "

".human_time_description ($content['period'])."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[0][0] = 2; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $data = array (); - $table->colspan[1][0] = 2; - $value = format_numeric (get_agentmodule_data_min ($content['id_agent_module'], $content['period'], $report["datetime"])); - $data[0] = '

'.$value.'

'; - array_push ($table->data, $data); - - break; - case 10: - case 'sumatory': - $data = array (); - $data[0] = "

".__('Sumatory')."

"; - $data[1] = "

$agent_name - $module_name

"; - $data[2] = "

".human_time_description ($content['period'])."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[0][0] = 2; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $data = array (); - $table->colspan[1][0] = 2; - $value = format_numeric (get_agentmodule_data_sum ($content['id_agent_module'], $content['period'], $report["datetime"])); - $data[0] = '

'.$value.'

'; - array_push ($table->data, $data); - - break; - case 11: - case 'general_group_report': - $data = array (); - $data[0] = "

".__('Group')."

"; - $data[1] = "

".$report["group_name"]."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[0][0] = 2; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $data = array (); - $table->colspan[1][0] = 2; - $data[0] = print_group_reporting ($report['id_group'], true); - array_push ($table->data, $data); - - break; - case 12: - case 'monitor_health': - $data = array (); - $data[0] = "

".__('Monitor health')."

"; - $data[1] = "

".$report["group_name"]."

"; - $data[2] = "

".human_time_description ($content['period'])."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[0][0] = 4; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $data = array (); - $table->colspan[1][0] = 4; - $data[0] = monitor_health_reporting ($report['id_group'], $content['period'], $report["datetime"], true); - array_push ($table->data, $data); - - break; - case 13: - case 'agents_detailed': - $data = array (); - $data[0] = "

".__('Agents detailed view')."

"; - $data[1] = "

".$report["group_name"]."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[0][0] = 2; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $table->colspan[0][0] = 2; - $data = array (); - $table->colspan[1][0] = 3; - $data[0] = get_group_agents_detailed_reporting ($report['id_group'], $content['period'], $report["datetime"], true); - array_push ($table->data, $data); - break; - - case 'agent_detailed_event': - $data = array (); - $data[0] = "

".__('Agent detailed event')."

"; - $data[1] = "

".get_agent_name($content['id_agent'])."

"; - array_push ($table->data, $data); - - // Put description at the end of the module (if exists) - if ($content["description"] != ""){ - $table->colspan[1][0] = 3; - $data_desc = array(); - $data_desc[0] = $content["description"]; - array_push ($table->data, $data_desc); - } - - $data = array (); - $table->colspan[2][0] = 3; - $data[0] = get_agents_detailed_event_reporting ($content['id_agent'], $content['period'], $report["datetime"]); - array_push ($table->data, $data); - break; + $table->colspan[2][0] = 3; + $value = format_numeric (get_agentmodule_data_max ($content['id_agent_module'], $content['period'], $report["datetime"])); + $data[0] = '

'.$value.'

'; + array_push ($table->data, $data); + + break; + case 9: + case 'min_value': + //RUNNING + $data = array (); + $data[0] = "

".__('Min. Value')."

"; + $data[1] = "

$agent_name - $module_name

"; + $data[2] = "

".human_time_description ($content['period'])."

"; + array_push ($table->data, $data); + + // Put description at the end of the module (if exists) + if ($content["description"] != ""){ + $table->colspan[0][0] = 2; + $data_desc = array(); + $data_desc[0] = $content["description"]; + array_push ($table->data, $data_desc); + } + + $data = array (); + $table->colspan[1][0] = 2; + $value = format_numeric (get_agentmodule_data_min ($content['id_agent_module'], $content['period'], $report["datetime"])); + $data[0] = '

'.$value.'

'; + array_push ($table->data, $data); + + break; + case 10: + case 'sumatory': + //RUNNING + $data = array (); + $data[0] = "

".__('Sumatory')."

"; + $data[1] = "

$agent_name - $module_name

"; + $data[2] = "

".human_time_description ($content['period'])."

"; + array_push ($table->data, $data); + + // Put description at the end of the module (if exists) + if ($content["description"] != ""){ + $table->colspan[0][0] = 2; + $data_desc = array(); + $data_desc[0] = $content["description"]; + array_push ($table->data, $data_desc); + } + + $data = array (); + $table->colspan[1][0] = 2; + $value = format_numeric (get_agentmodule_data_sum ($content['id_agent_module'], $content['period'], $report["datetime"])); + $data[0] = '

'.$value.'

'; + array_push ($table->data, $data); + + break; +// case 11: +// case 'general_group_report': +// $data = array (); +// $data[0] = "

".__('Group')."

"; +// $data[1] = "

".$report["group_name"]."

"; +// array_push ($table->data, $data); +// +// // Put description at the end of the module (if exists) +// if ($content["description"] != ""){ +// $table->colspan[0][0] = 2; +// $data_desc = array(); +// $data_desc[0] = $content["description"]; +// array_push ($table->data, $data_desc); +// } +// +// $data = array (); +// $table->colspan[1][0] = 2; +// $data[0] = print_group_reporting ($report['id_group'], true); +// array_push ($table->data, $data); +// +// break; +// case 12: +// case 'monitor_health': +// $data = array (); +// $data[0] = "

".__('Monitor health')."

"; +// $data[1] = "

".$report["group_name"]."

"; +// $data[2] = "

".human_time_description ($content['period'])."

"; +// array_push ($table->data, $data); +// +// // Put description at the end of the module (if exists) +// if ($content["description"] != ""){ +// $table->colspan[0][0] = 4; +// $data_desc = array(); +// $data_desc[0] = $content["description"]; +// array_push ($table->data, $data_desc); +// } +// +// $data = array (); +// $table->colspan[1][0] = 4; +// $data[0] = monitor_health_reporting ($report['id_group'], $content['period'], $report["datetime"], true); +// array_push ($table->data, $data); +// +// break; +// case 13: +// case 'agents_detailed': +// $data = array (); +// $data[0] = "

".__('Agents detailed view')."

"; +// $data[1] = "

".$report["group_name"]."

"; +// array_push ($table->data, $data); +// +// // Put description at the end of the module (if exists) +// if ($content["description"] != ""){ +// $table->colspan[0][0] = 2; +// $data_desc = array(); +// $data_desc[0] = $content["description"]; +// array_push ($table->data, $data_desc); +// } +// +// $table->colspan[0][0] = 2; +// $data = array (); +// $table->colspan[1][0] = 3; +// $data[0] = get_group_agents_detailed_reporting ($report['id_group'], $content['period'], $report["datetime"], true); +// array_push ($table->data, $data); +// break; + case 'agent_detailed_event': + case 'event_report_agent': + //RUNNING + $data = array (); + $data[0] = "

".__('Agent detailed event')."

"; + $data[1] = "

".get_agent_name($content['id_agent'])."

"; + array_push ($table->data, $data); + + // Put description at the end of the module (if exists) + if ($content["description"] != ""){ + $table->colspan[1][0] = 3; + $data_desc = array(); + $data_desc[0] = $content["description"]; + array_push ($table->data, $data_desc); + } + + $data = array (); + $table->colspan[2][0] = 3; + $data[0] = get_agents_detailed_event_reporting ($content['id_agent'], $content['period'], $report["datetime"]); + array_push ($table->data, $data); + break; } }