update routing pluging
This commit is contained in:
parent
461a2d1c1e
commit
7d5fc43dd7
1 changed files with 6 additions and 20 deletions
|
@ -1,21 +1,7 @@
|
|||
def rules(alert, plugins):
|
||||
|
||||
print(plugins)
|
||||
return plugins.values()
|
||||
|
||||
# from alerta.plugins import PluginBase
|
||||
# class RoutingPlugin(PluginBase):
|
||||
# def __init__(self, name=None):
|
||||
# super(RoutingPlugin, self).__init__(name)
|
||||
# def pre_receive(self, alert):
|
||||
# return alert
|
||||
# def post_receive(self, alert):
|
||||
# return
|
||||
# def status_change(self, alert, status, text):
|
||||
# return
|
||||
|
||||
# def rules(alert, plugins):
|
||||
# if alert.severity in ['critical', 'major']:
|
||||
# return [plugins['telegram']]
|
||||
# else:
|
||||
# return []
|
||||
if alert.duplicate_count <= 2:
|
||||
return []
|
||||
elif alert.severity in ['critical']:
|
||||
return [plugins['telegram']]
|
||||
else:
|
||||
return []
|
||||
|
|
Loading…
Add table
Reference in a new issue