46 lines
1.2 KiB
SQL
46 lines
1.2 KiB
SQL
CREATE TABLE monutil_hosts (
|
|
hostname VARCHAR(255) PRIMARY KEY,
|
|
ipAddress VARCHAR(15) NOT NULL
|
|
);
|
|
|
|
CREATE TABLE monutil_hostlogs (
|
|
logID BIGSERIAL PRIMARY KEY,
|
|
hostname VARCHAR(255) NOT NULL,
|
|
logTime TIMESTAMP NOT NULL,
|
|
cpu DECIMAL(5, 2) NOT NULL,
|
|
memory DECIMAL(5, 2) NOT NULL,
|
|
FOREIGN KEY (hostname) REFERENCES monutil_hosts(hostname)
|
|
);
|
|
|
|
CREATE TABLE monutil_urlLogs (
|
|
logID BIGSERIAL PRIMARY KEY,
|
|
hostname VARCHAR(255) NOT NULL,
|
|
url TEXT NOT NULL,
|
|
logTime TIMESTAMP NOT NULL,
|
|
responseTime DECIMAL(5, 2) NOT NULL,
|
|
FOREIGN KEY (hostname) REFERENCES monutil_hosts(hostname)
|
|
);
|
|
|
|
CREATE TABLE monutil_ipblock (
|
|
logID BIGSERIAL PRIMARY KEY,
|
|
hostname VARCHAR(255) NOT NULL,
|
|
blockedIPAddress VARCHAR(45) NOT NULL,
|
|
jail VARCHAR(255),
|
|
live BOOLEAN NOT NULL,
|
|
logTime TIMESTAMP NOT NULL,
|
|
FOREIGN KEY (hostname) REFERENCES monutil_hosts(hostname)
|
|
);
|
|
|
|
CREATE TABLE monutil_geoip (
|
|
geoID BIGSERIAL PRIMARY KEY,
|
|
logID BIGINT NOT NULL,
|
|
hostname VARCHAR(255),
|
|
city VARCHAR(255),
|
|
region VARCHAR(255),
|
|
country VARCHAR(255),
|
|
loc VARCHAR(50),
|
|
org VARCHAR(255),
|
|
postal VARCHAR(20),
|
|
timezone VARCHAR(50),
|
|
FOREIGN KEY (logID) REFERENCES monutil_ipblock(logID)
|
|
);
|