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
b9aec139
Commit
b9aec139
authored
Apr 22, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(netflow, export) remove dependency
parent
6f39a69e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
export_details.py
src/opnsense/scripts/netflow/export_details.py
+5
-2
No files found.
src/opnsense/scripts/netflow/export_details.py
View file @
b9aec139
...
...
@@ -30,7 +30,6 @@
"""
import
time
import
datetime
from
dateutil.tz
import
tzlocal
import
pytz
import
os
import
sys
...
...
@@ -57,6 +56,10 @@ if app_params['start_time'].isdigit():
valid_params
=
True
if
valid_params
:
# calculate time offset between localtime and utc
now_timestamp
=
time
.
time
()
time_offset
=
datetime
.
datetime
.
fromtimestamp
(
now_timestamp
)
-
datetime
.
datetime
.
utcfromtimestamp
(
now_timestamp
)
for
agg_class
in
lib
.
aggregates
.
get_aggregators
():
if
app_params
[
'provider'
]
==
agg_class
.
__name__
:
if
resolution
in
agg_class
.
resolutions
():
...
...
@@ -75,7 +78,7 @@ if valid_params:
line
.
append
(
""
)
if
type
(
record
[
item
])
==
datetime
.
datetime
:
# dates are stored in utc, return in timezone configured on this machine
record
[
item
]
=
record
[
item
]
.
replace
(
tzinfo
=
pytz
.
utc
)
.
astimezone
(
tzlocal
())
record
[
item
]
=
record
[
item
]
.
replace
(
tzinfo
=
pytz
.
utc
)
+
time_offset
line
.
append
(
record
[
item
]
.
strftime
(
'
%
Y/
%
m/
%
d
%
H:
%
M:
%
S'
))
elif
type
(
record
[
item
])
==
float
:
line
.
append
(
'
%.4
f'
%
record
[
item
])
...
...
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