2011-12-21 Vanessa Gil <vanessa.gil@artica.es>
* godmode/netflow/nf_edit.php godmode/netflow/nf_edit_form.php include/functions_graph.php operation/netflow/nf_view.php: remove some warning. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5292 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
4380251694
commit
0936a761a2
|
@ -1,3 +1,9 @@
|
|||
2011-12-21 Vanessa Gil <vanessa.gil@artica.es>
|
||||
* godmode/netflow/nf_edit.php
|
||||
godmode/netflow/nf_edit_form.php
|
||||
include/functions_graph.php
|
||||
operation/netflow/nf_view.php: remove some warning.
|
||||
|
||||
2011-12-21 Vanessa Gil <vanessa.gil@artica.es>
|
||||
* pandoradb.sql: added mysql tables for traffic netflow.
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ $table->data = array ();
|
|||
$total_filters = db_get_all_rows_filter ('tnetflow_filter', false, 'COUNT(*) AS total');
|
||||
$total_filters = $total_filters[0]['total'];
|
||||
|
||||
ui_pagination ($total_filters, $url);
|
||||
//ui_pagination ($total_filters, $url);
|
||||
|
||||
foreach ($filters as $filter) {
|
||||
$data = array ();
|
||||
|
|
|
@ -19,8 +19,8 @@ global $config;
|
|||
|
||||
include_once("include/functions_ui.php");
|
||||
include_once("include/functions_netflow.php");
|
||||
include_once ("/include/functions_users.php");
|
||||
include_once ("/include/functions_groups.php");
|
||||
include_once ("include/functions_users.php");
|
||||
include_once ("include/functions_groups.php");
|
||||
|
||||
check_login ();
|
||||
|
||||
|
@ -191,7 +191,7 @@ $table->data[7][1] = html_print_select ($aggregate_list, "aggregate", $aggregate
|
|||
|
||||
$table->data[8][0] = '<b>'.__('Output format').'</b>';
|
||||
|
||||
$table->data[8][1] .= __('Packets');
|
||||
$table->data[8][1] = __('Packets');
|
||||
$table->data[8][1] .= html_print_checkbox ('show_packets', 1, $show_packets, true);
|
||||
$table->data[8][1] .= __('Bytes');
|
||||
$table->data[8][1] .= html_print_checkbox ('show_bytes', 1, $show_bytes, true);
|
||||
|
|
|
@ -2138,10 +2138,12 @@ function grafico_netflow_total_area ($data, $period,$width, $height , $title, $u
|
|||
$time = $data[$j]['time'];
|
||||
$datetime = strtotime ($date." ".$time);
|
||||
|
||||
if ($datetime >= $timestamp && $datetime <= ($timestamp + $interval)){
|
||||
if ($datetime >= $timestamp && $datetime <= ($timestamp + $interval)){
|
||||
if (isset($data[$j]['unit'])){
|
||||
if ($data[$j]['unit'] == 'G'){
|
||||
$data[$j]['data'] *= 1024;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if(!isset($chart[$timestamp_short][$ip])) {
|
||||
|
@ -2218,20 +2220,22 @@ function grafico_netflow_aggregate_pie ($data) {
|
|||
|
||||
$i = 0;
|
||||
$values = array();
|
||||
$agg = array();
|
||||
$agg = '';
|
||||
while (isset ($data[$i])) {
|
||||
$agg = $data[$i]['agg'];
|
||||
if ($data[$i]['unit'] == 'G') {
|
||||
$data[$i]['data'] = $data[$i]['data'] * 1024;
|
||||
if (isset($data[$i]['unit'])){
|
||||
if ($data[$i]['unit'] == 'G') {
|
||||
$data[$i]['data'] = $data[$i]['data'] * 1024;
|
||||
}
|
||||
}
|
||||
if (isset($values[$agg])){
|
||||
if (!isset($values[$agg])){
|
||||
$values[$agg] = $data[$i]['data'];
|
||||
} else {
|
||||
$values[$agg] += $data[$i]['data'];
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
html_debug_print($values);
|
||||
return pie3d_graph($config['flash_charts'], $values, 320, 200,
|
||||
__('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png",
|
||||
$config['fontpath'], $config['font_size']);
|
||||
|
@ -2247,6 +2251,8 @@ function grafico_netflow_total_pie ($data) {
|
|||
echo"<h4>Gráfica totalizada</h4>";
|
||||
|
||||
$i = 0;
|
||||
$agg = '';
|
||||
$values = array();
|
||||
while (isset ($data[$i])) {
|
||||
$agg = $data[$i]['agg'];
|
||||
if ($data[$i]['unit'] == 'G') {
|
||||
|
|
|
@ -21,7 +21,7 @@ if (function_exists ('mb_internal_encoding')) {
|
|||
|
||||
// Set to 1 to do not check for installer or config file (for development!).
|
||||
// Activate gives more error information, not useful for production sites
|
||||
$develop_bypass = 1;
|
||||
$develop_bypass = 0;
|
||||
|
||||
if ($develop_bypass != 1) {
|
||||
// If no config file, automatically try to install
|
||||
|
|
|
@ -65,7 +65,9 @@ function exec_command ($start_date, $end_date, $command, $show){
|
|||
break;
|
||||
case "bytes":
|
||||
$values[$i]['data'] = $val[9];
|
||||
$values[$i]['unit'] = $val[10];
|
||||
if (isset($val[10])){
|
||||
$values[$i]['unit'] = $val[10];
|
||||
}
|
||||
break;
|
||||
case "flows":
|
||||
$values[$i]['data'] = $val[11];
|
||||
|
@ -79,7 +81,7 @@ function exec_command ($start_date, $end_date, $command, $show){
|
|||
|
||||
function exec_command_aggregate ($start_date, $end_date, $command, $show){
|
||||
$command .= ' -t '.$start_date.'-'.$end_date;
|
||||
|
||||
|
||||
$values = array();
|
||||
exec($command, $string);
|
||||
|
||||
|
@ -473,8 +475,6 @@ if ($show_bpp)
|
|||
switch ($element){
|
||||
case '0':
|
||||
echo grafico_netflow_aggregate_area($result, $interval, 880, 540, '', '','','',$date);
|
||||
echo netflow_show_table_values($result, $date_limit, $date_time);
|
||||
echo netflow_show_total_period($result, $date_limit, $date_time);
|
||||
break;
|
||||
case '1':
|
||||
echo grafico_netflow_aggregate_pie($result);
|
||||
|
|
Loading…
Reference in New Issue