feat: Add logic to telegram plugin to check previous severity ()

* 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 commit 0deefe05bc.

* Revert "update routing pluging"

This reverts commit 7d5fc43dd7.

* Revert "add routing plugin"

This reverts commit b14f434a88.

* Revert "fix syntax errors"

This reverts commit cc0d62c68a.

* 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:
Aleksandr Demshin 2021-10-19 00:36:32 +03:00 committed by GitHub
parent 106e3e2890
commit a9799587af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(",")