2011-04-13 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_graph.php, include/functions_reporting.php,
	operation/incidents/incident_statistics.php,
	operation/agentes/custom_fields.php, operation/agentes/agent_fields.php,
	operation/servers/view_server_detail.php,
	operation/integria_incidents/incident_statistics.php,
	operation/events/event_statistics.php, operation/events/events_list.php,
	operation/events/events.php, operation/reporting/reporting_xml.php,
	godmode/admin_access_logs.php, godmode/db/db_main.php,
	godmode/db/db_info.php, godmode/db/db_purge.php,
	godmode/reporting/graph_builder.main.php,
	godmode/reporting/visual_console_builder.editor.js,
	godmode/reporting/graph_builder.php,
	godmode/reporting/graph_builder.graph_editor.php,
	godmode/reporting/graph_builder.preview.php: changed for to use new engine.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4216 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-04-13 17:31:06 +00:00
parent 50cc94d201
commit 855d9a6970
21 changed files with 496 additions and 158 deletions

View File

@ -1,3 +1,20 @@
2011-04-13 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_graph.php, include/functions_reporting.php,
operation/incidents/incident_statistics.php,
operation/agentes/custom_fields.php, operation/agentes/agent_fields.php,
operation/servers/view_server_detail.php,
operation/integria_incidents/incident_statistics.php,
operation/events/event_statistics.php, operation/events/events_list.php,
operation/events/events.php, operation/reporting/reporting_xml.php,
godmode/admin_access_logs.php, godmode/db/db_main.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/reporting/graph_builder.main.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/graph_builder.php,
godmode/reporting/graph_builder.graph_editor.php,
godmode/reporting/graph_builder.preview.php: changed for to use new engine.
2011-04-13 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_ui.php

View File

@ -21,6 +21,8 @@ if ($config['flash_charts']) {
require_once ("include/fgraph.php");
}
require_once ($config["homedir"] . '/include/functions_graph.php');
check_login ();
$enterprise_include = enterprise_include_once('godmode/admin_access_logs.php');
@ -75,12 +77,15 @@ print_table($table);
echo '</form>';
echo '</div>';
echo '<div style="float: right; width: 250px;">';
echo graphic_user_activity2(300, 140);
/*
if ($config['flash_charts']) {
echo graphic_user_activity (300, 140);
}
else {
echo '<img src="include/fgraph.php?tipo=user_activity&width=300&height=140" />';
}
}*/
echo '</div>';
echo '<div style="clear:both;">&nbsp;</div>';
echo '</td></tr></table>';

View File

@ -20,10 +20,6 @@ global $config;
require_once ($config["homedir"] . '/include/functions_graph.php');
if ($config['flash_charts']) {
require('include/fgraph.php');
}
ui_print_page_header (__('Database maintenance').' &raquo; '.__('Database information'), "images/god8.png", false, "", true);
check_login ();

View File

@ -17,10 +17,6 @@
// Load global vars
global $config;
if ($config['flash_charts']) {
require_once ("include/fgraph.php");
}
check_login ();
if (! check_acl ($config['id_user'], 0, "DM")) {

View File

@ -20,10 +20,6 @@ global $config;
require_once ($config["homedir"] . '/include/functions_graph.php');
if ($config['flash_charts']) {
require('include/fgraph.php');
}
check_login ();
if (! check_acl ($config['id_user'], 0, "DM")) {

View File

@ -15,10 +15,6 @@
global $config;
if ($config['flash_charts']) {
require_once ('include/fgraph.php');
}
check_login ();
if (! check_acl ($config['id_user'], 0, "IW")) {

View File

@ -44,10 +44,6 @@ if (is_ajax ()) {
return;
}
if ($config['flash_charts']) {
require_once ('include/fgraph.php');
}
check_login ();
if (! check_acl ($config['id_user'], 0, "IW")) {

View File

@ -44,10 +44,6 @@ if (is_ajax ()) {
return;
}
if ($config['flash_charts']) {
require_once ('include/fgraph.php');
}
check_login ();
if (! check_acl ($config['id_user'], 0, "IW")) {

View File

@ -46,10 +46,6 @@ if (is_ajax ()) {
return;
}
if ($config['flash_charts']) {
require_once ('include/fgraph.php');
}
check_login ();
if (! check_acl ($config['id_user'], 0, "IW")) {

View File

@ -626,9 +626,6 @@ function getModuleGraph(id_data) {
}
});
// var img = 'include/fgraph.php?tipo=sparse&id=' + id_agente_modulo +
// '&label=' + Base64.encode(label) + '&height=' + height + '&pure=1&width=' + width + '&period=' + period;
return img;
}

View File

@ -803,14 +803,6 @@ function grafico_db_agentes_purge2 ($id_agent, $width, $height) {
return pie3d_graph($config['flash_charts'], $data, $width, $height);
////////////////////////
if (! $graphic_type) {
return fs_3d_pie_chart ($data, $width, $height);
}
generic_pie_graph ($width, $height, $data);
}
/**
@ -837,14 +829,6 @@ function grafico_db_agentes_paquetes2($width = 380, $height = 300) {
}
return hbar_graph($config['flash_charts'], $data, $width, $height, array(), $legend);
/////////////////////////////////////
if (! $graphic_type) {
return fs_3d_bar_chart ($data, $width, $height);
}
generic_horizontal_bar_graph ($width, $height, $data, $legend);
}
/**
@ -892,15 +876,420 @@ function graph_db_agentes_modulos2($width, $height) {
}
return hbar_graph($config['flash_charts'], $data, $width, $height);
/////////////////////////////////////
}
if (! $graphic_type) {
return fs_3d_bar_chart ($data, $width, $height);
/**
* Print a pie graph with users activity in a period of time
*
* @param integer width pie graph width
* @param integer height pie graph height
* @param integer period time period
*/
function graphic_user_activity2 ($width = 350, $height = 230) {
global $config;
global $graphic_type;
$data = array ();
$max_items = 5;
switch ($config['dbtype']) {
case "mysql":
case "postgresql":
$sql = sprintf ('SELECT COUNT(id_usuario) n_incidents, id_usuario
FROM tsesion
GROUP BY id_usuario
ORDER BY 1 DESC LIMIT %d', $max_items);
break;
case "oracle":
$sql = sprintf ('SELECT COUNT(id_usuario) n_incidents, id_usuario
FROM tsesion
WHERE rownum <= %d
GROUP BY id_usuario
ORDER BY 1 DESC', $max_items);
break;
}
$logins = get_db_all_rows_sql ($sql);
if($logins == false) {
$logins = array();
}
foreach ($logins as $login) {
$data[$login['id_usuario']] = $login['n_incidents'];
}
return pie3d_graph($config['flash_charts'], $data, $width, $height);
}
/**
* Print a pie graph with priodity incident
*/
function grafico_incidente_prioridad2 () {
global $config;
global $graphic_type;
$data_tmp = array (0, 0, 0, 0, 0, 0);
$sql = 'SELECT COUNT(id_incidencia) n_incidents, prioridad
FROM tincidencia
GROUP BY prioridad
ORDER BY 2 DESC';
$incidents = get_db_all_rows_sql ($sql);
generic_horizontal_bar_graph ($width, $height, $data);
if($incidents == false) {
$incidents = array();
}
foreach ($incidents as $incident) {
if ($incident['prioridad'] < 5)
$data_tmp[$incident['prioridad']] = $incident['n_incidents'];
else
$data_tmp[5] += $incident['n_incidents'];
}
$data = array (__('Informative') => $data_tmp[0],
__('Low') => $data_tmp[1],
__('Medium') => $data_tmp[2],
__('Serious') => $data_tmp[3],
__('Very serious') => $data_tmp[4],
__('Maintenance') => $data_tmp[5]);
return pie3d_graph($config['flash_charts'], $data, 320, 200);
}
/**
* Print a pie graph with incidents data
*/
function graph_incidents_status2 () {
global $config;
global $graphic_type;
$data = array (0, 0, 0, 0);
$data = array ();
$data[__('Open incident')] = 0;
$data[__('Closed incident')] = 0;
$data[__('Outdated')] = 0;
$data[__('Invalid')] = 0;
$incidents = get_db_all_rows_filter ('tincidencia',
array ('estado' => array (0, 2, 3, 13)),
array ('estado'));
if ($incidents === false)
$incidents = array ();
foreach ($incidents as $incident) {
if ($incident["estado"] == 0)
$data[__("Open incident")]++;
if ($incident["estado"] == 2)
$data[__("Closed incident")]++;
if ($incident["estado"] == 3)
$data[__("Outdated")]++;
if ($incident["estado"] == 13)
$data[__("Invalid")]++;
}
return pie3d_graph($config['flash_charts'], $data, 370, 180);
}
/**
* Print a pie graph with incident data by group
*/
function graphic_incident_group2 () {
global $config;
global $graphic_type;
$data = array ();
$max_items = 5;
$sql = sprintf ('SELECT COUNT(id_incidencia) n_incidents, nombre
FROM tincidencia,tgrupo
WHERE tgrupo.id_grupo = tincidencia.id_grupo
GROUP BY tgrupo.id_grupo ORDER BY 1 DESC LIMIT %d',
$max_items);
$incidents = get_db_all_rows_sql ($sql);
if($incidents == false) {
$incidents = array();
}
foreach ($incidents as $incident) {
$data[$incident['nombre']] = $incident['n_incidents'];
}
return pie3d_graph($config['flash_charts'], $data, 320, 200);
}
/**
* Print a graph with access data of agents
*
* @param integer id_agent Agent ID
* @param integer width pie graph width
* @param integer height pie graph height
* @param integer period time period
*/
function graphic_incident_user2 () {
global $config;
global $graphic_type;
$data = array ();
$max_items = 5;
$sql = sprintf ('SELECT COUNT(id_incidencia) n_incidents, id_usuario
FROM tincidencia
GROUP BY id_usuario
ORDER BY 1 DESC LIMIT %d', $max_items);
$incidents = get_db_all_rows_sql ($sql);
if($incidents == false) {
$incidents = array();
}
foreach ($incidents as $incident) {
if($incident['id_usuario'] == false) {
$name = __('System');
}
else {
$name = $incident['id_usuario'];
}
$data[$name] = $incident['n_incidents'];
}
return pie3d_graph($config['flash_charts'], $data, 320, 200);
}
/**
* Print a pie graph with access data of incidents source
*
* @param integer width pie graph width
* @param integer height pie graph height
*/
function graphic_incident_source2($width = 320, $height = 200) {
global $config;
global $graphic_type;
$data = array ();
$max_items = 5;
switch ($config["dbtype"]) {
case "mysql":
$sql = sprintf ('SELECT COUNT(id_incidencia) n_incident, origen
FROM tincidencia GROUP BY `origen`
ORDER BY 1 DESC LIMIT %d', $max_items);
break;
case "postgresql":
$sql = sprintf ('SELECT COUNT(id_incidencia) n_incident, origen
FROM tincidencia GROUP BY "origen"
ORDER BY 1 DESC LIMIT %d', $max_items);
break;
case "oracle":
$sql = sprintf ('SELECT COUNT(id_incidencia) n_incident, origen
FROM tincidencia WHERE rownum <= %d GROUP BY origen
ORDER BY 1 DESC', $max_items);
break;
}
$origins = get_db_all_rows_sql ($sql);
if($origins == false) {
$origins = array();
}
foreach ($origins as $origin) {
$data[$origin['origen']] = $origin['n_incident'];
}
return pie3d_graph($config['flash_charts'], $data, $width, $height);
}
/**
* Print a pie graph with events data of group
*
* @param integer width pie graph width
* @param integer height pie graph height
* @param string url
*/
function grafico_eventos_grupo2 ($width = 300, $height = 200, $url = "") {
global $config;
global $graphic_type;
$url = html_entity_decode (rawurldecode ($url), ENT_QUOTES); //It was urlencoded, so we urldecode it
$data = array ();
$loop = 0;
define ('NUM_PIECES_PIE', 6);
$badstrings = array (";", "SELECT ", "DELETE ", "UPDATE ", "INSERT ", "EXEC");
//remove bad strings from the query so queries like ; DELETE FROM don't pass
$url = str_ireplace ($badstrings, "", $url);
//This will give the distinct id_agente, give the id_grupo that goes
//with it and then the number of times it occured. GROUP BY statement
//is required if both DISTINCT() and COUNT() are in the statement
switch ($config["dbtype"]) {
case "mysql":
case "postgresql":
$sql = sprintf ('SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count
FROM tevento WHERE 1=1 %s
GROUP BY id_agente ORDER BY count DESC', $url);
break;
case "oracle":
$sql = sprintf ('SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count
FROM tevento WHERE 1=1 %s
GROUP BY id_agente, id_grupo ORDER BY count DESC', $url);
break;
}
$result = get_db_all_rows_sql ($sql);
if ($result === false) {
$result = array();
}
foreach ($result as $row) {
if (!check_acl ($config["id_user"], $row["id_grupo"], "AR") == 1)
continue;
if ($loop >= NUM_PIECES_PIE) {
if (!isset ($data[__('Other')]))
$data[__('Other')] = 0;
$data[__('Other')] += $row["count"];
} else {
if ($row["id_agente"] == 0) {
$name = __('SYSTEM')." (".$row["count"].")";
} else {
$name = mb_substr (get_agent_name ($row["id_agente"], "lower"), 0, 14)." (".$row["count"].")";
}
$data[$name] = $row["count"];
}
$loop++;
}
return pie3d_graph($config['flash_charts'], $data, $width, $height);
}
/**
* Print a pie graph with events data in 320x200 size
*
* @param string filter Filter for query in DB
*/
function grafico_eventos_total2($filter = "") {
global $config;
global $graphic_type;
$filter = str_replace ( "\\" , "", $filter);
$data = array ();
$legend = array ();
$total = 0;
$sql = "SELECT COUNT(id_evento) FROM tevento WHERE criticity = 0 $filter";
$data[__('Maintenance')] = get_db_sql ($sql);
$sql = "SELECT COUNT(id_evento) FROM tevento WHERE criticity = 1 $filter";
$data[__('Informational')] = get_db_sql ($sql);
$sql = "SELECT COUNT(id_evento) FROM tevento WHERE criticity = 2 $filter";
$data[__('Normal')] = get_db_sql ($sql);
$sql = "SELECT COUNT(id_evento) FROM tevento WHERE criticity = 3 $filter";
$data[__('Warning')] = get_db_sql ($sql);
$sql = "SELECT COUNT(id_evento) FROM tevento WHERE criticity = 4 $filter";
$data[__('Critical')] = get_db_sql ($sql);
asort ($data);
return pie3d_graph($config['flash_charts'], $data, 320, 200);
}
/**
* Print a pie graph with events data of users
*
* @param integer height pie graph height
* @param integer period time period
*/
function grafico_eventos_usuario2 ($width, $height) {
global $config;
global $graphic_type;
$data = array ();
$max_items = 5;
switch ($config["dbtype"]) {
case "mysql":
case "postgresql":
$sql = sprintf ('SELECT COUNT(id_evento) events, id_usuario
FROM tevento
GROUP BY id_usuario
ORDER BY 1 DESC LIMIT %d', $max_items);
break;
case "oracle":
$sql = sprintf ('SELECT * FROM (SELECT COUNT(id_evento) events, id_usuario
FROM tevento
GROUP BY id_usuario
ORDER BY 1 DESC) WHERE rownum <= %d', $max_items);
break;
}
$events = get_db_all_rows_sql ($sql);
if ($events === false) {
$events = array();
}
return pie3d_graph($config['flash_charts'], $data, $width, $height);
}
/**
* Print a pie graph with events data of group
*
* @param integer width pie graph width
* @param integer height pie graph height
* @param string url
*/
function grafico_eventos_grupo2 ($width = 300, $height = 200, $url = "") {
global $config;
global $graphic_type;
$url = html_entity_decode (rawurldecode ($url), ENT_QUOTES); //It was urlencoded, so we urldecode it
$data = array ();
$loop = 0;
define ('NUM_PIECES_PIE', 6);
$badstrings = array (";", "SELECT ", "DELETE ", "UPDATE ", "INSERT ", "EXEC");
//remove bad strings from the query so queries like ; DELETE FROM don't pass
$url = str_ireplace ($badstrings, "", $url);
//This will give the distinct id_agente, give the id_grupo that goes
//with it and then the number of times it occured. GROUP BY statement
//is required if both DISTINCT() and COUNT() are in the statement
switch ($config["dbtype"]) {
case "mysql":
case "postgresql":
$sql = sprintf ('SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count
FROM tevento WHERE 1=1 %s
GROUP BY id_agente ORDER BY count DESC', $url);
break;
case "oracle":
$sql = sprintf ('SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count
FROM tevento WHERE 1=1 %s
GROUP BY id_agente, id_grupo ORDER BY count DESC', $url);
break;
}
$result = get_db_all_rows_sql ($sql);
if ($result === false) {
$result = array();
}
foreach ($result as $row) {
if (!check_acl ($config["id_user"], $row["id_grupo"], "AR") == 1)
continue;
if ($loop >= NUM_PIECES_PIE) {
if (!isset ($data[__('Other')]))
$data[__('Other')] = 0;
$data[__('Other')] += $row["count"];
} else {
if ($row["id_agente"] == 0) {
$name = __('SYSTEM')." (".$row["count"].")";
} else {
$name = mb_substr (get_agent_name ($row["id_agente"], "lower"), 0, 14)." (".$row["count"].")";
}
$data[$name] = $row["count"];
}
$loop++;
}
if (! $graphic_type) {
return fs_3d_pie_chart ($data, $width, $height);
}
error_reporting (0);
generic_pie_graph ($width, $height, $data, array ('show_legend' => false));
}
?>

View File

@ -1184,6 +1184,8 @@ function alert_reporting_module ($id_agent_module, $period = 0, $date = 0, $retu
* @return string
*/
function alert_reporting ($id_group, $period = 0, $date = 0, $return = false) {
global $config;
$output = '';
$alerts = get_group_alerts ($id_group);
$alerts_fired = get_alerts_fired ($alerts, $period, $date);
@ -1192,9 +1194,13 @@ function alert_reporting ($id_group, $period = 0, $date = 0, $return = false) {
if (sizeof ($alerts) > 0)
$fired_percentage = round (sizeof ($alerts_fired) / sizeof ($alerts) * 100, 2);
$not_fired_percentage = 100 - $fired_percentage;
$output .= '<img src="include/fgraph.php?tipo=alerts_fired_pipe&height=150&width=280&fired='.
$fired_percentage.'&not_fired='.$not_fired_percentage.'" style="float: right; border: 1px solid black">';
$data = array ();
$data[__('Alerts fired')] = $fired_percentage;
$data[__('Alerts not fired')] = $not_fired_percentage;
$output .= pie3d_graph($config['flash_charts'], $data, 280, 150);
$output .= '<strong>'.__('Alerts fired').': '.sizeof ($alerts_fired).'</strong><br />';
$output .= '<strong>'.__('Total alerts monitored').': '.sizeof ($alerts).'</strong><br />';
@ -2043,6 +2049,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
$sla_value = get_agentmodule_sla ($sla['id_agent_module'], $content['period'],
$sla['sla_min'], $sla['sla_max'], $report["datetime"], $content, $content['time_from'],
$content['time_to']);
//Fill the array data_graph for the pie graph
if ($sla_value === false) {
$data_graph[__('Unknown')]++;

View File

@ -20,10 +20,6 @@ global $config;
require_once ("include/functions_agents.php");
if ($config['flash_charts']) {
require_once ("include/fgraph.php");
}
check_login ();
$id_agente = get_parameter_get ("id_agente", -1);

View File

@ -20,10 +20,6 @@ global $config;
require_once ("include/functions_agents.php");
if ($config['flash_charts']) {
require_once ("include/fgraph.php");
}
check_login ();
$id_agente = get_parameter_get ("id_agente", -1);

View File

@ -19,7 +19,7 @@
// Load global vars
global $config;
require_once ("include/fgraph.php");
require_once ($config["homedir"] . '/include/functions_graph.php');
check_login ();
@ -33,26 +33,17 @@ ui_print_page_header (__('Statistics'), "images/lightning_go.png",false, false);
echo "<table width=95%>";
echo "<tr><td valign='top'>";
echo "<h3>".__('Event graph')."</h3>";
if ($config['flash_charts']) {
echo grafico_eventos_total ();
} else {
echo '<img src="include/fgraph.php?tipo=total_events&width=300&height=200" border=0>';
}
echo grafico_eventos_total2();
echo "</td><td valign='top'>";
echo "<h3>".__('Event graph by user')."</h3>";
if ($config['flash_charts']) {
echo grafico_eventos_usuario (300, 200);
} else {
echo '<img src="include/fgraph.php?tipo=user_events&width=300&height=200" border=0>';
}
echo grafico_eventos_usuario2(300, 200);
echo "</td></tr>";
echo "<tr><td>";
echo "<h3>".__('Event graph by group')."</h3>";
if ($config['flash_charts']) {
echo grafico_eventos_grupo (300, 200);
} else {
echo '<img src="include/fgraph.php?tipo=group_events&width=300&height=200" border=0>';
}
echo grafico_eventos_grupo2(300, 200);
echo '</td></tr>';
echo "</table>";
?>

View File

@ -149,10 +149,6 @@ if (is_ajax ()) {
return;
}
if ($config['flash_charts']) {
require_once ("include/fgraph.php");
}
$offset = (int) get_parameter ("offset", 0);
$ev_group = (int) get_parameter ("ev_group", 0); //0 = all
$event_type = get_parameter ("event_type", ''); // 0 all

View File

@ -20,6 +20,8 @@ global $config;
require_once ("include/functions_events.php"); //Event processing functions
require_once ("include/functions_alerts.php"); //Alerts processing functions
require_once ($config["homedir"] . '/include/functions_graph.php');
check_login ();
if (! check_acl ($config["id_user"], 0, "IR")) {
@ -234,11 +236,7 @@ print_submit_button (__('Update'), '', false, 'class="sub upd"');
echo "</td></tr></table></form>"; //This is the filter div
echo '<div style="width:220px; float:left;">';
if ($config['flash_charts']) {
echo grafico_eventos_grupo (220, 180, rawurlencode ($sql_post));
} else {
print_image ("include/fgraph.php?tipo=group_events&width=220&height=180&url=".rawurlencode ($sql_post), false, array ("border" => 0));
}
echo grafico_eventos_grupo2(220, 180, rawurlencode ($sql_post));
echo '</div>';
echo '<div id="steps_clean">&nbsp;</div>';
echo '</div>';

View File

@ -16,7 +16,8 @@
// Load global vars
global $config;
require_once ("include/fgraph.php");
require_once ($config["homedir"] . '/include/functions_graph.php');
check_login ();
@ -29,39 +30,19 @@ ui_print_page_header (__('Statistics'), "images/book_edit.png", false, "", false
echo '<table width="90%">
<tr><td valign="top"><h3>'.__('Incidents by status').'</h3>';
if ($config['flash_charts']) {
echo graph_incidents_status ();
}
else {
echo '<img src="include/fgraph.php?tipo=estado_incidente" border="0"></td>';
}
echo graph_incidents_status2 ();
echo '<td valign="top"><h3>'.__('Incidents by priority').'</h3>';
if ($config['flash_charts']) {
echo grafico_incidente_prioridad ();
}
else {
echo '<img src="include/fgraph.php?tipo=prioridad_incidente" border="0"></td></tr>';
}
echo grafico_incidente_prioridad2 ();
echo '<tr><td><h3>'.__('Incidents by group').'</h3>';
if ($config['flash_charts']) {
echo grafico_incidente_prioridad ();
}
else {
echo '<img src="include/fgraph.php?tipo=group_incident" border="0"></td>';
}
echo graphic_incident_group2();
echo '<td><h3>'.__('Incidents by user').'</h3>';
if ($config['flash_charts']) {
echo grafico_incidente_prioridad ();
}
else {
echo '<img src="include/fgraph.php?tipo=user_incident" border="0"></td></tr>';
}
echo graphic_incident_user2();
echo '<tr><td><h3>'.__('Incidents by source').'</h3>';
if ($config['flash_charts']) {
echo grafico_incidente_prioridad ();
}
else {
echo '<img src="include/fgraph.php?tipo=source_incident" border="0"></td></tr>';
}
echo graphic_incident_source2();
echo '</table>';
?>

View File

@ -16,7 +16,8 @@
// Load global vars
global $config;
require_once ("include/fgraph.php");
require_once ($config["homedir"] . '/include/functions_graph.php');
check_login ();
@ -29,39 +30,19 @@ ui_print_page_header (__('Statistics'), "images/book_edit.png", false, "", false
echo '<table width="90%">
<tr><td valign="top"><h3>'.__('Incidents by status').'</h3>';
if ($config['flash_charts']) {
echo graph_incidents_status ();
}
else {
echo '<img src="include/fgraph.php?tipo=estado_incidente" border="0"></td>';
}
echo graph_incidents_status2 ();
echo '<td valign="top"><h3>'.__('Incidents by priority').'</h3>';
if ($config['flash_charts']) {
echo grafico_incidente_prioridad ();
}
else {
echo '<img src="include/fgraph.php?tipo=prioridad_incidente" border="0"></td></tr>';
}
echo grafico_incidente_prioridad2 ();
echo '<tr><td><h3>'.__('Incidents by group').'</h3>';
if ($config['flash_charts']) {
echo grafico_incidente_prioridad ();
}
else {
echo '<img src="include/fgraph.php?tipo=group_incident" border="0"></td>';
}
echo graphic_incident_group2();
echo '<td><h3>'.__('Incidents by user').'</h3>';
if ($config['flash_charts']) {
echo grafico_incidente_prioridad ();
}
else {
echo '<img src="include/fgraph.php?tipo=user_incident" border="0"></td></tr>';
}
echo graphic_incident_user2();
echo '<tr><td><h3>'.__('Incidents by source').'</h3>';
if ($config['flash_charts']) {
echo grafico_incidente_prioridad ();
}
else {
echo '<img src="include/fgraph.php?tipo=source_incident" border="0"></td></tr>';
}
echo graphic_incident_source2();
echo '</table>';
?>

View File

@ -228,8 +228,25 @@ foreach ($contents as $content) {
array_push ($modules, $content2['id_agent_module']);
array_push ($weights, $content2["weight"]);
}
$data["objdata"]["img"] = 'include/fgraph.php?PHPSESSID='.$session_id.'&amp;tipo=combined&amp;id='.implode (',', $modules).'&amp;weight_l='.implode (',', $weights).'&amp;height=230&amp;width=720&amp;period='.$content['period'].'&amp;date='.$datetime.'&amp;stacked='.$graph["stacked"].'&amp;pure=1';
$img = $data[0] = graphic_combined_module2(
$modules,
$weights,
$content['period'],
$sizgraph_w, $sizgraph_h,
'Combined%20Sample%20Graph',
'',
0,
0,
0,
$graph["stacked"],
$datetime);
preg_match("/src='(.*)'/", $img, $matches);
$url = $matches[1];
$data["objdata"]["img"] = $url;
break;
case 3:
case 'SLA':

View File

@ -103,12 +103,7 @@ foreach ($recon_tasks as $task) {
$data[1] = '<b>'. $task["name"].'</b>';
if ($task["interval_sweep"] == 0){
$data[2] = __("Manual");
}
else {
$data[2] = human_time_description_raw ($task["interval_sweep"]);
}
$data[2] = human_time_description_raw ($task["interval_sweep"]);
if ($task["id_recon_script"] == 0){
$data[3] = $task["subnet"];