diff --git a/plugins/telegram/alerta_telegram.py b/plugins/telegram/alerta_telegram.py index c708a7b9..de815069 100644 --- a/plugins/telegram/alerta_telegram.py +++ b/plugins/telegram/alerta_telegram.py @@ -116,6 +116,10 @@ def post_receive(self, alert): if alert.severity in TELEGRAM_DISABLE_NOTIFICATION_SEVERITY: return + if alert.severity in ['ok', 'normal', 'cleared', app.config.get('DEFAULT_NORMAL_SEVERITY')] and alert.previous_severity in TELEGRAM_DISABLE_NOTIFICATION_SEVERITY: + LOG.debug("Alert severity is %s but previous_severity was %s (included in DEFAULT_NORMAL_SEVERITY list), thus it will not be forwarded to Telegram." % (alert.severity, alert.previous_severity)) + return + LOG.debug('Telegram: post_receive sendMessage disable_notification=%s', str(disable_notification)) chat_ids = TELEGRAM_CHAT_ID.split(",")