feat: Add logic to telegram plugin to check previous severity (#360)
* fix syntax errors * add routing plugin * change alert duplicate count in routing plugin to 1 * fix routing * reinit plugin * update routing pluging * disable telegram notification for custom severity * remove routing plugin * disable telegram notification for custom severity * Revert "remove routing plugin" This reverts commit0deefe05bc
. * Revert "update routing pluging" This reverts commit7d5fc43dd7
. * Revert "add routing plugin" This reverts commitb14f434a88
. * Revert "fix syntax errors" This reverts commitcc0d62c68a
. * disable TELEGRAM_DISABLE_NOTIFICATION_SEVERITY * revert * add checking previous severity for telegram forwarding * remove closed frome severity * remove 'closed' from severities
This commit is contained in:
parent
106e3e2890
commit
a9799587af
1 changed files with 4 additions and 0 deletions
|
@ -116,6 +116,10 @@ class TelegramBot(PluginBase):
|
|||
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(",")
|
||||
|
|
Loading…
Add table
Reference in a new issue