2010-04-27 Miguel de Dios <miguel.dedios@artica.es>

* 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
This commit is contained in:
mdtrooper 2010-04-27 10:51:17 +00:00
parent 304b7393c1
commit 1acd14b4e5
3 changed files with 402 additions and 385 deletions

View File

@ -1,9 +1,17 @@
2010-04-27 Miguel de Dios <miguel.dedios@artica.es>
* 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 <sergio.martin@artica.es> 2010-04-27 Sergio Martin <sergio.martin@artica.es>
* pandoradb_data.sql: Changed the group All values * pandoradb_data.sql: Changed the group All values
on tables with default group form 1 to 0 on tables with default group form 1 to 0
2010-04-26 Miguel de Dios <miguel.dedios@artica.es> 2010-04-27 Miguel de Dios <miguel.dedios@artica.es>
* operation/agentes/ver_agente.php: removed hack for translate "any" text. * operation/agentes/ver_agente.php: removed hack for translate "any" text.

View File

@ -619,11 +619,6 @@ function get_report_types () {
$types['min_value'] = __('Min. Value'); $types['min_value'] = __('Min. Value');
$types['sumatory'] = __('Sumatory'); $types['sumatory'] = __('Sumatory');
$types['agent_detailed'] = __('Agent detailed view'); $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['text'] = __('Text');
$types['sql'] = __('SQL query'); $types['sql'] = __('SQL query');
$types['url'] = __('Import text from URL'); $types['url'] = __('Import text from URL');
@ -632,15 +627,20 @@ function get_report_types () {
$types['TTO'] = __('TTO'); $types['TTO'] = __('TTO');
$types['MTBF'] = __('MTBF'); $types['MTBF'] = __('MTBF');
$types['MTTR'] = __('MTTR'); $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_pie_char'] = __('Agent detailed pie chart events');
// $types['agent_detailed_event_last_hours'] = __('Agent detailed event in last hours'); // $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_alert_last_hours'] = __('Agent detailed alerts in last hours');
// $types['agent_detailed_num_modules'] = __('Agent detailed num modules'); // $types['agent_detailed_num_modules'] = __('Agent detailed num modules');
// $types['agent_detailed_num_alerts'] = __('Agent detailed num alerts'); // $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; return $types;
} }

View File

@ -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; 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']); $agent_name = get_agentmodule_agent_name ($content['id_agent_module']);
switch ($content["type"]) { switch ($content["type"]) {
case 1: case 1:
case 'simple_graph': case 'simple_graph':
$table->colspan[1][0] = 4; //RUNNING
$data = array (); $table->colspan[1][0] = 4;
$data[0] = '<h4>'.__('Simple graph').'</h4>'; $data = array ();
$data[1] = '<h4>'.$agent_name.' - '.$module_name.'</h4>'; $data[0] = '<h4>'.__('Simple graph').'</h4>';
$data[2] = '<h4>'.human_time_description ($content['period']).'</h4>'; $data[1] = '<h4>'.$agent_name.' - '.$module_name.'</h4>';
array_push ($table->data, $data); $data[2] = '<h4>'.human_time_description ($content['period']).'</h4>';
array_push ($table->data, $data);
// Put description at the end of the module (if exists)
if ($content["description"] != ""){ // Put description at the end of the module (if exists)
$table->colspan[2][0] = 4; if ($content["description"] != ""){
$data_desc = array(); $table->colspan[2][0] = 4;
$data_desc[0] = $content["description"]; $data_desc = array();
array_push ($table->data, $data_desc); $data_desc[0] = $content["description"];
} array_push ($table->data, $data_desc);
}
$data = array ();
$data[0] = '<img src="include/fgraph.php?tipo=sparse&id='.$content['id_agent_module'].'&height=230&width=750&period='.$content['period'].'&date='.$report["datetime"].'&avg_only=1&pure=1" border="0" alt="">'; $data = array ();
array_push ($table->data, $data); $data[0] = '<img src="include/fgraph.php?tipo=sparse&id='.$content['id_agent_module'].'&height=230&width=750&period='.$content['period'].'&date='.$report["datetime"].'&avg_only=1&pure=1" border="0" alt="">';
array_push ($table->data, $data);
break;
case 2: break;
case 'custom_graph':
$graph = get_db_row ("tgraph", "id_graph", $content['id_gs']);
$data = array ();
$data[0] = '<h4>'.__('Custom graph').'</h4>';
$data[1] = "<h4>".$graph["name"]."</h4>";
$data[2] = "<h4>".human_time_description ($content['period'])."</h4>";
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 2:
$table->colspan[2][0] = 3; case 'custom_graph':
$data = array (); //RUNNING
$data[0] = '<img src="include/fgraph.php?tipo=combined&id='.implode (',', $modules).'&weight_l='.implode (',', $weights).'&height=235&width=750&period='.$content['period'].'&date='.$report["datetime"].'&stacked='.$graph["stacked"].'&pure=1" border="1" alt="">'; $graph = get_db_row ("tgraph", "id_graph", $content['id_gs']);
array_push ($table->data, $data); $data = array ();
$data[0] = '<h4>'.__('Custom graph').'</h4>';
break; $data[1] = "<h4>".$graph["name"]."</h4>";
case 3: $data[2] = "<h4>".human_time_description ($content['period'])."</h4>";
case 'SLA': array_push ($table->data, $data);
$table->style[1] = 'text-align: right'; // Put description at the end of the module (if exists)
$data = array (); if ($content["description"] != ""){
$data[0] = '<h4>'.__('S.L.A.').'</h4>'; $table->colspan[1][0] = 3;
$data[1] = '<h4>'.human_time_description ($content['period']).'</h4>';; $data_desc = array();
$n = array_push ($table->data, $data); $data_desc[0] = $content["description"];
array_push ($table->data, $data_desc);
// Put description at the end of the module (if exists) }
if ($content["description"] != ""){
$table->colspan[1][0] = 3; $result = get_db_all_rows_field_filter ("tgraph_source", "id_graph", $content['id_gs']);
$data_desc = array(); $modules = array ();
$data_desc[0] = $content["description"]; $weights = array ();
array_push ($table->data, $data_desc); if ($result === false)
} $result = array();
$slas = get_db_all_rows_field_filter ('treport_content_sla_combined', foreach ($result as $content2) {
'id_report_content', $content['id_rc']); array_push ($modules, $content2['id_agent_module']);
if ($slas === false) { 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] = '<img src="include/fgraph.php?tipo=combined&id='.implode (',', $modules).'&weight_l='.implode (',', $weights).'&height=235&width=750&period='.$content['period'].'&date='.$report["datetime"].'&stacked='.$graph["stacked"].'&pure=1" border="1" alt="">';
array_push ($table->data, $data);
break;
case 3:
case 'SLA':
//RUNNING
$table->style[1] = 'text-align: right';
$data = array ();
$data[0] = '<h4>'.__('S.L.A.').'</h4>';
$data[1] = '<h4>'.human_time_description ($content['period']).'</h4>';;
$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] = '<strong>'.__('Agent')."</strong> : ";
$data[0] .= get_agentmodule_agent_name ($sla['id_agent_module'])."<br />";
$data[0] .= '<strong>'.__('Module')."</strong> : ";
$data[0] .= get_agentmodule_name ($sla['id_agent_module'])."<br />";
$data[0] .= '<strong>'.__('SLA Max. (value)')."</strong> : ";
$data[0] .= $sla['sla_max']."<br />";
$data[0] .= '<strong>'.__('SLA Min. (value)')."</strong> : ";
$data[0] .= $sla['sla_min']."<br />";
$data[0] .= '<strong>'.__('SLA Limit')."</strong> : ";
$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] = '<span style="font: bold 3em Arial, Sans-serif; color: #0000FF;">';
$data[1] .= __('Unknown');
} else {
if ($sla_value >= $sla['sla_limit'])
$data[1] = '<span style="font: bold 3em Arial, Sans-serif; color: #000000;">';
else {
$sla_failed = true;
$data[1] = '<span style="font: bold 3em Arial, Sans-serif; color: #ff0000;">';
}
$data[1] .= format_numeric ($sla_value). " %";
}
$data[1] .= "</span>";
$n = array_push ($table->data, $data);
}
if (!empty ($slas)) {
$data = array ();
if ($sla_failed == false)
$data[0] = '<span style="font: bold 3em Arial, Sans-serif; color: #000000;">'.__('OK').'</span>';
else
$data[0] = '<span style="font: bold 3em Arial, Sans-serif; color: #ff0000;">'.__('Fail').'</span>';
$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] = "<h4>".__('Event report')."</h4>";
// $data[1] = "<h4>".human_time_description ($content['period'])."</h4>";
// 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] = "<h4>".__('Alert report')."</h4>";
// $data[1] = "<h4>".$report["group_name"]."</h4>";
// $data[2] = "<h4>".human_time_description ($content['period'])."</h4>";
// 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] = "<h4>".__('Monitor report')."</h4>";
$data[1] = "<h4>$agent_name - $module_name</h4>";
$data[2] = "<h4>".human_time_description ($content['period'])."</h4>";
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] = '<p style="font: bold 3em Arial, Sans-serif; color: #000000;">';
$data[0] .= $monitor_value.' % <img src="images/b_green.png" height="32" width="32" /></p>';
$monitor_value = format_numeric (100 - $monitor_value, 2) ;
$data[1] = '<p style="font: bold 3em Arial, Sans-serif; color: #ff0000;">';
$data[1] .= $monitor_value.' % <img src="images/b_red.png" height="32" width="32" /></p>';
array_push ($table->data, $data);
break;
case 7:
case 'avg_value':
//RUNNING
$data = array ();
$data[0] = "<h4>".__('Avg. Value')."</h4>";
$data[1] = "<h4>$agent_name - $module_name</h4>";
$data[2] = "<h4>".human_time_description ($content['period'])."</h4>";
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 (); $data = array ();
$table->colspan[2][0] = 3; $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] = '<p style="font: bold 3em Arial, Sans-serif; color: #000000;">'.$value.'</p>';
array_push ($table->data, $data); array_push ($table->data, $data);
$slas = array ();
}
$sla_failed = false;
foreach ($slas as $sla) {
$data = array ();
$data[0] = '<strong>'.__('Agent')."</strong> : "; break;
$data[0] .= get_agentmodule_agent_name ($sla['id_agent_module'])."<br />"; case 8:
$data[0] .= '<strong>'.__('Module')."</strong> : "; case 'max_value':
$data[0] .= get_agentmodule_name ($sla['id_agent_module'])."<br />"; //RUNNING
$data[0] .= '<strong>'.__('SLA Max. (value)')."</strong> : "; $data = array ();
$data[0] .= $sla['sla_max']."<br />"; $data[0] = "<h4>".__('Max. Value')."</h4>";
$data[0] .= '<strong>'.__('SLA Min. (value)')."</strong> : "; $data[1] = "<h4>$agent_name - $module_name</h4>";
$data[0] .= $sla['sla_min']."<br />"; $data[2] = "<h4>".human_time_description ($content['period'])."</h4>";
$data[0] .= '<strong>'.__('SLA Limit')."</strong> : "; array_push ($table->data, $data);
$data[0] .= $sla['sla_limit'];
$sla_value = get_agentmodule_sla ($sla['id_agent_module'], $content['period'], // Put description at the end of the module (if exists)
$sla['sla_min'], $sla['sla_max'], $report["datetime"]); if ($content["description"] != ""){
if ($sla_value === false) { $table->colspan[1][0] = 3;
$data[1] = '<span style="font: bold 3em Arial, Sans-serif; color: #0000FF;">'; $data_desc = array();
$data[1] .= __('Unknown'); $data_desc[0] = $content["description"];
} else { array_push ($table->data, $data_desc);
if ($sla_value >= $sla['sla_limit'])
$data[1] = '<span style="font: bold 3em Arial, Sans-serif; color: #000000;">';
else {
$sla_failed = true;
$data[1] = '<span style="font: bold 3em Arial, Sans-serif; color: #ff0000;">';
}
$data[1] .= format_numeric ($sla_value). " %";
} }
$data[1] .= "</span>";
$n = array_push ($table->data, $data);
}
if (!empty ($slas)) {
$data = array (); $data = array ();
if ($sla_failed == false) $table->colspan[2][0] = 3;
$data[0] = '<span style="font: bold 3em Arial, Sans-serif; color: #000000;">'.__('OK').'</span>'; $value = format_numeric (get_agentmodule_data_max ($content['id_agent_module'], $content['period'], $report["datetime"]));
else $data[0] = '<p style="font: bold 3em Arial, Sans-serif; color: #000000;">'.$value.'</p>';
$data[0] = '<span style="font: bold 3em Arial, Sans-serif; color: #ff0000;">'.__('Fail').'</span>'; array_push ($table->data, $data);
$n = array_push ($table->data, $data);
$table->colspan[$n - 1][0] = 3; break;
$table->rowstyle[$n - 1] = 'text-align: right'; case 9:
} case 'min_value':
//RUNNING
break; $data = array ();
case 4: $data[0] = "<h4>".__('Min. Value')."</h4>";
case 'event_report': $data[1] = "<h4>$agent_name - $module_name</h4>";
$id_agent = get_agent_id ($agent_name); $data[2] = "<h4>".human_time_description ($content['period'])."</h4>";
$data = array (); array_push ($table->data, $data);
$data[0] = "<h4>".__('Event report')."</h4>";
$data[1] = "<h4>".human_time_description ($content['period'])."</h4>"; // Put description at the end of the module (if exists)
array_push ($table->data, $data); if ($content["description"] != ""){
$table->colspan[0][0] = 2;
// Put description at the end of the module (if exists) $data_desc = array();
if ($content["description"] != ""){ $data_desc[0] = $content["description"];
$table->colspan[1][0] = 3; array_push ($table->data, $data_desc);
$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"]));
$table->colspan[2][0] = 3; $data[0] = '<p style="font: bold 3em Arial, Sans-serif; color: #000000;">'.$value.'</p>';
$data = array (); array_push ($table->data, $data);
$table_report = event_reporting ($report['id_group'], $content['period'], $report["datetime"], true);
break;
$table_report->class = 'databox'; case 10:
$table_report->width = '100%'; case 'sumatory':
$data[0] = print_table ($table_report, true); //RUNNING
array_push ($table->data, $data); $data = array ();
$data[0] = "<h4>".__('Sumatory')."</h4>";
break; $data[1] = "<h4>$agent_name - $module_name</h4>";
case 5: $data[2] = "<h4>".human_time_description ($content['period'])."</h4>";
case 'alert_report': array_push ($table->data, $data);
$data = array ();
$data[0] = "<h4>".__('Alert report')."</h4>"; // Put description at the end of the module (if exists)
$data[1] = "<h4>".$report["group_name"]."</h4>"; if ($content["description"] != ""){
$data[2] = "<h4>".human_time_description ($content['period'])."</h4>"; $table->colspan[0][0] = 2;
array_push ($table->data, $data); $data_desc = array();
$data_desc[0] = $content["description"];
// Put description at the end of the module (if exists) array_push ($table->data, $data_desc);
if ($content["description"] != ""){ }
$table->colspan[1][0] = 3;
$data_desc = array(); $data = array ();
$data_desc[0] = $content["description"]; $table->colspan[1][0] = 2;
array_push ($table->data, $data_desc); $value = format_numeric (get_agentmodule_data_sum ($content['id_agent_module'], $content['period'], $report["datetime"]));
} $data[0] = '<p style="font: bold 3em Arial, Sans-serif; color: #000000;">'.$value.'</p>';
array_push ($table->data, $data);
$data = array ();
$table->colspan[2][0] = 3; break;
$data[0] = alert_reporting ($report['id_group'], $content['period'], $report["datetime"], true); // case 11:
array_push ($table->data, $data); // case 'general_group_report':
// $data = array ();
break; // $data[0] = "<h4>".__('Group')."</h4>";
case 6: // $data[1] = "<h4>".$report["group_name"]."</h4>";
case 'monitor_report': // array_push ($table->data, $data);
$data = array (); //
$data[0] = "<h4>".__('Monitor report')."</h4>"; // // Put description at the end of the module (if exists)
$data[1] = "<h4>$agent_name - $module_name</h4>"; // if ($content["description"] != ""){
$data[2] = "<h4>".human_time_description ($content['period'])."</h4>"; // $table->colspan[0][0] = 2;
array_push ($table->data, $data); // $data_desc = array();
// $data_desc[0] = $content["description"];
// Put description at the end of the module (if exists) // array_push ($table->data, $data_desc);
if ($content["description"] != ""){ // }
$table->colspan[1][0] = 3; //
$data_desc = array(); // $data = array ();
$data_desc[0] = $content["description"]; // $table->colspan[1][0] = 2;
array_push ($table->data, $data_desc); // $data[0] = print_group_reporting ($report['id_group'], true);
} // array_push ($table->data, $data);
//
$data = array (); // break;
$monitor_value = format_numeric (get_agentmodule_sla ($content['id_agent_module'], $content['period'], 1, false, $report["datetime"])); // case 12:
$data[0] = '<p style="font: bold 3em Arial, Sans-serif; color: #000000;">'; // case 'monitor_health':
$data[0] .= $monitor_value.' % <img src="images/b_green.png" height="32" width="32" /></p>'; // $data = array ();
$monitor_value = format_numeric (100 - $monitor_value, 2) ; // $data[0] = "<h4>".__('Monitor health')."</h4>";
$data[1] = '<p style="font: bold 3em Arial, Sans-serif; color: #ff0000;">'; // $data[1] = "<h4>".$report["group_name"]."</h4>";
$data[1] .= $monitor_value.' % <img src="images/b_red.png" height="32" width="32" /></p>'; // $data[2] = "<h4>".human_time_description ($content['period'])."</h4>";
array_push ($table->data, $data); // array_push ($table->data, $data);
//
break; // // Put description at the end of the module (if exists)
case 7: // if ($content["description"] != ""){
case 'avg_value': // $table->colspan[0][0] = 4;
$data = array (); // $data_desc = array();
$data[0] = "<h4>".__('Avg. Value')."</h4>"; // $data_desc[0] = $content["description"];
$data[1] = "<h4>$agent_name - $module_name</h4>"; // array_push ($table->data, $data_desc);
$data[2] = "<h4>".human_time_description ($content['period'])."</h4>"; // }
array_push ($table->data, $data); //
// $data = array ();
// Put description at the end of the module (if exists) // $table->colspan[1][0] = 4;
if ($content["description"] != ""){ // $data[0] = monitor_health_reporting ($report['id_group'], $content['period'], $report["datetime"], true);
$table->colspan[1][0] = 3; // array_push ($table->data, $data);
$data_desc = array(); //
$data_desc[0] = $content["description"]; // break;
array_push ($table->data, $data_desc); // case 13:
} // case 'agents_detailed':
// $data = array ();
$data = array (); // $data[0] = "<h4>".__('Agents detailed view')."</h4>";
$table->colspan[2][0] = 3; // $data[1] = "<h4>".$report["group_name"]."</h4>";
$value = format_numeric (get_agentmodule_data_average ($content['id_agent_module'], $content['period'], $report["datetime"])); // array_push ($table->data, $data);
$data[0] = '<p style="font: bold 3em Arial, Sans-serif; color: #000000;">'.$value.'</p>'; //
array_push ($table->data, $data); // // Put description at the end of the module (if exists)
// if ($content["description"] != ""){
break; // $table->colspan[0][0] = 2;
case 8: // $data_desc = array();
case 'max_value': // $data_desc[0] = $content["description"];
$data = array (); // array_push ($table->data, $data_desc);
$data[0] = "<h4>".__('Max. Value')."</h4>"; // }
$data[1] = "<h4>$agent_name - $module_name</h4>"; //
$data[2] = "<h4>".human_time_description ($content['period'])."</h4>"; // $table->colspan[0][0] = 2;
array_push ($table->data, $data); // $data = array ();
// $table->colspan[1][0] = 3;
// Put description at the end of the module (if exists) // $data[0] = get_group_agents_detailed_reporting ($report['id_group'], $content['period'], $report["datetime"], true);
if ($content["description"] != ""){ // array_push ($table->data, $data);
$table->colspan[1][0] = 3; // break;
$data_desc = array(); case 'agent_detailed_event':
$data_desc[0] = $content["description"]; case 'event_report_agent':
array_push ($table->data, $data_desc); //RUNNING
} $data = array ();
$data[0] = "<h4>".__('Agent detailed event')."</h4>";
$data = array (); $data[1] = "<h4>".get_agent_name($content['id_agent'])."</h4>";
$table->colspan[2][0] = 3; array_push ($table->data, $data);
$value = format_numeric (get_agentmodule_data_max ($content['id_agent_module'], $content['period'], $report["datetime"]));
$data[0] = '<p style="font: bold 3em Arial, Sans-serif; color: #000000;">'.$value.'</p>'; // Put description at the end of the module (if exists)
array_push ($table->data, $data); if ($content["description"] != ""){
$table->colspan[1][0] = 3;
break; $data_desc = array();
case 9: $data_desc[0] = $content["description"];
case 'min_value': array_push ($table->data, $data_desc);
$data = array (); }
$data[0] = "<h4>".__('Min. Value')."</h4>";
$data[1] = "<h4>$agent_name - $module_name</h4>"; $data = array ();
$data[2] = "<h4>".human_time_description ($content['period'])."</h4>"; $table->colspan[2][0] = 3;
array_push ($table->data, $data); $data[0] = get_agents_detailed_event_reporting ($content['id_agent'], $content['period'], $report["datetime"]);
array_push ($table->data, $data);
// Put description at the end of the module (if exists) break;
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] = '<p style="font: bold 3em Arial, Sans-serif; color: #000000;">'.$value.'</p>';
array_push ($table->data, $data);
break;
case 10:
case 'sumatory':
$data = array ();
$data[0] = "<h4>".__('Sumatory')."</h4>";
$data[1] = "<h4>$agent_name - $module_name</h4>";
$data[2] = "<h4>".human_time_description ($content['period'])."</h4>";
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] = '<p style="font: bold 3em Arial, Sans-serif; color: #000000;">'.$value.'</p>';
array_push ($table->data, $data);
break;
case 11:
case 'general_group_report':
$data = array ();
$data[0] = "<h4>".__('Group')."</h4>";
$data[1] = "<h4>".$report["group_name"]."</h4>";
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] = "<h4>".__('Monitor health')."</h4>";
$data[1] = "<h4>".$report["group_name"]."</h4>";
$data[2] = "<h4>".human_time_description ($content['period'])."</h4>";
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] = "<h4>".__('Agents detailed view')."</h4>";
$data[1] = "<h4>".$report["group_name"]."</h4>";
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] = "<h4>".__('Agent detailed event')."</h4>";
$data[1] = "<h4>".get_agent_name($content['id_agent'])."</h4>";
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;
} }
} }