diff --git a/src/opnsense/scripts/netflow/export_details.py b/src/opnsense/scripts/netflow/export_details.py index b9d9d6831..740ea2e85 100755 --- a/src/opnsense/scripts/netflow/export_details.py +++ b/src/opnsense/scripts/netflow/export_details.py @@ -1,4 +1,4 @@ -#!/usr/local/bin/python2.7 +#!/usr/local/bin/python3 """ Copyright (c) 2016 Ad Schellevis diff --git a/src/opnsense/scripts/netflow/flowctl_stats.py b/src/opnsense/scripts/netflow/flowctl_stats.py index c9ad4e298..e38208ec6 100755 --- a/src/opnsense/scripts/netflow/flowctl_stats.py +++ b/src/opnsense/scripts/netflow/flowctl_stats.py @@ -1,4 +1,4 @@ -#!/usr/local/bin/python2.7 +#!/usr/local/bin/python3 """ Copyright (c) 2016 Ad Schellevis @@ -40,7 +40,8 @@ if __name__ == '__main__': with tempfile.NamedTemporaryFile() as output_stream: subprocess.call(['/usr/sbin/ngctl', 'list'], stdout=output_stream, stderr=open(os.devnull, 'wb')) output_stream.seek(0) - for line in output_stream.read().split('\n'): + for line in output_stream: + line = line.decode() if line.find('netflow_') > -1: netflow_nodes.append(line.split()[1]) @@ -50,8 +51,8 @@ if __name__ == '__main__': subprocess.call(['/usr/sbin/flowctl', '%s:' % netflow_node, 'show'], stdout=output_stream, stderr=open(os.devnull, 'wb')) output_stream.seek(0) - for line in output_stream.read().split('\n'): - fields = line.split() + for line in output_stream: + fields = line.decode().split() if len(fields) >= 8 and fields[0] != 'SrcIf': node_stats['Pkts'] += int(fields[7]) if fields[1] not in node_stats['SrcIPaddress']: diff --git a/src/opnsense/scripts/netflow/flowd_aggregate_metadata.py b/src/opnsense/scripts/netflow/flowd_aggregate_metadata.py index c3774a69c..711f00337 100755 --- a/src/opnsense/scripts/netflow/flowd_aggregate_metadata.py +++ b/src/opnsense/scripts/netflow/flowd_aggregate_metadata.py @@ -1,7 +1,7 @@ -#!/usr/local/bin/python2.7 +#!/usr/local/bin/python3 """ - Copyright (c) 2016-2018 Ad Schellevis + Copyright (c) 2016-2019 Ad Schellevis All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/opnsense/scripts/netflow/get_timeseries.py b/src/opnsense/scripts/netflow/get_timeseries.py index 26b2663e3..5cacd325c 100755 --- a/src/opnsense/scripts/netflow/get_timeseries.py +++ b/src/opnsense/scripts/netflow/get_timeseries.py @@ -1,7 +1,7 @@ -#!/usr/local/bin/python2.7 +#!/usr/local/bin/python3 """ - Copyright (c) 2016-2018 Ad Schellevis + Copyright (c) 2016-2019 Ad Schellevis All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/opnsense/scripts/netflow/get_top_usage.py b/src/opnsense/scripts/netflow/get_top_usage.py index 995914a83..5095dfbd7 100755 --- a/src/opnsense/scripts/netflow/get_top_usage.py +++ b/src/opnsense/scripts/netflow/get_top_usage.py @@ -1,7 +1,7 @@ -#!/usr/local/bin/python2.7 +#!/usr/local/bin/python3 """ - Copyright (c) 2016 Ad Schellevis + Copyright (c) 2016-2019 Ad Schellevis All rights reserved. Redistribution and use in source and binary forms, with or without