Module: check_mk
Branch: master
Commit: 43fe6d227ef3fbf6ce0895665398cddc8eb2b031
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=43fe6d227ef3fb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jul 25 14:42:32 2016 +0200
3736 New option for discontinuing counting on open event after configured time
In the {{Counting}} section of a rule the Event Console has now a new option
{{Discontinue counting after time as elapsed}}. Normally new messages matching
an existing open event that is configured for counting will simply increase
the counter and not open a new event.
When you activate the new option you can limit this phase to a certain
duration, e.g. to 10 minutes. Any messages arriving 10 minutes after the
first matching message will then open a new event instead of just increasing
the counter of the existing one.
---
.werks/3736 | 17 +++++++++++++++++
ChangeLog | 1 +
bin/mkeventd | 4 ++++
web/plugins/wato/mkeventd.py | 12 ++++++++++++
4 files changed, 34 insertions(+)
diff --git a/.werks/3736 b/.werks/3736
new file mode 100644
index 0000000..01f07d1
--- /dev/null
+++ b/.werks/3736
@@ -0,0 +1,17 @@
+Title: New option for discontinuing counting on open event after configured time
+Level: 1
+Component: ec
+Compatible: compat
+Version: 1.4.0i1
+Date: 1469449843
+Class: feature
+
+In the {{Counting}} section of a rule the Event Console has now a new option
+{{Discontinue counting after time as elapsed}}. Normally new messages matching
+an existing open event that is configured for counting will simply increase
+the counter and not open a new event.
+
+When you activate the new option you can limit this phase to a certain
+duration, e.g. to 10 minutes. Any messages arriving 10 minutes after the
+first matching message will then open a new event instead of just increasing
+the counter of the existing one.
diff --git a/ChangeLog b/ChangeLog
index e0025af..b2882a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -553,6 +553,7 @@
* 3716 New sites now have a default rule pack from the start
* 3717 Added search to EC settings and structured the options in multiple settings
* 3720 The Event Console views are now supporting distributed setups...
+ * 3736 New option for discontinuing counting on open event after configured time...
* 3058 FIX: Event Console is now allowing non loadable MIB modules on startup...
* 3097 FIX: mkeventd: fixed crash with non-descriptive error message if mibs
couldn't be loaded
* 3335 FIX: Improved error handling when requested rule pack does not exist
diff --git a/bin/mkeventd b/bin/mkeventd
index c0f73c6..0be8705 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -3349,6 +3349,10 @@ class EventStatus():
if count["separate_match_groups"] and
ev["match_groups"] != event["match_groups"]:
continue
+ if count.get("count_duration") != None and
ev["first"] + count["count_duration"] < event["time"]:
+ # Counting has been discontinued on this event after a certain time
+ continue
+
found = ev
self.count_event_up(found, event)
break
diff --git a/web/plugins/wato/mkeventd.py b/web/plugins/wato/mkeventd.py
index 19b8131..20dcf0d 100644
--- a/web/plugins/wato/mkeventd.py
+++ b/web/plugins/wato/mkeventd.py
@@ -397,6 +397,18 @@ vs_mkeventd_rule = Dictionary(
],
default_value = "interval")
),
+ ( "count_duration",
+ Optional(
+ Age(
+ label = _("Count only for"),
+ help = _("When the event is in the state
<i>open</i> for that time span "
+ "then no further messages of the same time will
be added to the "
+ "event. It will stay open, but the count does
not increase anymore. "
+ "Any further matching message will create a new
event."),
+ ),
+ label = _("Discontinue counting after time as elapsed"),
+ none_label = _("Bar"),
+ )),
( "count_ack",
Checkbox(
label = _("Continue counting when event is
<b>acknowledged</b>"),