Endpoint checks, restore tests, and a change log
- Endpoints: HTTP, TCP and TLS checks with answer time, uptime and certificate expiry; failures and expiring certificates become alerts and notifications; linked to a server for maintenance and tags - Restore tests: record when a backup was restored and how it went; failed tests always alert, overdue ones with a limit set; shown on the Backup coverage page - Change log: one filterable timeline made from the audit log and the incident record Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c3bc6bbf72
commit
92726568b7
37 files changed
+6918
-21
No files matched your search
+53
-4
@@ -52,6 +52,7 @@ what the app actually creates.
|
||||
erDiagram
|
||||
users ||--o{ audit_log : "actor (set null)"
|
||||
users ||--o{ push_subscriptions : "cascade"
|
||||
endpoint_checks ||--o{ endpoint_results : "cascade"
|
||||
integration_credentials ||--o{ integrations : "credential (set null)"
|
||||
integration_credentials ||--o{ dns_providers : "credential (set null)"
|
||||
dns_providers ||--o{ dns_zones_cache : "cascade"
|
||||
@@ -65,9 +66,9 @@ erDiagram
|
||||
integrations ||--o{ alert_tickets : "osTicket used (set null)"
|
||||
```
|
||||
|
||||
Fourteen tables stand alone, with no foreign keys: `settings`, `secrets`,
|
||||
Sixteen tables stand alone, with no foreign keys: `settings`, `secrets`,
|
||||
`ipam_entries`, `domains`, `diag_log`, `notification_queue`,
|
||||
`consistency_ignores`, `tag_definitions`, `share_links`, `maintenance_schedules`, `metrics_tokens`, `event_webhooks`, `alert_incidents`, `dependencies`. `maintenance_windows` and `maintenance_aliases` also have no
|
||||
`consistency_ignores`, `tag_definitions`, `share_links`, `maintenance_schedules`, `metrics_tokens`, `event_webhooks`, `alert_incidents`, `dependencies`, `endpoint_checks`, `restore_tests`. `maintenance_windows` and `maintenance_aliases` also have no
|
||||
foreign key — see [soft references](#soft-references-not-foreign-keys).
|
||||
|
||||
## Tables
|
||||
@@ -104,7 +105,7 @@ Who changed what. Written by the app on every change (see
|
||||
| `id` | integer PK | |
|
||||
| `actor_user_id` | integer → `users.id`, **set null** on delete | Null for automatic actions, and for entries whose user was deleted. |
|
||||
| `actor_label` | text | The user's name/email as it was at the time (or `system`), so an entry still reads correctly after the account is gone. |
|
||||
| `category` | text NOT NULL | Free text. In use: `server` (including the health check's own `went_offline`, `back_online`, `disk_full` and `disk_ok`, and `agent_updated` when a server's agent reports a higher version than before, written as `system` and shown on a server's Activity card), `integration` (including the health check's `went_failing` / `recovered` for a kind of service, with `target_type` `integration_type` and the service type as `target_id`, which the dashboard summary and the uptime ribbons read), `dns`, `settings` (including `agent_auto_update`), `ipam`, `secret`, `domain`, `tag`, `task`, `session`, `network`, `maintenance`, `consistency`, `user`, `privacy`, `diag_log`, `alert_ticket`, `dependency` (`create`, `delete` — what needs what), `push` (`subscribe`, `unsubscribe` — a browser added or removed, never its address or keys), `share_link` (a link made or removed, and `update_status_page` when what a status page shows is changed — never the secret), `runbook`, `alert` (`ack`, `unack` — with the alert's id; on the thing it is about, so they show on a server's Activity card), `incident` (`note`, `note_removed`), `db_backup` (`create`, `upload`, `download`, `delete`, `restore_staged`, `restore_cancelled`, `settings`), `update_run` (`start`, `finished`, `failed`, `cancelled` — shown on the server's Activity card), `inventory`, `metrics_token` and `webhook` (made, changed or removed — never a secret or an address). `user` also records `role_from_groups` when a sign-in changed someone's role. |
|
||||
| `category` | text NOT NULL | Free text. In use: `server` (including the health check's own `went_offline`, `back_online`, `disk_full` and `disk_ok`, and `agent_updated` when a server's agent reports a higher version than before, written as `system` and shown on a server's Activity card), `integration` (including the health check's `went_failing` / `recovered` for a kind of service, with `target_type` `integration_type` and the service type as `target_id`, which the dashboard summary and the uptime ribbons read), `dns`, `settings` (including `agent_auto_update`), `ipam`, `secret`, `domain`, `tag`, `task`, `session`, `network`, `maintenance`, `consistency`, `user`, `privacy`, `diag_log`, `alert_ticket`, `dependency` (`create`, `delete` — what needs what), `endpoint` (`create`, `update`, `delete`), `restore_test` (`record`, `delete`), `push` (`subscribe`, `unsubscribe` — a browser added or removed, never its address or keys), `share_link` (a link made or removed, and `update_status_page` when what a status page shows is changed — never the secret), `runbook`, `alert` (`ack`, `unack` — with the alert's id; on the thing it is about, so they show on a server's Activity card), `incident` (`note`, `note_removed`), `db_backup` (`create`, `upload`, `download`, `delete`, `restore_staged`, `restore_cancelled`, `settings`), `update_run` (`start`, `finished`, `failed`, `cancelled` — shown on the server's Activity card), `inventory`, `metrics_token` and `webhook` (made, changed or removed — never a secret or an address). `user` also records `role_from_groups` when a sign-in changed someone's role. |
|
||||
| `action` | text NOT NULL | `create`, `update`, `delete`, `start`, `stop`, … — free text. |
|
||||
| `target_type`, `target_id` | text | What it happened to. `target_id` is text so it can hold any kind of ID; there's no foreign key. |
|
||||
| `detail` | text | JSON, free-form context (what changed, names, counts). Secrets are never put here. |
|
||||
@@ -623,6 +624,53 @@ A browser or phone that asked for push notifications, one row per device.
|
||||
|
||||
A subscription is removed when the push service says it is gone (HTTP 404 or 410), when its owner or an administrator removes it, and all of them are removed if the server's own key pair has to be made again.
|
||||
|
||||
#### `endpoint_checks`
|
||||
|
||||
A web address, TCP port or TLS certificate the app asks about every few minutes (see the README). The last answer is kept on the row.
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `id` | integer PK | |
|
||||
| `name` | text NOT NULL | |
|
||||
| `kind` | text NOT NULL | `http`, `tcp` or `tls`. |
|
||||
| `target`, `port` | text NOT NULL, integer | http: the address. tcp and tls: the host, and the port. |
|
||||
| `expect_status`, `keyword` | text | http only: the good status codes (`200-204, 401`; null = 200–399) and a word the page must contain. |
|
||||
| `insecure` | bool NOT NULL, default 0 | Accept a certificate that isn't trusted (its expiry is still watched). |
|
||||
| `interval_minutes`, `timeout_seconds`, `failures_before_alert`, `warn_days` | integer NOT NULL | Defaults 5, 10, 2 and 14. |
|
||||
| `server_id` | integer | The server it is about. A plain reference, **not a foreign key**: maintenance on that server silences the check's alerts; one whose server is gone is just unlinked. |
|
||||
| `enabled` | bool NOT NULL, default 1 | |
|
||||
| `last_checked_at`, `last_ok`, `last_message`, `last_response_ms` | text, bool, text, integer | How the latest ask went. |
|
||||
| `cert_expires_at` | text | ISO; when the certificate it showed runs out. |
|
||||
| `consecutive_failures` | integer NOT NULL, default 0 | A problem once this reaches `failures_before_alert`. |
|
||||
| `last_change_at` | text | When it last went from working to failing or back. |
|
||||
| `created_at` | text NOT NULL | |
|
||||
|
||||
#### `endpoint_results`
|
||||
|
||||
One row per answer, kept for two weeks: uptime, average answer time and the run of recent results come from these.
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `id` | integer PK | |
|
||||
| `check_id` | integer NOT NULL | → `endpoint_checks.id`, deleted with it (indexed with `at`). |
|
||||
| `at` | text NOT NULL | ISO. |
|
||||
| `ok` | bool NOT NULL | |
|
||||
| `ms`, `message` | integer, text | |
|
||||
|
||||
#### `restore_tests`
|
||||
|
||||
Each time somebody tried to restore a backup, and how it went. History is kept; the newest per subject is what counts.
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `id` | integer PK | |
|
||||
| `subject_key` | text NOT NULL | `guest:<integration id>:<vmid>` for a Proxmox guest, `custom:<name>` for anything else. Not a foreign key (indexed with `tested_at`). |
|
||||
| `label` | text NOT NULL | What to call it. |
|
||||
| `tested_at` | text NOT NULL | `YYYY-MM-DD`. |
|
||||
| `result` | text NOT NULL | `ok`, `partial`, `failed` or `not_needed`. |
|
||||
| `note`, `tested_by` | text | |
|
||||
| `created_at` | text NOT NULL | |
|
||||
|
||||
#### `metrics_tokens`
|
||||
|
||||
Read-only access to `/metrics` for Prometheus. Only a hash of each secret is stored.
|
||||
@@ -730,7 +778,7 @@ that were never changed aren't stored; the app fills in defaults when reading.
|
||||
| `agents` | `autoUpdate` (false): whether agents that are behind replace themselves. |
|
||||
| `inventory` | `currency` (a short name, may be blank) and `pricePerKwh` (null) — what the inventory's running cost is worked out with. |
|
||||
| `digest` | The weekly digest: `enabled` (false), `day` (0 = Sunday … 6; default 1, Monday) and `time` (`HH:MM`, default `08:00`), in the notification time zone. |
|
||||
| `healthChecks` | `serverOfflineMinutes` (60), `diskUsagePercent` (90), `domainWarnDays` (30), `diskForecastDays` (14; 0 = off — how far ahead a filling disk is flagged on the Alerts page), `backupStaleHours` (48; 0 = off — how old a Proxmox guest's newest backup may be). A server can override each of these (see `servers.thresholds`). |
|
||||
| `healthChecks` | `restoreTestDays` (0 = off — how long a guest's last passing restore test counts; a failed one is always raised), `serverOfflineMinutes` (60), `diskUsagePercent` (90), `domainWarnDays` (30), `diskForecastDays` (14; 0 = off — how far ahead a filling disk is flagged on the Alerts page), `backupStaleHours` (48; 0 = off — how old a Proxmox guest's newest backup may be). A server can override each of these (see `servers.thresholds`). |
|
||||
| `logRetention` | `enabled`, `retentionDays` (90), `intervalHours` (24). |
|
||||
| `display` | `dateFormat`, `timeFormat`, `pageSize`. |
|
||||
| `providerColors`, `integrationColors` | Badge colours, by provider / integration type. |
|
||||
@@ -769,6 +817,7 @@ a stale value is possible and the app treats it as "nothing there":
|
||||
|
||||
- `maintenance_windows.target_id` (→ a server, integration or DNS provider, by `target_type`)
|
||||
- `maintenance_aliases.target_id` (the same, by `target_type`)
|
||||
- `endpoint_checks.server_id` (→ a server) and `restore_tests.subject_key` (→ a Proxmox guest, by integration and vmid)
|
||||
- `dependencies.from_id` and `to_id` (→ a server or integration, by their `_type`)
|
||||
- `audit_log.target_id`
|
||||
- `dns_records_cache.zone_id` (→ `dns_zones_cache.zone_id`, same provider)
|
||||
|
||||
Reference in new issue
Block a user