Defect fixes following testing.
This commit is contained in:
parent
46d895d900
commit
2e04b5eeb8
5 changed files with 12 additions and 12 deletions
|
@ -91,7 +91,7 @@ class rabbitMQClient:
|
||||||
if result[3] == 'ipBlock':
|
if result[3] == 'ipBlock':
|
||||||
|
|
||||||
result[2] = datetime.datetime.fromisoformat(result[2])
|
result[2] = datetime.datetime.fromisoformat(result[2])
|
||||||
manager = logsManager(config.sqlServer, config.sqlDatabase, config.sqlUsername, config.sqlPassword)
|
manager = log.logsManager(config.sqlServer, config.sqlDatabase, config.sqlUsername, config.sqlPassword)
|
||||||
manager.insertIPBlock(result[0], result[1], result[4], result[5], result[6], result[2], config.ipinfoAPIToken)
|
manager.insertIPBlock(result[0], result[1], result[4], result[5], result[6], result[2], config.ipinfoAPIToken)
|
||||||
|
|
||||||
context = ssl.create_default_context(
|
context = ssl.create_default_context(
|
||||||
|
|
|
@ -16,9 +16,6 @@ def main():
|
||||||
jail = sys.argv[2]
|
jail = sys.argv[2]
|
||||||
live = int(sys.argv[3])
|
live = int(sys.argv[3])
|
||||||
logTime = datetime.datetime.now()
|
logTime = datetime.datetime.now()
|
||||||
token = config.ipinfoAPIToken
|
|
||||||
|
|
||||||
print(hostname, ipAddress, blockedIPAddress, jail, live, logTime, token)
|
|
||||||
|
|
||||||
if not config.loggingMode == 'none' and not config.loggingMode == 'rabbitmq':
|
if not config.loggingMode == 'none' and not config.loggingMode == 'rabbitmq':
|
||||||
|
|
||||||
|
@ -27,7 +24,10 @@ def main():
|
||||||
|
|
||||||
if config.loggingMode == 'rabbitmq':
|
if config.loggingMode == 'rabbitmq':
|
||||||
|
|
||||||
rabbitmq.publish(hostname + '|' + socket.gethostbyname(socket.gethostname()) + '|' + str(logTime) + '|' + 'ipBlock' + '|' + str(blockedIPAddress) + '|' + str(jail) + '|' str(live)
|
import rabbitmq
|
||||||
|
|
||||||
|
rabbitmq = rabbitmq.rabbitMQClient(config.rabbitmqca,config.rabbitmqcacert,config.rabbitmqcakey,config.rabbitmqHost,config.rabbitmqPort,config.rabbitmqRoutingKey)
|
||||||
|
rabbitmq.publish(hostname + '|' + socket.gethostbyname(socket.gethostname()) + '|' + str(logTime) + '|' + 'ipBlock' + '|' + str(blockedIPAddress) + '|' + str(jail) + '|' + str(live))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -34,7 +34,7 @@ CREATE TABLE monutil_ipblock (
|
||||||
CREATE TABLE monutil_geoip (
|
CREATE TABLE monutil_geoip (
|
||||||
geoID BIGINT AUTO_INCREMENT PRIMARY KEY,
|
geoID BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||||
logID BIGINT NOT NULL,
|
logID BIGINT NOT NULL,
|
||||||
hostname VARCHAR(255) NOT NULL,
|
hostname VARCHAR(255),
|
||||||
city VARCHAR(255),
|
city VARCHAR(255),
|
||||||
region VARCHAR(255),
|
region VARCHAR(255),
|
||||||
country VARCHAR(255),
|
country VARCHAR(255),
|
||||||
|
|
|
@ -34,7 +34,7 @@ CREATE TABLE monutil_ipblock (
|
||||||
CREATE TABLE monutil_geoip (
|
CREATE TABLE monutil_geoip (
|
||||||
geoID BIGINT IDENTITY(1,1) PRIMARY KEY,
|
geoID BIGINT IDENTITY(1,1) PRIMARY KEY,
|
||||||
logID BIGINT NOT NULL,
|
logID BIGINT NOT NULL,
|
||||||
hostname NVARCHAR(255) NOT NULL,
|
hostname NVARCHAR(255),
|
||||||
city NVARCHAR(255),
|
city NVARCHAR(255),
|
||||||
region NVARCHAR(255),
|
region NVARCHAR(255),
|
||||||
country NVARCHAR(255),
|
country NVARCHAR(255),
|
||||||
|
|
|
@ -34,7 +34,7 @@ CREATE TABLE monutil_ipblock (
|
||||||
CREATE TABLE monutil_geoip (
|
CREATE TABLE monutil_geoip (
|
||||||
geoID BIGSERIAL PRIMARY KEY,
|
geoID BIGSERIAL PRIMARY KEY,
|
||||||
logID BIGINT NOT NULL,
|
logID BIGINT NOT NULL,
|
||||||
hostname VARCHAR(255) NOT NULL,
|
hostname VARCHAR(255),
|
||||||
city VARCHAR(255),
|
city VARCHAR(255),
|
||||||
region VARCHAR(255),
|
region VARCHAR(255),
|
||||||
country VARCHAR(255),
|
country VARCHAR(255),
|
||||||
|
|
Loading…
Reference in a new issue