mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
[Netflow live] Removed aggregate by protocol
Former-commit-id: 2f02a384966bc4200f8b9b294e02fbd90ab440ef
This commit is contained in:
parent
4f8c7daada
commit
80c79b532b
@ -503,19 +503,11 @@ function netflow_get_data(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$val = explode(',', $line);
|
$val = explode(',', $line);
|
||||||
if ($aggregate == 'proto') {
|
$values['sources'][$val[4]] = 1;
|
||||||
$values['sources'][$val[3]] = 1;
|
|
||||||
} else {
|
|
||||||
$values['sources'][$val[4]] = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the filter.
|
// Update the filter.
|
||||||
switch ($aggregate) {
|
switch ($aggregate) {
|
||||||
case 'proto':
|
|
||||||
$extra_filter = 'proto';
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
case 'srcip':
|
case 'srcip':
|
||||||
$extra_filter = 'ip_src';
|
$extra_filter = 'ip_src';
|
||||||
@ -699,28 +691,24 @@ function netflow_get_stats(
|
|||||||
$datetime = $val[0];
|
$datetime = $val[0];
|
||||||
$end_date = strtotime($datetime);
|
$end_date = strtotime($datetime);
|
||||||
$values[$i]['datetime'] = $end_date;
|
$values[$i]['datetime'] = $end_date;
|
||||||
if ($aggregate == 'proto') {
|
// Address resolution start.
|
||||||
$values[$i]['agg'] = $val[3];
|
if ($address_resolution && ($aggregate == 'srcip' || $aggregate == 'dstip')) {
|
||||||
} else {
|
global $hostnames;
|
||||||
// Address resolution start.
|
|
||||||
if ($address_resolution && ($aggregate == 'srcip' || $aggregate == 'dstip')) {
|
|
||||||
global $hostnames;
|
|
||||||
|
|
||||||
if (!isset($hostnames[$val[4]])) {
|
if (!isset($hostnames[$val[4]])) {
|
||||||
$hostname = gethostbyaddr($val[4]);
|
$hostname = gethostbyaddr($val[4]);
|
||||||
if ($hostname !== false) {
|
if ($hostname !== false) {
|
||||||
$hostnames[$val[4]] = $hostname;
|
$hostnames[$val[4]] = $hostname;
|
||||||
$val[4] = $hostname;
|
$val[4] = $hostname;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$val[4] = $hostnames[$val[4]];
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$val[4] = $hostnames[$val[4]];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Address resolution end.
|
|
||||||
$values[$i]['agg'] = $val[4];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Address resolution end.
|
||||||
|
$values[$i]['agg'] = $val[4];
|
||||||
|
|
||||||
if (! isset($val[9])) {
|
if (! isset($val[9])) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@ -1534,9 +1522,6 @@ function netflow_format_aggregate($aggregate)
|
|||||||
case 'dstip':
|
case 'dstip':
|
||||||
return __('Dst IP');
|
return __('Dst IP');
|
||||||
|
|
||||||
case 'proto':
|
|
||||||
return __('Protocol');
|
|
||||||
|
|
||||||
case 'srcip':
|
case 'srcip':
|
||||||
return __('Src IP');
|
return __('Src IP');
|
||||||
|
|
||||||
|
@ -336,7 +336,6 @@ if (is_metaconsole()) {
|
|||||||
echo '<td><b>'.__('Aggregate by').'</b>'.ui_print_help_icon('aggregate_by', true).'</td>';
|
echo '<td><b>'.__('Aggregate by').'</b>'.ui_print_help_icon('aggregate_by', true).'</td>';
|
||||||
$aggregate_list = [];
|
$aggregate_list = [];
|
||||||
$aggregate_list = [
|
$aggregate_list = [
|
||||||
'proto' => __('Protocol'),
|
|
||||||
'srcip' => __('Src Ip Address'),
|
'srcip' => __('Src Ip Address'),
|
||||||
'dstip' => __('Dst Ip Address'),
|
'dstip' => __('Dst Ip Address'),
|
||||||
'srcport' => __('Src Port'),
|
'srcport' => __('Src Port'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user