diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d170fff9dc..37949d8495 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,20 @@ +2011-04-13 Miguel de Dios + + * 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 * include/functions_ui.php diff --git a/pandora_console/godmode/admin_access_logs.php b/pandora_console/godmode/admin_access_logs.php index 15feca861f..96ce639fe9 100644 --- a/pandora_console/godmode/admin_access_logs.php +++ b/pandora_console/godmode/admin_access_logs.php @@ -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 ''; echo ''; echo '
'; + +echo graphic_user_activity2(300, 140); +/* if ($config['flash_charts']) { echo graphic_user_activity (300, 140); } else { echo ''; -} +}*/ echo '
'; echo '
 
'; echo ''; diff --git a/pandora_console/godmode/db/db_info.php b/pandora_console/godmode/db/db_info.php index 9fc34b1d3f..0649f20fd5 100644 --- a/pandora_console/godmode/db/db_info.php +++ b/pandora_console/godmode/db/db_info.php @@ -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').' » '.__('Database information'), "images/god8.png", false, "", true); check_login (); diff --git a/pandora_console/godmode/db/db_main.php b/pandora_console/godmode/db/db_main.php index d9d01fe9c9..50cfaf9e99 100644 --- a/pandora_console/godmode/db/db_main.php +++ b/pandora_console/godmode/db/db_main.php @@ -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")) { diff --git a/pandora_console/godmode/db/db_purge.php b/pandora_console/godmode/db/db_purge.php index 7f406ad00d..15ebf91c8d 100644 --- a/pandora_console/godmode/db/db_purge.php +++ b/pandora_console/godmode/db/db_purge.php @@ -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")) { diff --git a/pandora_console/godmode/reporting/graph_builder.graph_editor.php b/pandora_console/godmode/reporting/graph_builder.graph_editor.php index e5ce752a3d..89bbb46c35 100644 --- a/pandora_console/godmode/reporting/graph_builder.graph_editor.php +++ b/pandora_console/godmode/reporting/graph_builder.graph_editor.php @@ -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")) { diff --git a/pandora_console/godmode/reporting/graph_builder.main.php b/pandora_console/godmode/reporting/graph_builder.main.php index 31305a44ca..a954a896f8 100644 --- a/pandora_console/godmode/reporting/graph_builder.main.php +++ b/pandora_console/godmode/reporting/graph_builder.main.php @@ -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")) { diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index 0653f58154..90111b4835 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -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")) { diff --git a/pandora_console/godmode/reporting/graph_builder.preview.php b/pandora_console/godmode/reporting/graph_builder.preview.php index a35be0b306..993431a7e8 100644 --- a/pandora_console/godmode/reporting/graph_builder.preview.php +++ b/pandora_console/godmode/reporting/graph_builder.preview.php @@ -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")) { diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 5c7aeca71d..a04e0e9936 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -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; } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index a7506cd0f5..e92a880486 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -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)); } ?> \ No newline at end of file diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index c1668a79e7..6bfc564122 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -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 .= ''; + + $data = array (); + $data[__('Alerts fired')] = $fired_percentage; + $data[__('Alerts not fired')] = $not_fired_percentage; + $output .= pie3d_graph($config['flash_charts'], $data, 280, 150); + $output .= ''.__('Alerts fired').': '.sizeof ($alerts_fired).'
'; $output .= ''.__('Total alerts monitored').': '.sizeof ($alerts).'
'; @@ -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')]++; diff --git a/pandora_console/operation/agentes/agent_fields.php b/pandora_console/operation/agentes/agent_fields.php index a226619e3a..abd9b8d844 100755 --- a/pandora_console/operation/agentes/agent_fields.php +++ b/pandora_console/operation/agentes/agent_fields.php @@ -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); diff --git a/pandora_console/operation/agentes/custom_fields.php b/pandora_console/operation/agentes/custom_fields.php index 05841718bf..8350fc00f7 100644 --- a/pandora_console/operation/agentes/custom_fields.php +++ b/pandora_console/operation/agentes/custom_fields.php @@ -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); diff --git a/pandora_console/operation/events/event_statistics.php b/pandora_console/operation/events/event_statistics.php index ce30904387..a64cb8dd65 100644 --- a/pandora_console/operation/events/event_statistics.php +++ b/pandora_console/operation/events/event_statistics.php @@ -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 ""; echo ""; echo "'; echo "
"; echo "

".__('Event graph')."

"; -if ($config['flash_charts']) { - echo grafico_eventos_total (); -} else { - echo ''; -} +echo grafico_eventos_total2(); + echo "
"; echo "

".__('Event graph by user')."

"; -if ($config['flash_charts']) { - echo grafico_eventos_usuario (300, 200); -} else { - echo ''; -} +echo grafico_eventos_usuario2(300, 200); + echo "
"; echo "

".__('Event graph by group')."

"; -if ($config['flash_charts']) { - echo grafico_eventos_grupo (300, 200); -} else { - echo ''; -} +echo grafico_eventos_grupo2(300, 200); + echo '
"; ?> diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 8c566fd5eb..d828269692 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -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 diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 9f4ab03cd0..cdc9fe1754 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -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 ""; //This is the filter div echo '
'; -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 '
'; echo '
 
'; echo ''; diff --git a/pandora_console/operation/incidents/incident_statistics.php b/pandora_console/operation/incidents/incident_statistics.php index 57cb9d3a27..aa73468e56 100755 --- a/pandora_console/operation/incidents/incident_statistics.php +++ b/pandora_console/operation/incidents/incident_statistics.php @@ -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 ''; -} +echo graph_incidents_status2 (); + echo ''; -} +echo grafico_incidente_prioridad2 (); + echo ''; -} +echo graphic_incident_group2(); + echo ''; -} +echo graphic_incident_user2(); + echo ''; -} +echo graphic_incident_source2(); + echo '

'.__('Incidents by status').'

'; -if ($config['flash_charts']) { - echo graph_incidents_status (); -} -else { - echo '

'.__('Incidents by priority').'

'; -if ($config['flash_charts']) { - echo grafico_incidente_prioridad (); -} -else { - echo '

'.__('Incidents by group').'

'; -if ($config['flash_charts']) { - echo grafico_incidente_prioridad (); -} -else { - echo '

'.__('Incidents by user').'

'; -if ($config['flash_charts']) { - echo grafico_incidente_prioridad (); -} -else { - echo '

'.__('Incidents by source').'

'; -if ($config['flash_charts']) { - echo grafico_incidente_prioridad (); -} -else { - echo '
'; ?> diff --git a/pandora_console/operation/integria_incidents/incident_statistics.php b/pandora_console/operation/integria_incidents/incident_statistics.php index 57cb9d3a27..aa73468e56 100755 --- a/pandora_console/operation/integria_incidents/incident_statistics.php +++ b/pandora_console/operation/integria_incidents/incident_statistics.php @@ -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 ''; -} +echo graph_incidents_status2 (); + echo ''; -} +echo grafico_incidente_prioridad2 (); + echo ''; -} +echo graphic_incident_group2(); + echo ''; -} +echo graphic_incident_user2(); + echo ''; -} +echo graphic_incident_source2(); + echo '

'.__('Incidents by status').'

'; -if ($config['flash_charts']) { - echo graph_incidents_status (); -} -else { - echo '

'.__('Incidents by priority').'

'; -if ($config['flash_charts']) { - echo grafico_incidente_prioridad (); -} -else { - echo '

'.__('Incidents by group').'

'; -if ($config['flash_charts']) { - echo grafico_incidente_prioridad (); -} -else { - echo '

'.__('Incidents by user').'

'; -if ($config['flash_charts']) { - echo grafico_incidente_prioridad (); -} -else { - echo '

'.__('Incidents by source').'

'; -if ($config['flash_charts']) { - echo grafico_incidente_prioridad (); -} -else { - echo '
'; ?> diff --git a/pandora_console/operation/reporting/reporting_xml.php b/pandora_console/operation/reporting/reporting_xml.php index b4f085094d..a54ddc1496 100644 --- a/pandora_console/operation/reporting/reporting_xml.php +++ b/pandora_console/operation/reporting/reporting_xml.php @@ -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.'&tipo=combined&id='.implode (',', $modules).'&weight_l='.implode (',', $weights).'&height=230&width=720&period='.$content['period'].'&date='.$datetime.'&stacked='.$graph["stacked"].'&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': diff --git a/pandora_console/operation/servers/view_server_detail.php b/pandora_console/operation/servers/view_server_detail.php index 3886f369b7..ce7c603871 100644 --- a/pandora_console/operation/servers/view_server_detail.php +++ b/pandora_console/operation/servers/view_server_detail.php @@ -103,12 +103,7 @@ foreach ($recon_tasks as $task) { $data[1] = ''. $task["name"].''; - 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"];