From 08f263e40981483e96fab9d7c864722abe45df0d Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Mon, 19 Sep 2022 19:31:21 +0200 Subject: nDPId: Reduced flow-updates for TCP flows to 1/4 of the timeout value. * nDPId: Fixed broken validation tests. * nDPId: Removed TICK_RESOLUTION, not required anymore. * c-collectd: Improved total layer4 payload calculation/update handling. * c-collectd: Updated RRD Graph script according to total layer4 payload changes. * py-flow-info.py: Fixed several bugs and syntax errors. * Python scripts: Added dirname(argv[0]) as search path for nDPIsrvd.py. * nDPIsrvd&nDPId-test: Fixed missing EPOLLERR check. Signed-off-by: Toni Uhlig --- examples/py-flow-dashboard/flow-dash.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'examples/py-flow-dashboard/flow-dash.py') diff --git a/examples/py-flow-dashboard/flow-dash.py b/examples/py-flow-dashboard/flow-dash.py index f2135735d..d396e7e97 100755 --- a/examples/py-flow-dashboard/flow-dash.py +++ b/examples/py-flow-dashboard/flow-dash.py @@ -3,9 +3,11 @@ import multiprocessing import os import sys +import time sys.path.append(os.path.dirname(sys.argv[0]) + '/../../dependencies') sys.path.append(os.path.dirname(sys.argv[0]) + '/../share/nDPId') +sys.path.append(os.path.dirname(sys.argv[0])) sys.path.append(sys.base_prefix + '/share/nDPId') import nDPIsrvd from nDPIsrvd import nDPIsrvdSocket @@ -165,6 +167,10 @@ def nDPIsrvd_worker_onJsonLineRecvd(json_dict, instance, current_flow, global_us shared_flow_dict['total-flow-update-events'] += 1 + elif json_dict['flow_event_name'] == 'analyse': + + shared_flow_dict['total-flow-analyse-events'] += 1 + elif json_dict['flow_event_name'] == 'end': shared_flow_dict['total-flow-end-events'] += 1 @@ -231,6 +237,7 @@ def nDPIsrvd_worker(address, shared_flow_dict): sys.stderr.write('Lost connection to {} .. reconnecting\n' .format(address[0]+':'+str(address[1]) if type(address) is tuple else address)) + time.sleep(1.0) except KeyboardInterrupt: pass @@ -248,6 +255,7 @@ if __name__ == '__main__': shared_flow_dict['total-events'] = 0 shared_flow_dict['total-flow-new-events'] = 0 shared_flow_dict['total-flow-update-events'] = 0 + shared_flow_dict['total-flow-analyse-events'] = 0 shared_flow_dict['total-flow-end-events'] = 0 shared_flow_dict['total-flow-idle-events'] = 0 shared_flow_dict['total-flow-detected-events'] = 0 -- cgit v1.2.3