~xenrox/ntfy-alertmanager

1b986078f03ec9bb409027fe983df4f0f287f8d1 — Thorben Günther 1 year, 9 months ago 0a3ead8 silence
silence: Don't add silence action to resolved alerts
1 files changed, 2 insertions(+), 2 deletions(-)

M main.go
M main.go => main.go +2 -2
@@ 110,7 110,7 @@ func (rcv *receiver) singleAlertNotifications(p *payload) []*notification {

		n.tags = strings.Join(tags, ",")

		if rcv.cfg.am.SilenceDuration != 0 {
		if rcv.cfg.am.SilenceDuration != 0 && alert.Status == "firing" {
			if rcv.cfg.BaseURL == "" {
				rcv.logger.Error("Failed to create silence action: No base-url set")
			}


@@ 199,7 199,7 @@ func (rcv *receiver) multiAlertNotification(p *payload) *notification {
	n.priority = priority
	n.tags = tagString

	if rcv.cfg.am.SilenceDuration != 0 {
	if rcv.cfg.am.SilenceDuration != 0 && p.Status == "firing" {
		if rcv.cfg.BaseURL == "" {
			rcv.logger.Error("Failed to create silence action: No base-url set")
		}