first commit

This commit is contained in:
ChKendel
2026-02-15 21:44:57 +01:00
committed by chk
parent 05314ce961
commit 58b490b4f1
12 changed files with 263 additions and 0 deletions

28
db/init.sql Normal file
View File

@@ -0,0 +1,28 @@
CREATE TABLE checks (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
type TEXT NOT NULL, -- script | docker_container | docker_network
description TEXT,
target TEXT,
script_name TEXT,
schedule_seconds INTEGER DEFAULT 60,
timeout_seconds INTEGER DEFAULT 20,
active BOOLEAN DEFAULT TRUE,
last_run TIMESTAMP,
last_status TEXT
);
CREATE TABLE results (
id SERIAL PRIMARY KEY,
check_id INTEGER REFERENCES checks(id) ON DELETE CASCADE,
run_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
status TEXT,
message TEXT,
duration_ms INTEGER
);
INSERT INTO checks (name, type, description, target)
VALUES
('Google HTTP', 'script', 'Prüft google.com', NULL),
('Postgres Container Running', 'docker_container', 'Ist Postgres Container aktiv?', 'info-postgres'),
('Default Network contains Postgres', 'docker_network', 'Ist Postgres im default Netzwerk?', 'bridge');