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> 2013-01-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.postgreSQL.sql, pandoradb.oracle.sql, pandoradb.sql, * pandoradb.postgreSQL.sql, pandoradb.oracle.sql, pandoradb.sql,
@ -8,22 +14,18 @@
* godmode/extensions.php, include/functions_tags.php, * godmode/extensions.php, include/functions_tags.php,
include/functions_ui.php, include/functions_agents.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.js,
godmode/reporting/visual_console_builder.editor.php, godmode/reporting/visual_console_builder.editor.php,
include/styles/pandora.css, include/styles/pandora_legacy.css, include/styles/pandora.css, include/styles/pandora_legacy.css,
include/functions_visual_map.php, include/functions_visual_map.php,
include/ajax/visual_console_builder.ajax.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> 2013-01-23 Sergio Martin <sergio.martin@artica.es>

View File

@ -978,6 +978,7 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi
case '2': case '2':
case 'netflow_data': case 'netflow_data':
$data = netflow_get_data ($start_date, $end_date, $interval_length, $filter, $aggregate, $max_aggregates, $unit, $connection_name); $data = netflow_get_data ($start_date, $end_date, $interval_length, $filter, $aggregate, $max_aggregates, $unit, $connection_name);
if (empty ($data)) { if (empty ($data)) {
break; break;
} }
@ -1108,6 +1109,7 @@ function netflow_xml_report ($id, $start_date, $end_date, $interval_length = 0)
function netflow_aggregate_area_xml ($data) { function netflow_aggregate_area_xml ($data) {
// Print source information // Print source information
if (isset($data['sources'])) {
echo "<aggregates>\n"; echo "<aggregates>\n";
foreach ($data['sources'] as $source => $discard) { foreach ($data['sources'] as $source => $discard) {
echo "<aggregate>$source</aggregate>\n"; echo "<aggregate>$source</aggregate>\n";
@ -1130,6 +1132,17 @@ function netflow_aggregate_area_xml ($data) {
} }
echo "</flows>\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";
}
}
/** /**
* Render an area chart as an XML. * Render an area chart as an XML.

View File

@ -57,7 +57,6 @@ function xml_array ($array, $buffer_file = array()) {
} }
} }
// Login check // Login check
if (isset ($_GET["direct"])) { if (isset ($_GET["direct"])) {
/* /*
@ -234,6 +233,7 @@ foreach ($contents as $content) {
} }
$session_id = session_id(); $session_id = session_id();
switch ($content["type"]) { switch ($content["type"]) {
case 1: case 1:
@ -1400,7 +1400,6 @@ foreach ($contents as $content) {
case 'netflow_data': case 'netflow_data':
case 'netflow_statistics': case 'netflow_statistics':
case 'netflow_summary': case 'netflow_summary':
// Read the report item // Read the report item
$report_id = $report['id_report']; $report_id = $report['id_report'];
$content_id = $content['id_rc']; $content_id = $content['id_rc'];
@ -1416,13 +1415,15 @@ foreach ($contents as $content) {
$start_date = $end_date - $period; $start_date = $end_date - $period;
// Get item filters // 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 == '') { if ($description == '') {
$description = io_safe_output ($filter['id_name']); $description = io_safe_output ($filter['id_name']);
} }
// Build a unique id for the cache // 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; $table->colspan[0][0] = 4;
if ($filter['aggregate'] != 'none') { if ($filter['aggregate'] != 'none') {
@ -1432,8 +1433,10 @@ foreach ($contents as $content) {
$data["title"] = $description . ' (' . __($filter['output']) . ')'; $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'; $buffer_file["objdata"] = $config['attachment_store'] . '/netflow_' . $time.'_'.$content['id_rc'] . '.tmp';
$objdata_file = true;
break; break;
} }