diff --git a/config/notifiers.go b/config/notifiers.go index cac63c5ca5..42d8305ed9 100644 --- a/config/notifiers.go +++ b/config/notifiers.go @@ -681,6 +681,7 @@ type PushoverConfig struct { Message string `yaml:"message,omitempty" json:"message,omitempty"` URL string `yaml:"url,omitempty" json:"url,omitempty"` URLTitle string `yaml:"url_title,omitempty" json:"url_title,omitempty"` + Device string `yaml:"device,omitempty" json:"device,omitempty"` Sound string `yaml:"sound,omitempty" json:"sound,omitempty"` Priority string `yaml:"priority,omitempty" json:"priority,omitempty"` Retry duration `yaml:"retry,omitempty" json:"retry,omitempty"` diff --git a/docs/configuration.md b/docs/configuration.md index b5bc69f532..5c106f20ea 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -887,6 +887,12 @@ token_file: # A supplementary URL shown alongside the message. [ url: | default = '{{ template "pushover.default.url" . }}' ] +# Optional device to send notification to, see https://pushover.net/api#device +[ device: ] + +# Optional sound to use for notification, see https://pushover.net/api#sound +[ sound: ] + # Priority, see https://pushover.net/api#priority [ priority: | default = '{{ if eq .Status "firing" }}2{{ else }}0{{ end }}' ] diff --git a/notify/pushover/pushover.go b/notify/pushover/pushover.go index d1c43174c6..74e5b9b6dc 100644 --- a/notify/pushover/pushover.go +++ b/notify/pushover/pushover.go @@ -145,6 +145,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error) parameters.Add("priority", tmpl(n.conf.Priority)) parameters.Add("retry", fmt.Sprintf("%d", int64(time.Duration(n.conf.Retry).Seconds()))) parameters.Add("expire", fmt.Sprintf("%d", int64(time.Duration(n.conf.Expire).Seconds()))) + parameters.Add("device", tmpl(n.conf.Device)) parameters.Add("sound", tmpl(n.conf.Sound)) if err != nil { return false, err