Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
0b198f7e
Commit
0b198f7e
authored
Apr 15, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(netflow, flowd agg) some error handling, pass flow data by value to BaseFlowAggregator type
parent
67a6370c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
flowd_aggregate.py
src/opnsense/scripts/netflow/flowd_aggregate.py
+13
-2
No files found.
src/opnsense/scripts/netflow/flowd_aggregate.py
View file @
0b198f7e
...
...
@@ -33,6 +33,9 @@ import os
import
sys
import
signal
import
glob
import
copy
import
syslog
import
traceback
sys
.
path
.
insert
(
0
,
"/usr/local/opnsense/site-python"
)
from
lib.parse
import
parse_flow
from
lib.aggregate
import
AggMetadata
...
...
@@ -69,7 +72,10 @@ def aggregate_flowd(do_vacuum=False):
if
flow_record
is
not
None
:
# send to aggregator
for
stream_agg_object
in
stream_agg_objects
:
stream_agg_object
.
add
(
flow_record
)
# class add() may change the flow contents for processing, its better to isolate
# paremeters here.
flow_record_cpy
=
copy
.
deepcopy
(
flow_record
)
stream_agg_object
.
add
(
flow_record_cpy
)
prev_recv
=
flow_record
[
'recv'
]
# expire old data
...
...
@@ -131,8 +137,13 @@ class Main(object):
do_vacuum
=
True
else
:
do_vacuum
=
False
# run aggregate
aggregate_flowd
(
do_vacuum
)
try
:
aggregate_flowd
(
do_vacuum
)
except
:
syslog
.
syslog
(
syslog
.
LOG_ERR
,
'flowd aggregate died with message
%
s'
%
(
traceback
.
format_exc
()))
return
# rotate if needed
check_rotate
()
# wait for next pass, exit on sigterm
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment