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 datetime
|
||||||
import signal
|
import signal
|
||||||
import threading
|
import threading
|
||||||
from log import logsManager
|
import log
|
||||||
import sys
|
import sys
|
||||||
import select
|
import select
|
||||||
import time
|
import time
|
||||||
|
@ -61,8 +61,12 @@ def main():
|
||||||
rabbitmq.publish(f"{data}")
|
rabbitmq.publish(f"{data}")
|
||||||
|
|
||||||
else:
|
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:
|
except Exception:
|
||||||
failureEvent.set()
|
failureEvent.set()
|
||||||
|
|
Loading…
Reference in a new issue