2008-07-07 Esteban Sanchez <estebans@artica.es>

* godmode/reporting/graph_builder.php: Tab style correction.

        * godmode/reporting/reporting_builder.php: Button label renamed.

        * include/functions_db.php: Added functions from
        functions_reporting.php.

        * include/functions_reporting.php: Added missing documentation. Added
        check to avoid division by zero on alert_reporting(). Avoid $return
        flag as parameter in some functions.

        * include/functions_reporting_pdf.php: Avoid $return flag when calling 
        some functions.

        * operation/reporting/reporting_viewer.php: Do not use a span with 
        font-size when showing sla report.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@937 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Esteban Sanchez 2008-07-07 13:16:13 +00:00
parent 485207a9d7
commit 0daf8ebf1d
7 changed files with 297 additions and 148 deletions

View File

@ -1,3 +1,22 @@
2008-07-07 Esteban Sanchez <estebans@artica.es>
* godmode/reporting/graph_builder.php: Tab style correction.
* godmode/reporting/reporting_builder.php: Button label renamed.
* include/functions_db.php: Added functions from
functions_reporting.php.
* include/functions_reporting.php: Added missing documentation. Added
check to avoid division by zero on alert_reporting(). Avoid $return
flag as parameter in some functions.
* include/functions_reporting_pdf.php: Avoid $return flag when calling
some functions.
* operation/reporting/reporting_viewer.php: Do not use a span with
font-size when showing sla report.
2008-07-04 Esteban Sanchez <estebans@artica.es> 2008-07-04 Esteban Sanchez <estebans@artica.es>
* operation/reporting/reporting_viewer.php: Added a loading div that * operation/reporting/reporting_viewer.php: Added a loading div that

View File

@ -40,13 +40,13 @@ if (comprueba_login() != 0) {
exit; exit;
} }
if ((give_acl($id_user,0,"AW") != 1 ) AND (dame_admin($id_user)!=1)) { if ((give_acl($id_user,0,"AW") != 1 ) && (dame_admin($id_user)!=1)) {
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access graph builder"); audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access graph builder");
include ("general/noaccess.php"); include ("general/noaccess.php");
exit; exit;
} }
if (isset($_GET["store_graph"])){ if (isset($_GET["store_graph"])) {
$name = entrada_limpia($_POST["name"]); $name = entrada_limpia($_POST["name"]);
$description = entrada_limpia($_POST["description"]); $description = entrada_limpia($_POST["description"]);
$module_number = entrada_limpia($_POST["module_number"]); $module_number = entrada_limpia($_POST["module_number"]);
@ -339,35 +339,50 @@ echo "<input type='text' name='height' value='$height' size=6>";
switch ($period) { switch ($period) {
case 3600: $period_label = "Hour"; case 3600:
$period_label = "Hour";
break; break;
case 7200: $period_label = "2 Hours"; case 7200:
$period_label = "2 Hours";
break; break;
case 10800: $period_label = "3 Hours"; case 10800:
$period_label = "3 Hours";
break; break;
case 21600: $period_label = "6 Hours"; case 21600:
$period_label = "6 Hours";
break; break;
case 43200: $period_label = "12 Hours"; case 43200:
$period_label = "12 Hours";
break; break;
case 86400: $period_label = "Day"; case 86400:
$period_label = "Day";
break; break;
case 172800: $period_label = "Two days"; case 172800:
$period_label = "Two days";
break; break;
case 345600: $period_label = "Four days"; case 345600:
$period_label = "Four days";
break; break;
case 604800: $period_label = "Last Week"; case 604800:
$period_label = "Last Week";
break; break;
case 1296000: $period_label = "15 Days"; case 1296000:
$period_label = "15 Days";
break; break;
case 2592000: $period_label = "Last Month"; case 2592000:
$period_label = "Last Month";
break; break;
case 5184000: $period_label = "Two Month"; case 5184000:
$period_label = "Two Month";
break; break;
case 15552000: $period_label = "Six Months"; case 15552000:
$period_label = "Six Months";
break; break;
case 31104000: $period_label = "One year"; case 31104000:
$period_label = "One year";
break; break;
default: $period_label = "Day"; default:
$period_label = "Day";
} }

View File

@ -514,7 +514,7 @@ if ($edit_sla_report_content) {
echo '<form method="post" action="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder">'; echo '<form method="post" action="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder">';
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';
print_input_hidden ('edit_report', 1); print_input_hidden ('edit_report', 1);
print_submit_button (lang_string ('add'), 'create', false, 'class="sub next"'); print_submit_button (lang_string ('Create report'), 'create', false, 'class="sub next"');
echo "</div>"; echo "</div>";
echo "</form>"; echo "</form>";
} }

View File

@ -549,6 +549,61 @@ function get_monitor_last_down_timestamp_in_period ($id_agent_module, $period, $
return get_db_sql ($sql); return get_db_sql ($sql);
} }
/**
* Get all the monitors defined in an group.
*
* @param id_group Group id to get all the monitors.
*
* @return An array with all the monitors defined in the group (tagente_modulo).
*/
function get_monitors_in_group ($id_group) {
$sql = sprintf ('SELECT tagente_modulo.*
FROM tagente_modulo, ttipo_modulo, tagente
WHERE id_tipo_modulo = id_tipo
AND tagente.id_agente = tagente_modulo.id_agente
AND ttipo_modulo.nombre like "%%_proc"
AND tagente.id_grupo = %d', $id_group);
return get_db_all_rows_sql ($sql);
}
/**
* Get all the monitors defined in an agent.
*
* @param id_agent Agent id to get all the monitors.
*
* @return An array with all the monitors defined (tagente_modulo).
*/
function get_monitors_in_agent ($id_agent) {
$sql = sprintf ('SELECT tagente_modulo.*
FROM tagente_modulo, ttipo_modulo, tagente
WHERE id_tipo_modulo = id_tipo
AND tagente.id_agente = tagente_modulo.id_agente
AND ttipo_modulo.nombre like "%%_proc"
AND tagente.id_agente = %d', $id_agent);
return get_db_all_rows_sql ($sql);
}
/**
* Get all the monitors down during a period of time.
*
* @param monitors An array with all the monitors to check. Each
* element of the array must be a dictionary.
* @param period Period of time to check the monitors.
* @param date Beginning date to check the monitors.
*
* @return An array with all the monitors that went down in that
* period of time.
*/
function get_monitors_down ($monitors, $period = 0, $date = 0) {
$monitors_down = array ();
foreach ($monitors as $monitor) {
$down = get_monitor_downs_in_period ($monitor['id_agente_modulo'], $period, $date);
if ($down)
array_push ($monitors_down, $monitor);
}
return $monitors_down;
}
/** /**
* Get all the times an alerts fired during a period. * Get all the times an alerts fired during a period.
* *
@ -570,6 +625,53 @@ function get_alert_fires_in_period ($id_agent_module, $period, $date = 0) {
return (int) get_db_sql ($sql); return (int) get_db_sql ($sql);
} }
/**
* Get all the alerts defined in a group.
*
* It gets all the alerts of all the agents on a given group.
*
* @param id_group Group id to check.
*
* @return An array with alerts dictionaries defined in a group.
*/
function get_alerts_in_group ($id_group) {
$alerts = array ();
$agents = get_agents_in_group ($id_group);
foreach ($agents as $agent) {
$agent_alerts = get_alerts_in_agent ($agent['id_agente']);
$alerts = array_merge ($alerts, $agent_alerts);
}
return $alerts;
}
/**
* Get all the alerts fired during a period, given a list of alerts.
*
* @param alerts A list of alerts to check. See get_alerts_in_group()
* @param period Period of time to check fired alerts.
* @param date Beginning date to check fired alerts in UNIX format (current date by default)
*
* @return An array with the alert id as key and the number of times
* the alert was fired (only included if it was fired).
*/
function get_alerts_fired ($alerts, $period = 0, $date = 0) {
if (! $date)
$date = time ();
$datelimit = $date - $period;
$alerts_fired = array ();
$agents = array ();
foreach ($alerts as $alert) {
$fires = get_alert_fires_in_period ($alert['id_agente_modulo'], $period, $date);
if (! $fires) {
continue;
}
$alerts_fired[$alert['id_aam']] = $fires;
}
return $alerts_fired;
}
/** /**
* Get the last time an alert fired during a period. * Get the last time an alert fired during a period.
* *

View File

@ -16,6 +16,17 @@
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/**
* Get SLA of a module.
*
* @param id_agent_module Agent module to calculate SLA
* @param period Period to check the SLA compliance.
* @param min_value Minimum data value the module in the right interval
* @param max_value Maximum data value the module in the right interval
* @param date Beginning date of the report in UNIX time (current date by default).
*
* @return SLA percentage of the requested module.
*/
function get_agent_module_sla ($id_agent_module, $period, $min_value, $max_value, $date = 0) { function get_agent_module_sla ($id_agent_module, $period, $min_value, $max_value, $date = 0) {
require("config.php"); require("config.php");
if (! $date) if (! $date)
@ -76,7 +87,15 @@ function get_agent_module_sla ($id_agent_module, $period, $min_value, $max_value
return max ($result, 0); return max ($result, 0);
} }
function general_stats ( $id_user, $id_group = 0) { /**
* Get a general stats info.
*
* @param id_user
* @param id_group
*
* @return
*/
function general_stats ($id_user, $id_group = 0) {
if ($id_group <= 0) if ($id_group <= 0)
// Get group list that user has access // Get group list that user has access
$mis_grupos = list_group2 ($id_user); $mis_grupos = list_group2 ($id_user);
@ -190,6 +209,19 @@ function general_stats ( $id_user, $id_group = 0) {
return $data; return $data;
} }
/**
* Get an event reporting table.
*
* It construct a table object with all the events happened in a group
* during a period of time.
*
* @param id_group Group id to get the report.
* @param period Period of time to get the report.
* @param date Beginning date of the report in UNIX time (current date by default).
* @param return Flag to return or echo the report table (echo by default).
*
* @return A table object if return variable is true.
*/
function event_reporting ($id_group, $period, $date = 0, $return = false) { function event_reporting ($id_group, $period, $date = 0, $return = false) {
global $config; global $config;
@ -228,35 +260,14 @@ function event_reporting ($id_group, $period, $date = 0, $return = false) {
return $table; return $table;
} }
function get_alerts_in_group ($id_group) { /**
$alerts = array (); * Get a table report from a alerts fired array.
$agents = get_agents_in_group ($id_group); *
foreach ($agents as $agent) { * @param alerts_fired Alerts fired array. See get_alerts_fired()
$agent_alerts = get_alerts_in_agent ($agent['id_agente']); *
$alerts = array_merge ($alerts, $agent_alerts); * @return A table object with a report of the fired alerts.
} */
function get_fired_alerts_reporting_table ($alerts_fired) {
return $alerts;
}
function get_alerts_fired ($alerts, $period = 0, $date = 0) {
if (! $date)
$date = time ();
$datelimit = $date - $period;
$alerts_fired = array ();
$agents = array ();
foreach ($alerts as $alert) {
$fires = get_alert_fires_in_period ($alert['id_agente_modulo'], $period, $date);
if (! $fires) {
continue;
}
$alerts_fired[$alert['id_aam']] = $fires;
}
return $alerts_fired;
}
function get_fired_alerts_reporting_table ($alerts_fired, $return = false) {
$agents = array (); $agents = array ();
foreach (array_keys ($alerts_fired) as $id_alert) { foreach (array_keys ($alerts_fired) as $id_alert) {
@ -291,8 +302,6 @@ function get_fired_alerts_reporting_table ($alerts_fired, $return = false) {
} }
} }
if (!$return)
print_table ($table);
return $table; return $table;
} }
@ -305,13 +314,15 @@ function get_fired_alerts_reporting_table ($alerts_fired, $return = false) {
* @param $id_group Group to get info of the alerts. * @param $id_group Group to get info of the alerts.
* @param $period Period of time of the desired alert report. * @param $period Period of time of the desired alert report.
* @param $date Beggining date of the report (current date by default). * @param $date Beggining date of the report (current date by default).
* @param $return Flag to return or echo the report (by default). * @param $return Flag to return or echo the report (echo by default).
*/ */
function alert_reporting ($id_group, $period = 0, $date = 0, $return = false) { function alert_reporting ($id_group, $period = 0, $date = 0, $return = false) {
$output = ''; $output = '';
$alerts = get_alerts_in_group ($id_group); $alerts = get_alerts_in_group ($id_group);
$alerts_fired = get_alerts_fired ($alerts, $period, $date); $alerts_fired = get_alerts_fired ($alerts, $period, $date);
$fired_percentage = 0;
if (sizeof ($alerts) > 0)
$fired_percentage = round (sizeof ($alerts_fired) / sizeof ($alerts) * 100, 2); $fired_percentage = round (sizeof ($alerts_fired) / sizeof ($alerts) * 100, 2);
$not_fired_percentage = 100 - $fired_percentage; $not_fired_percentage = 100 - $fired_percentage;
$output .= '<img src="reporting/fgraph.php?tipo=alerts_fired_pipe&height=150&width=280&fired='. $output .= '<img src="reporting/fgraph.php?tipo=alerts_fired_pipe&height=150&width=280&fired='.
@ -325,7 +336,7 @@ function alert_reporting ($id_group, $period = 0, $date = 0, $return = false) {
echo $output; echo $output;
return $output; return $output;
} }
$table = get_fired_alerts_reporting_table ($alerts_fired, true); $table = get_fired_alerts_reporting_table ($alerts_fired);
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox'; $table->class = 'databox';
$table->size = array (); $table->size = array ();
@ -334,6 +345,7 @@ function alert_reporting ($id_group, $period = 0, $date = 0, $return = false) {
$table->style[0] = 'font-weight: bold'; $table->style[0] = 'font-weight: bold';
$output .= print_table ($table, true); $output .= print_table ($table, true);
if (!$return) if (!$return)
echo $output; echo $output;
return $output; return $output;
@ -347,7 +359,7 @@ function alert_reporting ($id_group, $period = 0, $date = 0, $return = false) {
* *
* @param $id_group Group to get info of the monitors. * @param $id_group Group to get info of the monitors.
* @param $period Period of time of the desired monitor report. * @param $period Period of time of the desired monitor report.
* @param $date Beggining date of the report (current date by default). * @param $date Beginning date of the report in UNIX time (current date by default).
* @param $return Flag to return or echo the report (by default). * @param $return Flag to return or echo the report (by default).
*/ */
function monitor_health_reporting ($id_group, $period = 0, $date = 0, $return = false) { function monitor_health_reporting ($id_group, $period = 0, $date = 0, $return = false) {
@ -368,7 +380,7 @@ function monitor_health_reporting ($id_group, $period = 0, $date = 0, $return =
$output .= '<strong>'.lang_string ('total_monitors').': '.sizeof ($monitors).'</strong><br />'; $output .= '<strong>'.lang_string ('total_monitors').': '.sizeof ($monitors).'</strong><br />';
$output .= '<strong>'.lang_string ('monitors_down_on_period').': '.sizeof ($monitors_down).'</strong><br />'; $output .= '<strong>'.lang_string ('monitors_down_on_period').': '.sizeof ($monitors_down).'</strong><br />';
$table = get_monitors_down_reporting_table ($monitors_down, true); $table = get_monitors_down_reporting_table ($monitors_down);
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox'; $table->class = 'databox';
$table->size = array (); $table->size = array ();
@ -386,17 +398,15 @@ function monitor_health_reporting ($id_group, $period = 0, $date = 0, $return =
return $output; return $output;
} }
function get_monitors_down ($monitors, $period = 0, $date = 0) { /**
$monitors_down = array (); * Get a report table with all the monitors down.
foreach ($monitors as $monitor) { *
$down = get_monitor_downs_in_period ($monitor['id_agente_modulo'], $period, $date); * @param monitors_down An array with all the monitors down. See
if ($down) * get_monitors_down()
array_push ($monitors_down, $monitor); *
} * @return A table object with a monitors down report.
return $monitors_down; */
} function get_monitors_down_reporting_table ($monitors_down) {
function get_monitors_down_reporting_table ($monitors_down, $return = false) {
$table->data = array (); $table->data = array ();
$table->head = array (); $table->head = array ();
$table->head[0] = lang_string ('agent'); $table->head[0] = lang_string ('agent');
@ -429,8 +439,6 @@ function get_monitors_down_reporting_table ($monitors_down, $return = false) {
} }
} }
if (!$return)
print_table ($table);
return $table; return $table;
} }
@ -452,27 +460,16 @@ function general_group_reporting ($id_group, $return = false) {
return $output; return $output;
} }
function get_monitors_in_group ($id_group) { /**
$sql = sprintf ('SELECT tagente_modulo.* * Get a report table of the fired alerts group by agents.
FROM tagente_modulo, ttipo_modulo, tagente *
WHERE id_tipo_modulo = id_tipo * @param id_agent Agent id to generate the report.
AND tagente.id_agente = tagente_modulo.id_agente * @param period Period of time of the report.
AND ttipo_modulo.nombre like "%%_proc" * @param date Beginning date of the report in UNIX time (current date by default).
AND tagente.id_grupo = %d', $id_group); *
return get_db_all_rows_sql ($sql); * @return A table object with the alert reporting..
} */
function get_agent_alerts_reporting_table ($id_agent, $period = 0, $date = 0) {
function get_monitors_in_agent ($id_agent) {
$sql = sprintf ('SELECT tagente_modulo.*
FROM tagente_modulo, ttipo_modulo, tagente
WHERE id_tipo_modulo = id_tipo
AND tagente.id_agente = tagente_modulo.id_agente
AND ttipo_modulo.nombre like "%%_proc"
AND tagente.id_agente = %d', $id_agent);
return get_db_all_rows_sql ($sql);
}
function get_agent_alerts_reporting_table ($id_agent, $period = 0, $date = 0, $return = false) {
$table->data = array (); $table->data = array ();
$table->head = array (); $table->head = array ();
$table->head[0] = lang_string ('type'); $table->head[0] = lang_string ('type');
@ -501,12 +498,19 @@ function get_agent_alerts_reporting_table ($id_agent, $period = 0, $date = 0, $r
array_push ($table->data, $data); array_push ($table->data, $data);
} }
if (!$return)
print_table ($table);
return $table; return $table;
} }
function get_agent_monitors_reporting_table ($id_agent, $period = 0, $date = 0, $return = false) { /**
* Get a report of monitors in an agent.
*
* @param id_agent Agent id to get the report
* @param period Period of time of the report.
* @param date Beginning date of the report in UNIX time (current date by default).
*
* @return A table object with the report.
*/
function get_agent_monitors_reporting_table ($id_agent, $period = 0, $date = 0) {
$n_a_string = lang_string ('N/A').'(*)'; $n_a_string = lang_string ('N/A').'(*)';
$table->head = array (); $table->head = array ();
$table->head[0] = lang_string ('monitor'); $table->head[0] = lang_string ('monitor');
@ -527,12 +531,20 @@ function get_agent_monitors_reporting_table ($id_agent, $period = 0, $date = 0,
$data[1] = get_monitor_last_down_timestamp_in_period ($monitor['id_agente_modulo'], $period, $date); $data[1] = get_monitor_last_down_timestamp_in_period ($monitor['id_agente_modulo'], $period, $date);
array_push ($table->data, $data); array_push ($table->data, $data);
} }
if (!$return)
print_table ($table);
return $table; return $table;
} }
function get_agent_modules_reporting_table ($id_agent, $period = 0, $date = 0, $return = false) { /**
* Get a report of all the modules in an agent.
*
* @param id_agent Agent id to get the report.
* @param period Period of time of the report
* @param date Beginning date of the report in UNIX time (current date by default).
*
* @return
*/
function get_agent_modules_reporting_table ($id_agent, $period = 0, $date = 0) {
$table->data = array (); $table->data = array ();
$n_a_string = lang_string ('N/A').'(*)'; $n_a_string = lang_string ('N/A').'(*)';
$modules = get_modules_in_agent ($id_agent); $modules = get_modules_in_agent ($id_agent);
@ -545,8 +557,7 @@ function get_agent_modules_reporting_table ($id_agent, $period = 0, $date = 0, $
$data[0] = $module['nombre']; $data[0] = $module['nombre'];
array_push ($table->data, $data); array_push ($table->data, $data);
} }
if (!$return)
print_table ($table);
return $table; return $table;
} }
@ -555,7 +566,7 @@ function get_agent_modules_reporting_table ($id_agent, $period = 0, $date = 0, $
* *
* @param $id_agent Agent to get the report. * @param $id_agent Agent to get the report.
* @param $period Period of time of the desired report. * @param $period Period of time of the desired report.
* @param $date Beggining date of the report (current date by default). * @param $date Beginning date of the report in UNIX time (current date by default).
* @param $return Flag to return or echo the report (by default). * @param $return Flag to return or echo the report (by default).
*/ */
function get_agent_detailed_reporting ($id_agent, $period = 0, $date = 0, $return = false) { function get_agent_detailed_reporting ($id_agent, $period = 0, $date = 0, $return = false) {
@ -566,12 +577,12 @@ function get_agent_detailed_reporting ($id_agent, $period = 0, $date = 0, $retur
$output .= '<div class="agent_reporting">'; $output .= '<div class="agent_reporting">';
$output .= '<h3 style="text-decoration: underline">'.lang_string ('agent').' - '.dame_nombre_agente ($id_agent).'</h3>'; $output .= '<h3 style="text-decoration: underline">'.lang_string ('agent').' - '.dame_nombre_agente ($id_agent).'</h3>';
$output .= '<h4>'.lang_string ('modules').'</h3>'; $output .= '<h4>'.lang_string ('modules').'</h3>';
$table_modules = get_agent_modules_reporting_table ($id_agent, $period, $date, true); $table_modules = get_agent_modules_reporting_table ($id_agent, $period, $date);
$table_modules->width = '99%'; $table_modules->width = '99%';
$output .= print_table ($table_modules, true); $output .= print_table ($table_modules, true);
/* Show alerts in agent */ /* Show alerts in agent */
$table_alerts = get_agent_alerts_reporting_table ($id_agent, $period, $date, true); $table_alerts = get_agent_alerts_reporting_table ($id_agent, $period, $date);
$table_alerts->width = '99%'; $table_alerts->width = '99%';
if (sizeof ($table_alerts->data)) { if (sizeof ($table_alerts->data)) {
$output .= '<h4>'.lang_string ('alerts').'</h4>'; $output .= '<h4>'.lang_string ('alerts').'</h4>';
@ -579,7 +590,7 @@ function get_agent_detailed_reporting ($id_agent, $period = 0, $date = 0, $retur
} }
/* Show monitor status in agent (if any) */ /* Show monitor status in agent (if any) */
$table_monitors = get_agent_monitors_reporting_table ($id_agent, $period, $date, true); $table_monitors = get_agent_monitors_reporting_table ($id_agent, $period, $date);
if (sizeof ($table_monitors->data) == 0) { if (sizeof ($table_monitors->data) == 0) {
$output .= '</div>'; $output .= '</div>';
if (! $return) if (! $return)

View File

@ -234,7 +234,7 @@ function get_pdf_report ($report) {
$pdf->ezText ('<b>'.lang_string ('total_alerts_monitored').': '.sizeof ($alerts).'</b>', 8); $pdf->ezText ('<b>'.lang_string ('total_alerts_monitored').': '.sizeof ($alerts).'</b>', 8);
$pdf->ezText ("\n", 8); $pdf->ezText ("\n", 8);
$table_alerts = get_fired_alerts_reporting_table ($alerts_fired, true); $table_alerts = get_fired_alerts_reporting_table ($alerts_fired);
$pdf->ezTable ($table_alerts->data, $table_alerts->head, $pdf->ezTable ($table_alerts->data, $table_alerts->head,
"", $table_options); "", $table_options);
unset ($alerts); unset ($alerts);
@ -310,7 +310,7 @@ function get_pdf_report ($report) {
$pdf->ezText ('<b>'.lang_string ('monitors_down_on_period').': '.sizeof ($monitors_down).'</b>', 8); $pdf->ezText ('<b>'.lang_string ('monitors_down_on_period').': '.sizeof ($monitors_down).'</b>', 8);
$pdf->ezText ("\n", 8); $pdf->ezText ("\n", 8);
$table_monitors = get_monitors_down_reporting_table ($monitors_down, true); $table_monitors = get_monitors_down_reporting_table ($monitors_down);
$pdf->ezTable ($table_monitors->data, $table_monitors->head, $pdf->ezTable ($table_monitors->data, $table_monitors->head,
"", $table_options); "", $table_options);
unset ($monitors); unset ($monitors);
@ -323,19 +323,19 @@ function get_pdf_report ($report) {
$group_name.' '.lang_string ('group')); $group_name.' '.lang_string ('group'));
foreach ($agents as $agent) { foreach ($agents as $agent) {
$pdf->ezText ("<b>".$agent['nombre']."</b>", 18); $pdf->ezText ("<b>".$agent['nombre']."</b>", 18);
$table = get_agent_modules_reporting_table ($agent['id_agente'], $content['period'], 0, true); $table = get_agent_modules_reporting_table ($agent['id_agente'], $content['period']);
$pdf->ezText ("<b>".lang_string ('modules')."</b>", 12); $pdf->ezText ("<b>".lang_string ('modules')."</b>", 12);
$pdf->ezText ("\n", 3); $pdf->ezText ("\n", 3);
$pdf->ezTable ($table->data, array (lang_string ('name')), "", $table_options); $pdf->ezTable ($table->data, array (lang_string ('name')), "", $table_options);
$table = get_agent_alerts_reporting_table ($agent['id_agente'], $content['period'], 0, true); $table = get_agent_alerts_reporting_table ($agent['id_agente'], $content['period']);
if (sizeof ($table->data)) { if (sizeof ($table->data)) {
$pdf->ezText ("<b>".lang_string ('alerts')."</b>", 12); $pdf->ezText ("<b>".lang_string ('alerts')."</b>", 12);
$pdf->ezText ("\n", 3); $pdf->ezText ("\n", 3);
$pdf->ezTable ($table->data, $table->head, "", $table_options); $pdf->ezTable ($table->data, $table->head, "", $table_options);
} }
$table = get_agent_monitors_reporting_table ($agent['id_agente'], $content['period'], 0, true); $table = get_agent_monitors_reporting_table ($agent['id_agente'], $content['period']);
if (sizeof ($table->data)) { if (sizeof ($table->data)) {
$pdf->ezText ("<b>".lang_string ('monitors')."</b>", 12); $pdf->ezText ("<b>".lang_string ('monitors')."</b>", 12);
$pdf->ezText ("\n", 3); $pdf->ezText ("\n", 3);

View File

@ -202,12 +202,14 @@ foreach ($contents as $content) {
$data = array (); $data = array ();
$table->colspan[$n][0] = 2; $table->colspan[$n][0] = 2;
$data[0] = '<span style="font-size: 0.6em">'; $data[0] = '<strong>'.lang_string ('agent')."</strong> : ";
$data[0] .= lang_string ('agent')." : ".dame_nombre_agente_agentemodulo ($sla['id_agent_module'])."<br />"; $data[0] .= dame_nombre_agente_agentemodulo ($sla['id_agent_module'])."<br />";
$data[0] .= lang_string ('module')." : ".dame_nombre_modulo_agentemodulo ($sla['id_agent_module'])."<br />"; $data[0] .= '<strong>'.lang_string ('module')."</strong> : ";
$data[0] .= lang_string ('sla_max')." : ".$sla['sla_max']."<br />"; $data[0] .= dame_nombre_modulo_agentemodulo ($sla['id_agent_module'])."<br />";
$data[0] .= lang_string ('sla_min')." : ".$sla['sla_min']."<br />"; $data[0] .= '<strong>'.lang_string ('sla_max')."</strong> : ";
$data[0] .= "</span>"; $data[0] .= $sla['sla_max']."<br />";
$data[0] .= '<strong>'.lang_string ('sla_min')."</strong> : ";
$data[0] .= $sla['sla_min']."<br />";
$sla_value = get_agent_module_sla ($sla['id_agent_module'], $content['period'], $sla_value = get_agent_module_sla ($sla['id_agent_module'], $content['period'],
$sla['sla_min'], $sla['sla_max'], $datetime); $sla['sla_min'], $sla['sla_max'], $datetime);