Files
Homelab-manager/server/drizzle/0051_next_nitro.sql
T
bobbanandClaude Sonnet 5.5 24ae8db380 Alert rules of your own, storage forecasts for Proxmox and Synology, and snooze
- Monitoring -> Alert rules: CPU, memory, disk use and disk temperature limits with a time, severity and scope (all, one server, a tag); try before saving; findings are ordinary health conditions
- Proxmox storages and Synology volumes are written down on each health pass (hourly, 400 days) and forecast like server disks: badge and history chart on the pages, alert, digest line, /metrics gauge
- Snooze an alert until a time; held back like maintenance, messages held, announced once again if still there when it ends
- Docs updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 23:38:36 +02:00

50 lines
1.7 KiB
SQL

CREATE TABLE `alert_rules` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`name` text NOT NULL,
`enabled` integer DEFAULT true NOT NULL,
`metric` text NOT NULL,
`mount` text,
`operator` text DEFAULT 'above' NOT NULL,
`threshold` real NOT NULL,
`for_minutes` integer DEFAULT 0 NOT NULL,
`severity` text DEFAULT 'warning' NOT NULL,
`server_id` integer,
`tag` text,
`created_by` text,
`created_at` text NOT NULL
);
--> statement-breakpoint
CREATE TABLE `alert_snoozes` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`alert_id` text NOT NULL,
`condition_key` text NOT NULL,
`message` text NOT NULL,
`until` text NOT NULL,
`snoozed_by` text NOT NULL,
`snoozed_at` text NOT NULL,
`last_seen_at` text NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `alert_snoozes_alert_idx` ON `alert_snoozes` (`alert_id`);--> statement-breakpoint
CREATE TABLE `storage_samples` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`series_id` integer NOT NULL,
`at` text NOT NULL,
`value` real NOT NULL,
FOREIGN KEY (`series_id`) REFERENCES `storage_series`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE INDEX `storage_samples_series_idx` ON `storage_samples` (`series_id`,`at`);--> statement-breakpoint
CREATE TABLE `storage_series` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`integration_id` integer NOT NULL,
`key` text NOT NULL,
`label` text NOT NULL,
`latest_percent` real NOT NULL,
`used_bytes` integer,
`total_bytes` integer,
`updated_at` text NOT NULL,
FOREIGN KEY (`integration_id`) REFERENCES `integrations`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `storage_series_key_idx` ON `storage_series` (`integration_id`,`key`);