Module: check_mk
Branch: master
Commit: 3bf09dc35e6d3b26b0c88512540446856b35a64e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3bf09dc35e6d3b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jul 14 11:28:48 2016 +0200
Conditions for selecting alert handler notifications in RBN
---
modules/notify.py | 6 ++++++
web/htdocs/wato.py | 4 +++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/modules/notify.py b/modules/notify.py
index 5407020..6003435 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -649,6 +649,12 @@ def rbn_match_event(context, state, last_state, events,
allowed_events):
event = 's'
elif notification_type == "ACKNOWLEDGEMENT":
event = 'x'
+ elif notification_type.startswith("ALERTHANDLER ("):
+ handler_state = notification_type[14:-1]
+ if handler_state == "OK":
+ event = 'as'
+ else:
+ event = 'af'
else:
event = events.get(last_state, '?') + events.get(state, '?')
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 02d53f8..8418191 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7464,8 +7464,10 @@ def event_rule_match_conditions(flavour):
( 'f', _("Start or end of flapping state")),
( 's', _("Start or end of a scheduled downtime")),
( 'x', _("Acknowledgement of problem")),
+ ( 'as', _("Alert handler execution, successful")),
+ ( 'af', _("Alert handler execution, failed")),
]
- add_default = [ 'f', 's', 'x' ]
+ add_default = [ 'f', 's', 'x', 'as', 'af'
]
else:
add_choices = []
add_default = []