Added custom messages for uptime alerts

This commit is contained in:
2026-05-14 00:55:09 +00:00
parent 6d7c0ce58b
commit d6f65c58f6
6 changed files with 286 additions and 34 deletions
+10
View File
@@ -85,6 +85,16 @@ type Alert struct {
// Discord options.
DiscordWebhook string `yaml:"discord_webhook,omitempty"`
// SubjectTemplate / BodyTemplate are optional text/template strings
// that override the default rendering. Empty means use the built-in
// format. Discord ignores SubjectTemplate (it has no subject line);
// SMTP uses both. Available variables: {{.Check.Name}},
// {{.Check.Type}}, {{.Check.Target}}, {{.Check.ID}}, {{.From}},
// {{.To}}, {{.Verb}}, {{.Snapshot.Reports}}, {{.Snapshot.OKCount}},
// {{.Snapshot.NotOK}}, {{.Snapshot.Detail}}, {{.NodeID}}, {{.When}}.
SubjectTemplate string `yaml:"subject_template,omitempty"`
BodyTemplate string `yaml:"body_template,omitempty"`
}
// ClusterConfig is the replicated cluster state. The Version field