Heartbeats: a cron job or script calls /api/heartbeat/<token> (and /start, /fail); the app alerts when the call is late or the job says it failed. Coming up: one agenda of everything dated (expiries, warranties, end of support, planned and recurring maintenance, restore tests, waiting updates), with a dashboard card and an iCalendar feed behind a share link. Suggested checks: web ports and certificates the app already knows about, added with a click. Menu: Incidents become Alerts -> History (old /incidents links redirect); new Monitoring group (Endpoints, Heartbeats, Uptime Kuma); osTicket under Automation, Admin Links under Infrastructure, Generator under Administration. Also makes the restore-test metrics test follow the real clock. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
30 lines
1.0 KiB
SQL
30 lines
1.0 KiB
SQL
CREATE TABLE `heartbeat_pings` (
|
|
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
`heartbeat_id` integer NOT NULL,
|
|
`at` text NOT NULL,
|
|
`kind` text NOT NULL,
|
|
`duration_ms` integer,
|
|
`message` text,
|
|
FOREIGN KEY (`heartbeat_id`) REFERENCES `heartbeats`(`id`) ON UPDATE no action ON DELETE cascade
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE INDEX `heartbeat_pings_idx` ON `heartbeat_pings` (`heartbeat_id`,`at`);--> statement-breakpoint
|
|
CREATE TABLE `heartbeats` (
|
|
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
`name` text NOT NULL,
|
|
`token` text NOT NULL,
|
|
`period_minutes` integer NOT NULL,
|
|
`grace_minutes` integer DEFAULT 10 NOT NULL,
|
|
`server_id` integer,
|
|
`enabled` integer DEFAULT true NOT NULL,
|
|
`notes` text,
|
|
`last_ping_at` text,
|
|
`last_status` text,
|
|
`last_message` text,
|
|
`last_duration_ms` integer,
|
|
`last_start_at` text,
|
|
`ping_count` integer DEFAULT 0 NOT NULL,
|
|
`created_at` text DEFAULT (current_timestamp) NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE UNIQUE INDEX `heartbeats_token_unique` ON `heartbeats` (`token`); |