You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: netflowbot.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -55,12 +55,12 @@ def path_part_encode(s):
55
55
56
56
def_get_last_used_ts(job_id):
57
57
withget_db_cursor() asc:
58
-
c.execute(f'SELECT j.last_used_ts FROM {DB_PREFIX}bot_jobs j WHERE j.job_id = %s;', (job_id,))
58
+
c.execute(f'SELECT j.last_used_ts FROM {DB_PREFIX}bot_jobs2 j WHERE j.job_id = %s;', (job_id,))
59
59
rec=c.fetchone()
60
60
ifrecisNone:
61
61
returnNone
62
62
last_used_ts, =rec
63
-
returnint(last_used_ts)
63
+
returnlast_used_ts
64
64
65
65
def_get_current_max_ts():
66
66
withget_db_cursor() asc:
@@ -73,7 +73,7 @@ def _get_current_max_ts():
73
73
74
74
def_save_current_max_ts(job_id, max_ts):
75
75
withget_db_cursor() asc:
76
-
c.execute(f"INSERT INTO {DB_PREFIX}bot_jobs (job_id, last_used_ts) VALUES (%s, %s) ON CONFLICT (job_id) DO UPDATE SET last_used_ts = %s;", (job_id, max_ts, max_ts))
76
+
c.execute(f"INSERT INTO {DB_PREFIX}bot_jobs2 (job_id, last_used_ts) VALUES (%s, %s) ON CONFLICT (job_id) DO UPDATE SET last_used_ts = %s;", (job_id, max_ts, max_ts))
77
77
78
78
79
79
defjob_maint_remove_old_data(*args, **kwargs):
@@ -168,10 +168,10 @@ def jobs(self):
168
168
169
169
@staticmethod
170
170
defperform_account_aggr_job(*args, **job_params):
171
-
# \d netflow_flows
171
+
# \d netflow_flows2
172
172
# Column | Type | Description
173
173
# ---------------+---------------+------------
174
-
# ts | numeric(16,6) | UNIX timestamp
174
+
# ts | timestamp | time when flow was received by netflowcollector
175
175
# client_ip | inet | entity IP address
176
176
# in_bytes | integer | number of bytes associated with an IP Flow
177
177
# protocol | smallint | IP protocol (see lookup.py -> PROTOCOLS)
0 commit comments