mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-23 05:45:59 +02:00
2012-11-29 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_ui.php operation/agentes/status_monitor.php: New metaconsole monitor view. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7207 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
5219304693
commit
b38af6f8d5
@ -15,6 +15,11 @@
|
|||||||
|
|
||||||
* godmode/menu.php: Changed netflow title.
|
* godmode/menu.php: Changed netflow title.
|
||||||
|
|
||||||
|
2012-11-29 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* include/functions_netflow.php: Detect empty intervals. Changed
|
||||||
|
the call to nfdump to make it work with the latest version.
|
||||||
|
|
||||||
2012-11-29 Ramon Novoa <rnovoa@artica.es>
|
2012-11-29 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* include/config_process.php: Reverted an accidental commit.
|
* include/config_process.php: Reverted an accidental commit.
|
||||||
|
@ -562,7 +562,7 @@ function netflow_get_command ($filter) {
|
|||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
// Build command
|
// Build command
|
||||||
$command = 'nfdump -N -m';
|
$command = 'nfdump -N -Otstart';
|
||||||
|
|
||||||
// Netflow data path
|
// Netflow data path
|
||||||
if (isset($config['netflow_path']) && $config['netflow_path'] != '') {
|
if (isset($config['netflow_path']) && $config['netflow_path'] != '') {
|
||||||
@ -824,6 +824,7 @@ function netflow_parse_file ($start_date, $end_date, $interval_length, $file, &$
|
|||||||
}
|
}
|
||||||
while ($read_flag == 1);
|
while ($read_flag == 1);
|
||||||
|
|
||||||
|
$no_data = 1;
|
||||||
if ($aggregate != 'none') {
|
if ($aggregate != 'none') {
|
||||||
foreach ($interval_total as $agg => $val) {
|
foreach ($interval_total as $agg => $val) {
|
||||||
|
|
||||||
@ -842,6 +843,7 @@ function netflow_parse_file ($start_date, $end_date, $interval_length, $file, &$
|
|||||||
|
|
||||||
// Calculate interval data
|
// Calculate interval data
|
||||||
$values['data'][$timestamp][$agg] = (int) $interval_total[$agg];
|
$values['data'][$timestamp][$agg] = (int) $interval_total[$agg];
|
||||||
|
$no_data = 0;
|
||||||
|
|
||||||
// Add previous data
|
// Add previous data
|
||||||
if ($previous_value != 0) {
|
if ($previous_value != 0) {
|
||||||
@ -866,6 +868,7 @@ function netflow_parse_file ($start_date, $end_date, $interval_length, $file, &$
|
|||||||
|
|
||||||
// Calculate interval data
|
// Calculate interval data
|
||||||
$values[$timestamp]['data'] = (int) $interval_total;
|
$values[$timestamp]['data'] = (int) $interval_total;
|
||||||
|
$no_data = 0;
|
||||||
|
|
||||||
// Add previous data
|
// Add previous data
|
||||||
if ($previous_value != 0) {
|
if ($previous_value != 0) {
|
||||||
@ -877,6 +880,12 @@ function netflow_parse_file ($start_date, $end_date, $interval_length, $file, &$
|
|||||||
}
|
}
|
||||||
|
|
||||||
fclose ($fh);
|
fclose ($fh);
|
||||||
|
|
||||||
|
// No data!
|
||||||
|
if ($no_data == 1) {
|
||||||
|
$values = array ();
|
||||||
|
}
|
||||||
|
|
||||||
return $last_timestamp;
|
return $last_timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1040,6 +1049,9 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi
|
|||||||
case '0':
|
case '0':
|
||||||
case 'netflow_area':
|
case 'netflow_area':
|
||||||
$data = netflow_get_data ($start_date, $end_date, $interval_length, $filter, $unique_id, $aggregate, $max_aggregates, $unit, $connection_name);
|
$data = netflow_get_data ($start_date, $end_date, $interval_length, $filter, $unique_id, $aggregate, $max_aggregates, $unit, $connection_name);
|
||||||
|
if (empty ($data)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if ($aggregate != 'none') {
|
if ($aggregate != 'none') {
|
||||||
if ($output == 'HTML') {
|
if ($output == 'HTML') {
|
||||||
$html = "<b>" . __('Unit') . ":</b> $unit";
|
$html = "<b>" . __('Unit') . ":</b> $unit";
|
||||||
@ -1091,6 +1103,9 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi
|
|||||||
case '1':
|
case '1':
|
||||||
case 'netflow_pie':
|
case 'netflow_pie':
|
||||||
$data = netflow_get_stats ($start_date, $end_date, $filter, $aggregate, $max_aggregates, $unit, $connection_name);
|
$data = netflow_get_stats ($start_date, $end_date, $filter, $aggregate, $max_aggregates, $unit, $connection_name);
|
||||||
|
if (empty ($data)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if ($output == 'HTML') {
|
if ($output == 'HTML') {
|
||||||
$html = "<b>" . __('Unit') . ":</b> $unit";
|
$html = "<b>" . __('Unit') . ":</b> $unit";
|
||||||
$html .= " <b>" . __('Aggregate') . ":</b> $aggregate";
|
$html .= " <b>" . __('Aggregate') . ":</b> $aggregate";
|
||||||
@ -1111,6 +1126,9 @@ 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, $unique_id, $aggregate, $max_aggregates, $unit, $connection_name);
|
$data = netflow_get_data ($start_date, $end_date, $interval_length, $filter, $unique_id, $aggregate, $max_aggregates, $unit, $connection_name);
|
||||||
|
if (empty ($data)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if ($output == 'HTML' || $output == 'PDF') {
|
if ($output == 'HTML' || $output == 'PDF') {
|
||||||
$html = "<b>" . __('Unit') . ":</b> $unit";
|
$html = "<b>" . __('Unit') . ":</b> $unit";
|
||||||
$html .= " <b>" . __('Aggregate') . ":</b> $aggregate";
|
$html .= " <b>" . __('Aggregate') . ":</b> $aggregate";
|
||||||
@ -1131,6 +1149,9 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi
|
|||||||
case '3':
|
case '3':
|
||||||
case 'netflow_statistics':
|
case 'netflow_statistics':
|
||||||
$data = netflow_get_stats ($start_date, $end_date, $filter, $aggregate, $max_aggregates, $unit, $connection_name);
|
$data = netflow_get_stats ($start_date, $end_date, $filter, $aggregate, $max_aggregates, $unit, $connection_name);
|
||||||
|
if (empty ($data)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if ($output == 'HTML' || $output == 'PDF') {
|
if ($output == 'HTML' || $output == 'PDF') {
|
||||||
return netflow_stat_table ($data, $start_date, $end_date, $aggregate, $unit);
|
return netflow_stat_table ($data, $start_date, $end_date, $aggregate, $unit);
|
||||||
} else if ($output == 'XML') {
|
} else if ($output == 'XML') {
|
||||||
@ -1140,6 +1161,9 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi
|
|||||||
case '4':
|
case '4':
|
||||||
case 'netflow_summary':
|
case 'netflow_summary':
|
||||||
$data = netflow_get_summary ($start_date, $end_date, $filter, $unique_id, $connection_name);
|
$data = netflow_get_summary ($start_date, $end_date, $filter, $unique_id, $connection_name);
|
||||||
|
if (empty ($data)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if ($output == 'HTML' || $output == 'PDF') {
|
if ($output == 'HTML' || $output == 'PDF') {
|
||||||
return netflow_summary_table ($data);
|
return netflow_summary_table ($data);
|
||||||
} else if ($output == 'XML') {
|
} else if ($output == 'XML') {
|
||||||
@ -1147,11 +1171,12 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ($output == 'HTML' || $output == 'PDF') {
|
|
||||||
return fs_error_image();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($output == 'HTML' || $output == 'PDF') {
|
||||||
|
return fs_error_image();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user