From 925356f3563950b5053d5c8c3d9cd578aea5df1e Mon Sep 17 00:00:00 2001 From: Terrtia Date: Mon, 7 Jun 2021 16:14:18 +0200 Subject: [PATCH] chg: [Launcher] update modules directory --- bin/LAUNCH.sh | 23 +++++++++++++---------- bin/lib/queues_modules.py | 22 +++++++++++++++++++++- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/bin/LAUNCH.sh b/bin/LAUNCH.sh index b9b3b03e..19e82fc8 100755 --- a/bin/LAUNCH.sh +++ b/bin/LAUNCH.sh @@ -159,6 +159,9 @@ function launching_scripts { screen -S "Script_AIL" -X screen -t "DbCleaner" bash -c "cd ${AIL_BIN}/core; ${ENV_PY} ./DbCleaner.py; read x" sleep 0.1 + screen -S "Script_AIL" -X screen -t "UpdateBackground" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./update-background.py; read x" + sleep 0.1 + ################################## # MODULES # ################################## @@ -187,6 +190,16 @@ function launching_scripts { sleep 0.1 screen -S "Script_AIL" -X screen -t "Onion" bash -c "cd ${AIL_BIN}/modules; ${ENV_PY} ./Onion.py; read x" sleep 0.1 + screen -S "Script_AIL" -X screen -t "SentimentAnalysis" bash -c "cd ${AIL_BIN}/modules; ${ENV_PY} ./SentimentAnalysis.py; read x" + sleep 0.1 + + screen -S "Script_AIL" -X screen -t "Urls" bash -c "cd ${AIL_BIN}/modules; ${ENV_PY} ./Urls.py; read x" + sleep 0.1 + screen -S "Script_AIL" -X screen -t "SQLInjectionDetection" bash -c "cd ${AIL_BIN}/modules; ${ENV_PY} ./SQLInjectionDetection.py; read x" + sleep 0.1 + screen -S "Script_AIL" -X screen -t "LibInjection" bash -c "cd ${AIL_BIN}/modules; ${ENV_PY} ./LibInjection.py; read x" + sleep 0.1 + ################################## # TRACKERS MODULES # @@ -217,8 +230,6 @@ function launching_scripts { sleep 0.1 screen -S "Script_AIL" -X screen -t "Mail" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./Mail.py; read x" sleep 0.1 - screen -S "Script_AIL" -X screen -t "Urls" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./Urls.py; read x" - sleep 0.1 screen -S "Script_AIL" -X screen -t "PgpDump" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./PgpDump.py; read x" sleep 0.1 screen -S "Script_AIL" -X screen -t "Cryptocurrency" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./Cryptocurrencies.py; read x" @@ -231,18 +242,10 @@ function launching_scripts { sleep 0.1 screen -S "Script_AIL" -X screen -t "ModuleStats" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./ModuleStats.py; read x" sleep 0.1 - screen -S "Script_AIL" -X screen -t "SQLInjectionDetection" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./SQLInjectionDetection.py; read x" - sleep 0.1 - screen -S "Script_AIL" -X screen -t "LibInjection" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./LibInjection.py; read x" - sleep 0.1 screen -S "Script_AIL" -X screen -t "MISPtheHIVEfeeder" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./MISP_The_Hive_feeder.py; read x" sleep 0.1 screen -S "Script_AIL" -X screen -t "Languages" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./Languages.py; read x" sleep 0.1 - screen -S "Script_AIL" -X screen -t "SentimentAnalysis" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./SentimentAnalysis.py; read x" - sleep 0.1 - screen -S "Script_AIL" -X screen -t "UpdateBackground" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./update-background.py; read x" - sleep 0.1 screen -S "Script_AIL" -X screen -t "IPAddress" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./IPAddress.py; read x" #screen -S "Script_AIL" -X screen -t "Release" bash -c "cd ${AIL_BIN}; ${ENV_PY} ./Release.py; read x" diff --git a/bin/lib/queues_modules.py b/bin/lib/queues_modules.py index d9999140..a3977e10 100755 --- a/bin/lib/queues_modules.py +++ b/bin/lib/queues_modules.py @@ -51,6 +51,26 @@ def get_all_modules_queues_stats(): all_modules_queues_stats.append((queue_name, nb_elem_queue, seconds, module_pid)) return all_modules_queues_stats + +def _get_all_messages_from_queue(queue_name): + queue_in = f'{queue_name}in' + #self.r_temp.hset('queues', self.subscriber_name, int(self.r_temp.scard(in_set))) + return r_serv_queues.smembers(queue_in) + +# def is_message_in queue(queue_name): +# pass + +def remove_message_from_queue(queue_name, message, out=False): + if out: + queue_key = f'{queue_name}out' + else: + queue_key = f'{queue_name}in' + r_serv_queues.srem(queue_in, message) + if not out: + r_serv_queues.hset('queues', queue_name, int(r_serv_queues.scard(queue_key)) ) + if __name__ == '__main__': - res = get_all_modules_queues_stats() + print(get_all_queues_with_sorted_nb_elem()) + queue_name = 'Tags' + res = _get_all_messages_from_queue(queue_name) print(res)