Patch plans, a monthly report and new-port alerts
Patch plans (Updates -> Patch plans): updates on a schedule, one server at a time, each by an ordinary update run, stopping at the first failure by default, silencing what depends on a server while it is updated, with one message at the end. Monthly report (Operations -> Monthly report, and optionally a message on a day of the month): availability, incidents, updates, restore tests, backups and renewals for a calendar month, printable. Backed by daily endpoint figures and a record of renewals. New ports: the first report with ports is the baseline; a TCP port that begins listening later and is not noted on the server's Ports card is a warning, cleared by Mark as expected. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ddd0aa622a
commit
be6c5552bd
46 files changed
+7836
-26
No files matched your search
+43
-2
@@ -215,6 +215,7 @@ what it last reported.
|
||||
| `mem_total_bytes`, `mem_used_bytes` | integer | |
|
||||
| `disks` | text | JSON, see below. Agent-reported. |
|
||||
| `listening_ports` | text | JSON, see below. What the agent sees bound on the host. |
|
||||
| `port_baseline` | text | JSON array like `["tcp:22","tcp:443"]`: what the host was listening on when its agent first said so. A TCP port listening later that is not in it, and not noted on the Ports card, is a "new port" alert. Null until the first report that carries ports; never changed after. |
|
||||
| `last_port_scan` | text | JSON summary of the latest network scan *from this app*. |
|
||||
| `tags` | text | JSON `string[]` of normalised tag names. |
|
||||
| `proxmox_integration_id` | integer → `integrations.id` | The database has no `ON DELETE` rule here; the app clears the link itself — see [below](#the-proxmox-links-foreign-key). |
|
||||
@@ -546,6 +547,45 @@ Resolved rows older than 400 days are deleted, with their notes.
|
||||
| `body` | text NOT NULL | Up to 4000 characters. |
|
||||
| `created_at` | text NOT NULL | ISO. |
|
||||
|
||||
#### `patch_plans`
|
||||
|
||||
Updates on a schedule, one server at a time (services/patchPlans.ts). A plan only says when, to whom and how; each server is updated by an update run.
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `id`, `name`, `enabled` | | |
|
||||
| `days` | text NOT NULL | JSON: weekdays, 0 = Sunday … 6. |
|
||||
| `start_time`, `timezone` | text NOT NULL | `HH:MM` on the clock of an IANA zone. |
|
||||
| `tags`, `server_ids` | text NOT NULL | JSON arrays: the servers with any of these tags, and these servers by id. |
|
||||
| `integration_id`, `project_id`, `template_id`, `template_name` | | The Semaphore playbook (no foreign key, like update runs). |
|
||||
| `limit_from` | text NOT NULL, default `name` | What ansible's `--limit` is for each server: its name here, or its host name. |
|
||||
| `stop_on_failure`, `only_with_updates`, `silence_dependents` | bool NOT NULL, default true | Stop at the first failure; leave out a server with nothing waiting; silence what depends on a server while it is updated. |
|
||||
| `window_minutes` | integer NOT NULL, default 90 | The longest a server is under maintenance. |
|
||||
| `last_run_date` | text | The local day it last started on, so it starts once a day even across a restart. |
|
||||
| `created_by`, `created_at` | | |
|
||||
|
||||
#### `patch_plan_runs`
|
||||
|
||||
One time a plan ran, and how it went for each server.
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `id` | integer PK | |
|
||||
| `plan_id` | integer NOT NULL | → `patch_plans.id`, deleted with it. |
|
||||
| `plan_name` | text NOT NULL | As it was. |
|
||||
| `trigger` | text NOT NULL | `schedule` or `manual`. |
|
||||
| `status` | text NOT NULL | `running`, `done`, `failed` or `cancelled`. |
|
||||
| `items` | text NOT NULL | JSON: `[{serverId, name, status (pending/running/done/failed/skipped), updateRunId, message, windowIds}]`. |
|
||||
| `started_by`, `message`, `started_at`, `finished_at` | | |
|
||||
|
||||
#### `endpoint_daily`
|
||||
|
||||
One row per endpoint check per UTC day: `total` times asked, `ok` of them answered, `ms_sum`/`ms_count` for the average answer time. Kept about two years (`endpoint_results` keeps two weeks); started from the results that existed when it was added. The monthly report's endpoint availability is worked from it. Primary key (`check_id`, `day`); deleted with its check.
|
||||
|
||||
#### `renewals`
|
||||
|
||||
A certificate, domain registration or secret whose expiry moved at least 20 days later when the app re-read it: `kind` (`certificate`, `domain`, `secret`), `subject` (its name as it was), `at`, `from_date`, `to_date`. Written once per renewal; read by the monthly report.
|
||||
|
||||
#### `update_runs`
|
||||
|
||||
A playbook run in Semaphore for one server, wrapped in a maintenance window and followed until the server reports again.
|
||||
@@ -811,8 +851,9 @@ that were never changed aren't stored; the app fills in defaults when reading.
|
||||
| `selfBackup` | The daily backup of this database: `enabled` (true), `time` (`HH:MM`, default `03:30`, in the notification time zone) and `keep` (14 — how many daily ones are kept). |
|
||||
| `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. |
|
||||
| `monthlyReport` | The monthly report: `enabled` (false), `day` (1–28, default 1) and `time` (`HH:MM`, default `08:00`), in the notification time zone. |
|
||||
| `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` | `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`). |
|
||||
| `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), `newPortAlerts` (true — warn when a server starts listening on a TCP port that is not in its baseline and not noted). 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. |
|
||||
@@ -851,7 +892,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` and `heartbeats.server_id` (→ a server) and `restore_tests.subject_key` (→ a Proxmox guest, by integration and vmid)
|
||||
- `endpoint_checks.server_id` and `heartbeats.server_id` (→ a server), and `patch_plans.integration_id`, `.tags` and `.server_ids` (→ a Semaphore integration, server tags, servers) 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