mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
2012-01-03 Vanessa Gil <vanessa.gil@artica.es>
* include/functions_graph.php operation/netflow/nf_view.php: Graph changes. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5316 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e4ef53f2ed
commit
46f55e8905
@ -1,3 +1,7 @@
|
|||||||
|
2012-01-03 Vanessa Gil <vanessa.gil@artica.es>
|
||||||
|
* include/functions_graph.php
|
||||||
|
operation/netflow/nf_view.php: Graph changes.
|
||||||
|
|
||||||
2012-01-03 Sergio Martin <sergio.martin@artica.es>
|
2012-01-03 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* include/functions_users.php
|
* include/functions_users.php
|
||||||
|
@ -2073,41 +2073,17 @@ function grafico_netflow_total_area ($data, $period,$width, $height , $title, $u
|
|||||||
$aggs = array();
|
$aggs = array();
|
||||||
// Calculate data for each agg
|
// Calculate data for each agg
|
||||||
$j = 0;
|
$j = 0;
|
||||||
for ($i = 0; $i < $resolution; $i++) {
|
$chart = array();
|
||||||
$count = 0;
|
$long_index = array();
|
||||||
$timestamp = $datelimit + ($interval * $i);
|
|
||||||
$timestamp_short = date($time_format, $timestamp);
|
|
||||||
$long_index[$timestamp_short] = date(
|
|
||||||
html_entity_decode($config['date_format'], ENT_QUOTES, "UTF-8"), $timestamp);
|
|
||||||
|
|
||||||
// Read data that falls in the current interval
|
while (isset ($data[$j])) {
|
||||||
while (isset ($data[$j])) {
|
$date = $data[$j]['date'];
|
||||||
$date = $data[$j]['date'];
|
$time = $data[$j]['time'];
|
||||||
$time = $data[$j]['time'];
|
$datetime = strtotime ($date." ".$time);
|
||||||
$datetime = strtotime ($date." ".$time);
|
$timestamp_short = date($time_format, $datetime);
|
||||||
|
$chart[$timestamp_short]['data'] = $data[$j]['data'];
|
||||||
if ($datetime >= $timestamp && $datetime <= ($timestamp + $interval)){
|
$j++;
|
||||||
if(!isset($chart[$timestamp_short]['data'])) {
|
|
||||||
$chart[$timestamp_short]['data'] = $data[$j]['data'];
|
|
||||||
$count++;
|
|
||||||
} else {
|
|
||||||
$chart[$timestamp_short]['data'] += $data[$j]['data'];
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($count > 0) {
|
|
||||||
$chart[$timestamp_short]['data'] = $chart[$timestamp_short]['data']/$count;
|
|
||||||
} else {
|
|
||||||
$chart[$timestamp_short]['data'] = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//////////FIN COMBINED
|
|
||||||
|
|
||||||
$flash_chart = $config['flash_charts'];
|
$flash_chart = $config['flash_charts'];
|
||||||
if ($only_image) {
|
if ($only_image) {
|
||||||
$flash_chart = false;
|
$flash_chart = false;
|
||||||
|
@ -98,7 +98,6 @@ function exec_command_aggregate ($start_date, $end_date, $command, $show){
|
|||||||
$date_time = strtotime ($date." ".$time);
|
$date_time = strtotime ($date." ".$time);
|
||||||
$values[$i]['datetime'] = $date_time;
|
$values[$i]['datetime'] = $date_time;
|
||||||
///
|
///
|
||||||
|
|
||||||
$values[$i]['duration'] = $val[2];
|
$values[$i]['duration'] = $val[2];
|
||||||
$values[$i]['proto'] = $val[3];
|
$values[$i]['proto'] = $val[3];
|
||||||
$values[$i]['agg'] = $val[4];
|
$values[$i]['agg'] = $val[4];
|
||||||
@ -106,10 +105,12 @@ function exec_command_aggregate ($start_date, $end_date, $command, $show){
|
|||||||
switch ($show){
|
switch ($show){
|
||||||
case "packets":
|
case "packets":
|
||||||
$val[7]= str_replace('(','',$val[7]);
|
$val[7]= str_replace('(','',$val[7]);
|
||||||
|
$val[7]= str_replace(')','',$val[7]);
|
||||||
$values[$i]['data'] = $val[7];
|
$values[$i]['data'] = $val[7];
|
||||||
break;
|
break;
|
||||||
case "bytes":
|
case "bytes":
|
||||||
$val[9]= str_replace('(','',$val[9]);
|
$val[9]= str_replace('(','',$val[9]);
|
||||||
|
$val[9]= str_replace(')','',$val[9]);
|
||||||
$values[$i]['data'] = $val[9];
|
$values[$i]['data'] = $val[9];
|
||||||
break;
|
break;
|
||||||
case "bps":
|
case "bps":
|
||||||
@ -125,7 +126,6 @@ function exec_command_aggregate ($start_date, $end_date, $command, $show){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$id = get_parameter('id');
|
$id = get_parameter('id');
|
||||||
$period = get_parameter('period', '86400');
|
$period = get_parameter('period', '86400');
|
||||||
$date_= get_parameter('date', date ("Y/m/d", get_system_time ()));
|
$date_= get_parameter('date', date ("Y/m/d", get_system_time ()));
|
||||||
@ -382,18 +382,8 @@ if ($id!=''){
|
|||||||
if ($show_bpp)
|
if ($show_bpp)
|
||||||
$show = 'bpp';
|
$show = 'bpp';
|
||||||
|
|
||||||
//create interval to divide command execution
|
//create interval to divide command execution
|
||||||
if ($interval<43200)
|
$inter = $config['graph_res'] * 100;
|
||||||
$inter = 1;
|
|
||||||
else if (($interval>=43200)&&($interval<=86400))
|
|
||||||
$inter = 25;
|
|
||||||
else if ($interval > 86400 && $interval < 604800) //1296000)
|
|
||||||
$inter = 150;
|
|
||||||
else if ($interval >= 604800 && $interval <= 1296000)
|
|
||||||
$inter = 800;
|
|
||||||
else
|
|
||||||
$inter = 2800;
|
|
||||||
|
|
||||||
if ($aggregate!='none')
|
if ($aggregate!='none')
|
||||||
$inter = 1;
|
$inter = 1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user