Add acknowledged alert history and HTML email digests
This commit is contained in:
7
store.go
7
store.go
@@ -97,6 +97,13 @@ func openStore(path string) (*Store, error) {
|
||||
zfs_usage REAL NOT NULL, guests_cpu REAL NOT NULL, guests_memory REAL NOT NULL
|
||||
)`,
|
||||
`CREATE INDEX IF NOT EXISTS history_ts_idx ON history(ts)`,
|
||||
`CREATE TABLE IF NOT EXISTS alert_events (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT, alert_key TEXT NOT NULL, severity TEXT NOT NULL,
|
||||
source TEXT NOT NULL, title TEXT NOT NULL, message TEXT NOT NULL,
|
||||
first_seen INTEGER NOT NULL, last_seen INTEGER NOT NULL, resolved_at INTEGER,
|
||||
acknowledged_at INTEGER, email_sent_at INTEGER
|
||||
)`,
|
||||
`CREATE INDEX IF NOT EXISTS alert_events_active_idx ON alert_events(alert_key,resolved_at)`,
|
||||
}
|
||||
for _, statement := range statements {
|
||||
if _, err := db.Exec(statement); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user