Probes log locally only while the hub is unreachable; the hub confirms silences with that log
Probe: no access log, nothing written while reports get through. When the hub can't be reached, failed reports go to data/outage.jsonl and unsent results to data/backlog.jsonl (survives restarts). The first report that gets through uploads both and they are deleted. Hub: a probe that misses reports gets a "Not reporting" incident. When it reports again, the runs from its outage log become confirmed "Hub unreachable" incidents; the rest of the silence (probe off or restarting) is dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
462525b1e2
commit
be727949c1
13 changed files with 449 additions and 32 deletions
|
|
@ -49,6 +49,16 @@ CREATE TABLE IF NOT EXISTS devices (
|
|||
notes TEXT
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS d_ip ON devices(ip);
|
||||
CREATE TABLE IF NOT EXISTS probe_outages ( -- see outages.py
|
||||
id INTEGER PRIMARY KEY,
|
||||
probe_id INTEGER NOT NULL,
|
||||
start_ts REAL NOT NULL,
|
||||
end_ts REAL, -- NULL while the probe is still silent
|
||||
confirmed INTEGER NOT NULL DEFAULT 0, -- 1 = backed by the probe's outage log
|
||||
failures INTEGER, -- failed reports the probe logged
|
||||
error TEXT
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS po_probe ON probe_outages(probe_id, end_ts);
|
||||
CREATE TABLE IF NOT EXISTS ip_mac (
|
||||
ip TEXT PRIMARY KEY,
|
||||
mac TEXT NOT NULL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue