Updated reportIPBlock to implement if DBMS is used instead of rabbitmq
This commit is contained in:
parent
65a33bf3c2
commit
3024ec568f
1 changed files with 7 additions and 3 deletions
|
@ -6,7 +6,7 @@ def main():
|
|||
import datetime
|
||||
import signal
|
||||
import threading
|
||||
from log import logsManager
|
||||
import log
|
||||
import sys
|
||||
import select
|
||||
import time
|
||||
|
@ -61,8 +61,12 @@ def main():
|
|||
rabbitmq.publish(f"{data}")
|
||||
|
||||
else:
|
||||
|
||||
print("Not yet implemented")
|
||||
|
||||
hostname = socket.gethostname()
|
||||
ipAddress = socket.gethostbyname(hostname)
|
||||
data = data.split('|')
|
||||
manager = log.logsManager(config.sqlServer, config.sqlDatabase, config.sqlUsername, config.sqlPassword)
|
||||
manager.insertIPBlock(hostname, ipAddress, data[1], data[5], data[6], data[2], config.ipinfoAPIToken)
|
||||
|
||||
except Exception:
|
||||
failureEvent.set()
|
||||
|
|
Loading…
Reference in a new issue