diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3a4dec9cf0..813ce9c5ea 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2011-12-21 Vanessa Gil + * 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 * pandoradb.sql: added mysql tables for traffic netflow. diff --git a/pandora_console/godmode/netflow/nf_edit.php b/pandora_console/godmode/netflow/nf_edit.php index a0f990f28c..3c16c0635b 100644 --- a/pandora_console/godmode/netflow/nf_edit.php +++ b/pandora_console/godmode/netflow/nf_edit.php @@ -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 (); diff --git a/pandora_console/godmode/netflow/nf_edit_form.php b/pandora_console/godmode/netflow/nf_edit_form.php index 16200046c2..0d91c91f6d 100644 --- a/pandora_console/godmode/netflow/nf_edit_form.php +++ b/pandora_console/godmode/netflow/nf_edit_form.php @@ -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] = ''.__('Output format').''; -$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); diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index b4ae0af347..abc3270f29 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -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"

Gráfica totalizada

"; $i = 0; + $agg = ''; + $values = array(); while (isset ($data[$i])) { $agg = $data[$i]['agg']; if ($data[$i]['unit'] == 'G') { diff --git a/pandora_console/index.php b/pandora_console/index.php index 671fe7b289..05e50b03cd 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -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 diff --git a/pandora_console/operation/netflow/nf_view.php b/pandora_console/operation/netflow/nf_view.php index d91daec348..bf2ad4a01a 100644 --- a/pandora_console/operation/netflow/nf_view.php +++ b/pandora_console/operation/netflow/nf_view.php @@ -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);