Module: check_mk
Branch: master
Commit: f4a57f158891f5b68aacba737561033a8b49cc5d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f4a57f158891f5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 19 09:22:30 2014 +0100
FIX Service item of "Check event state in event console" checks can now be
configured
In the past the application regex was used as part of the service descriptin, which
resulted in nagios validation errors in case of regexes, where e.g. "$" signs
were
used. Now you can use such regexes and define the item option to create a custom
item for the service description.
---
.werks/672 | 12 ++++++++++++
ChangeLog | 1 +
mkeventd/checks/check_mkevents | 5 +++--
mkeventd/web/plugins/wato/mkeventd.py | 14 +++++++++++++-
4 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/.werks/672 b/.werks/672
new file mode 100644
index 0000000..27249a9
--- /dev/null
+++ b/.werks/672
@@ -0,0 +1,12 @@
+Title: Service item of "Check event state in event console" checks can now be
configured
+Level: 1
+Component: ec
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1392798026
+
+In the past the application regex was used as part of the service descriptin, which
+ resulted in nagios validation errors in case of regexes, where e.g. "$" signs
were
+used. Now you can use such regexes and define the item option to create a custom
+item for the service description.
diff --git a/ChangeLog b/ChangeLog
index 03b0ba7..f9afdc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -306,6 +306,7 @@
* 0427 FIX: Fixed exception when handling connections from event unix socket...
* 0679 FIX: Allow non-Ascii characters in generated events
* 0680 FIX: Do not allow spaces in host names in event simulator...
+ * 0672 FIX: Service item of "Check event state in event console" checks can
now be configured...
Livestatus:
* 0337 New header for limiting the execution time of a query...
diff --git a/mkeventd/checks/check_mkevents b/mkeventd/checks/check_mkevents
index 1f322ca..aa9a3f3 100644
--- a/mkeventd/checks/check_mkevents
+++ b/mkeventd/checks/check_mkevents
@@ -17,8 +17,9 @@ def check_mkevents_arguments(params):
return args
def check_mkevents_description(params):
- if "application" in params:
- return "Events %s" % params["application"]
+ item = params.get('item', params.get('application'))
+ if item:
+ return "Events %s" % item
else:
return "Events"
diff --git a/mkeventd/web/plugins/wato/mkeventd.py
b/mkeventd/web/plugins/wato/mkeventd.py
index 5250f5b..2011a7a 100644
--- a/mkeventd/web/plugins/wato/mkeventd.py
+++ b/mkeventd/web/plugins/wato/mkeventd.py
@@ -1875,6 +1875,18 @@ register_rule(
default_value = '$HOSTNAME$',
)
),
+ ( "item",
+ RegExp(
+ title = _("Item (Used in service description)"),
+ help = _("If you enter an item name here, this will be used as
"
+ "part of the service description after the prefix \"Events
\". "
+ "The prefix plus the configured item must result in an unique
"
+ "service description per host. If you leave this empty either the
"
+ "string provided in \"Application\" is used as item or
the service "
+ "gets no item when the \"Application\" field is also
not configured."),
+ allow_empty = False,
+ )
+ ),
( "application",
RegExp(
title = _("Application (regular expression)"),
@@ -1934,7 +1946,7 @@ register_rule(
)
),
],
- optional_keys = [ "application", "remote",
"ignore_acknowledged" ],
+ optional_keys = [ "application", "remote",
"ignore_acknowledged", "item" ],
),
match = 'all',
)