RustImplementation #23
+7
-5
@@ -53,12 +53,14 @@ def main():
|
|||||||
|
|
||||||
if args.monitorOTP:
|
if args.monitorOTP:
|
||||||
# Non-interactive logic
|
# Non-interactive logic
|
||||||
if not os.path.exists("scheduling"): os.makedirs("scheduling")
|
|
||||||
if not os.path.exists("OTP"): os.makedirs("OTP")
|
|
||||||
if not os.path.exists("OTP\\HTML"): os.mkdir("OTP\\HTML")
|
|
||||||
if not os.path.exists("OTP\\PARQ"): os.mkdir("OTP\\PARQ")
|
|
||||||
apivalidation()
|
|
||||||
print(f"Running non-interactively to start monitoring OTP")
|
print(f"Running non-interactively to start monitoring OTP")
|
||||||
|
|
||||||
|
os.makedirs("scheduling", exist_ok=True)
|
||||||
|
os.makedirs("OTP/HTML", exist_ok=True)
|
||||||
|
os.makedirs("OTP/PARQ", exist_ok=True)
|
||||||
|
|
||||||
|
apivalidation()
|
||||||
|
|
||||||
register_function("monitorOTP", utils.otpfunctions.monitorOTP)
|
register_function("monitorOTP", utils.otpfunctions.monitorOTP)
|
||||||
|
|
||||||
if not os.path.exists("scheduling\\jobs.json"): recurring_job("monitor", "monitorOTP", interval=60, unit="seconds", args=[url])
|
if not os.path.exists("scheduling\\jobs.json"): recurring_job("monitor", "monitorOTP", interval=60, unit="seconds", args=[url])
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "monitor",
|
|
||||||
"type": "recurring",
|
|
||||||
"interval": 10,
|
|
||||||
"unit": "seconds",
|
|
||||||
"function": "monitorOTP",
|
|
||||||
"args": [
|
|
||||||
"https://172.17.22.240:3129"
|
|
||||||
],
|
|
||||||
"kwargs": {}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -85,8 +85,8 @@ def monitorOTP(url, pups):
|
|||||||
pid = row['otpid']
|
pid = row['otpid']
|
||||||
early = math.floor(duration * .9)
|
early = math.floor(duration * .9)
|
||||||
|
|
||||||
run_once_job(f"Add activity hashes for {pid}, for {hostname} for the purpose: {purpose}", "addhash", time.time() + early, args=[url, clientid, pid, pups])
|
run_once_job(f"Add activity hashes for {pid}, for {hostname} for the purpose: {purpose}, early run", "addhash", time.time() + early, args=[url, clientid, pid, pups])
|
||||||
run_once_job(f"Add activity hashes for {pid}, for {hostname} for the purpose: {purpose}", "addhash", time.time() + duration, args=[url, clientid, pid, pups])
|
run_once_job(f"Add activity hashes for {pid}, for {hostname} for the purpose: {purpose}, duration complete run", "addhash", time.time() + duration, args=[url, clientid, pid, pups])
|
||||||
print(f"Processing: {pid} with other data: {row}")
|
print(f"Processing: {pid} with other data: {row}")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user