2013-01-24 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_netflow.php,
	operation/reporting/reporting_xml.php: fixed to show netflow data
	in the XML report.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7525 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-01-24 15:00:31 +00:00
parent 62e587d29f
commit 0aa96717e2
3 changed files with 56 additions and 38 deletions

View File

@ -1,3 +1,9 @@
2013-01-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_netflow.php,
operation/reporting/reporting_xml.php: fixed to show netflow data
in the XML report.
2013-01-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.postgreSQL.sql, pandoradb.oracle.sql, pandoradb.sql,
@ -8,22 +14,18 @@
* godmode/extensions.php, include/functions_tags.php,
include/functions_ui.php, include/functions_agents.php,
include/functions_config.php,
include/functions_config.php: cleaned source code style.
* godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.editor.php,
include/styles/pandora.css, include/styles/pandora_legacy.css,
include/functions_visual_map.php,
include/ajax/visual_console_builder.ajax.php,
include/functions_visual_map_editor.php
include/functions_visual_map_editor.php: added the formatted label
into the item label with the help of tiny_mce.
* include/javascript/tiny_mce/*:
* include/javascript/tiny_mce/*: update the last version of
tiny_mce.
2013-01-23 Sergio Martin <sergio.martin@artica.es>

View File

@ -895,7 +895,7 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi
$aggregate = $filter['aggregate'];
$unit = $filter['output'];
$interval = $end_date - $start_date;
// Process item
switch ($type) {
case '0':
@ -978,6 +978,7 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi
case '2':
case 'netflow_data':
$data = netflow_get_data ($start_date, $end_date, $interval_length, $filter, $aggregate, $max_aggregates, $unit, $connection_name);
if (empty ($data)) {
break;
}
@ -1106,29 +1107,41 @@ function netflow_xml_report ($id, $start_date, $end_date, $interval_length = 0)
*
*/
function netflow_aggregate_area_xml ($data) {
// Print source information
echo "<aggregates>\n";
foreach ($data['sources'] as $source => $discard) {
echo "<aggregate>$source</aggregate>\n";
}
echo "</aggregates>\n";
// Print flow information
echo "<flows>\n";
foreach ($data['data'] as $timestamp => $flow) {
echo "<flow>\n";
echo " <timestamp>" . $timestamp . "</timestamp>\n";
echo " <aggregates>\n";
foreach ($flow as $source => $data) {
echo " <aggregate>$source</aggregate>\n";
echo " <data>" . $data . "</data>\n";
// Print source information
if (isset($data['sources'])) {
echo "<aggregates>\n";
foreach ($data['sources'] as $source => $discard) {
echo "<aggregate>$source</aggregate>\n";
}
echo " </aggregates>\n";
echo "</flow>\n";
echo "</aggregates>\n";
// Print flow information
echo "<flows>\n";
foreach ($data['data'] as $timestamp => $flow) {
echo "<flow>\n";
echo " <timestamp>" . $timestamp . "</timestamp>\n";
echo " <aggregates>\n";
foreach ($flow as $source => $data) {
echo " <aggregate>$source</aggregate>\n";
echo " <data>" . $data . "</data>\n";
}
echo " </aggregates>\n";
echo "</flow>\n";
}
echo "</flows>\n";
}
else {
echo "<flows>\n";
foreach ($data as $timestamp => $flow) {
echo "<flow>\n";
echo " <timestamp>" . $timestamp . "</timestamp>\n";
echo " <data>" . $flow['data'] . "</data>\n";
echo "</flow>\n";
}
echo "</flows>\n";
}
echo "</flows>\n";
}
/**

View File

@ -36,7 +36,7 @@ function xml_array ($array, $buffer_file = array()) {
else {
echo "<".$name.">";
}
if (is_array ($value)) {
//si es la ruta al fichero que contiene el xml
if(is_string($file_to_print)) {
@ -57,7 +57,6 @@ function xml_array ($array, $buffer_file = array()) {
}
}
// Login check
if (isset ($_GET["direct"])) {
/*
@ -233,7 +232,8 @@ foreach ($contents as $content) {
}
}
$session_id = session_id();
$session_id = session_id();
switch ($content["type"]) {
case 1:
@ -379,7 +379,7 @@ foreach ($contents as $content) {
///
break;
case 2:
case 'custom_graph':
case 'custom_graph':
case 'automatic_custom_graph':
$data["module"] = io_safe_output_xml (db_get_value ('nombre', 'tagente_modulo', 'id_agente_modulo', $content['id_agent_module']));
@ -1400,7 +1400,6 @@ foreach ($contents as $content) {
case 'netflow_data':
case 'netflow_statistics':
case 'netflow_summary':
// Read the report item
$report_id = $report['id_report'];
$content_id = $content['id_rc'];
@ -1416,13 +1415,15 @@ foreach ($contents as $content) {
$start_date = $end_date - $period;
// Get item filters
$filter = db_get_row_sql("SELECT * FROM tnetflow_filter WHERE id_sg = '" . (int)$content['text'] . "'", false, true);
$filter = db_get_row_sql("SELECT *
FROM tnetflow_filter
WHERE id_sg = '" . (int)$content['text'] . "'", false, true);
if ($description == '') {
$description = io_safe_output ($filter['id_name']);
}
// Build a unique id for the cache
$unique_id = $report_id . '_' . $content_id . '_' . ($end_date - $start_date);
//$unique_id = $report_id . '_' . $content_id . '_' . ($end_date - $start_date);
$table->colspan[0][0] = 4;
if ($filter['aggregate'] != 'none') {
@ -1432,8 +1433,10 @@ foreach ($contents as $content) {
$data["title"] = $description . ' (' . __($filter['output']) . ')';
}
$data["objdata"]["netflow"] = netflow_draw_item ($start_date, $end_date, $resolution, $type, $filter, $max_aggregates, $unique_id, $server_name, 'XML');
//$data["objdata"]["netflow"] = netflow_draw_item ($start_date, $end_date, $resolution, $type, $filter, $max_aggregates, $unique_id, $server_name, 'XML');
$data["objdata"]["netflow"] = netflow_draw_item ($start_date, $end_date, $resolution, $type, $filter, $max_aggregates, $server_name, 'XML');
$buffer_file["objdata"] = $config['attachment_store'] . '/netflow_' . $time.'_'.$content['id_rc'] . '.tmp';
$objdata_file = true;
break;
}