Module: check_mk
Branch: master
Commit: 2fbc439346377492ae6ef13310fdb814dcd90f85
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2fbc4393463774…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Mar 24 13:33:05 2017 +0100
4527 websphere_mq_channels: Now has its own WATO ruleset
In order to separate Websphere MQ queues from channels, above
check plugin got its own WATO ruleset. This means that all
rules that have been configured for the {{MQ Channels}} services
have to be migrated to the new ruleset {{Websphere MQ Channels}}.
Change-Id: Ia954cbf38d8aceaa6337e477f47926a00303f877
---
.werks/4527 | 14 ++++++
checks/websphere_mq_channels | 2 +-
web/plugins/wato/check_parameters.py | 97 ++++++++++++++++++++----------------
3 files changed, 70 insertions(+), 43 deletions(-)
diff --git a/.werks/4527 b/.werks/4527
new file mode 100644
index 0000000..5f73316
--- /dev/null
+++ b/.werks/4527
@@ -0,0 +1,14 @@
+Title: websphere_mq_channels: Now has its own WATO ruleset
+Level: 1
+Component: checks
+Class: feature
+Compatible: incomp
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1490358517
+
+In order to separate Websphere MQ queues from channels, above
+check plugin got its own WATO ruleset. This means that all
+rules that have been configured for the {{MQ Channels}} services
+have to be migrated to the new ruleset {{Websphere MQ Channels}}.
diff --git a/checks/websphere_mq_channels b/checks/websphere_mq_channels
index 1408143..b179a82 100644
--- a/checks/websphere_mq_channels
+++ b/checks/websphere_mq_channels
@@ -111,6 +111,6 @@ check_info["websphere_mq_channels"] = {
"service_description" : "MQ Channel %s",
"has_perfdata" : True,
"default_levels_variable" :
"websphere_mq_channels_default_levels",
- "group" : "websphere_mq",
+ "group" : "websphere_mq_channels",
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 7ad5521..e5513ba 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1680,8 +1680,45 @@ register_check_parameters(
match_type = "dict",
)
+websphere_mq_common_elements = [
+ ("message_count",
+ OptionalDropdownChoice(
+ title = _('Maximum number of messages'),
+ choices = [ (None, _("Ignore these levels")) ],
+ otherlabel = _("Set absolute levels"),
+ explicit = \
+ Tuple(
+ title = _('Maximum number of messages'),
+ elements = [
+ Integer(title = _("Warning at")),
+ Integer(title = _("Critical at")),
+ ]
+ ),
+ default_value = (1000, 1200)
+ )
+ ),
+ ("status",
+ Dictionary(
+ title = _('Override check state based on channel state (only for
channels)'),
+ elements = [
+ ("STOPPED", MonitoringState(
+ title = _("State when channel is stopped"),
+ default_value = 1)),
+ ("RETRYING", MonitoringState(
+ title = _("State when channel is retrying"),
+ default_value = 2)),
+ ("RUNNING", MonitoringState(
+ title = _("State when channel is running"),
+ default_value = 0)),
+ ("other", MonitoringState(
+ title = _("State when channel status is unknown"),
+ default_value = 2)),
+ ],
+ optional_keys = []
+ )),
+]
-def transform_websphere_mq(source):
+def transform_websphere_mq_queues(source):
if isinstance(source, tuple):
return {"message_count": source}
@@ -1695,33 +1732,16 @@ def transform_websphere_mq(source):
else:
return source
-
register_check_parameters(
subgroup_applications,
"websphere_mq",
- _("Websphere Message Queues"),
+ _("Websphere MQ"),
Transform(
Dictionary(
elements = [
- ("message_count",
- OptionalDropdownChoice(
- title = _('Maximum number of messages'),
- choices = [ (None, _("Ignore these levels")) ],
- otherlabel = _("Set absolute levels"),
- explicit = \
- Tuple(
- title = _('Maximum number of messages'),
- elements = [
- Integer(title = _("Warning at")),
- Integer(title = _("Critical at")),
- ]
- ),
- default_value = (1000, 1200)
- )
- ),
("message_count_perc",
OptionalDropdownChoice(
- title = _('Percentage of Queue Length'),
+ title = _('Percentage of queue length'),
help = _('This setting only applies if the WebSphere MQ
reports the queue length'),
choices = [ (None, _("Ignore these levels")) ],
otherlabel = _("Set relative levels"),
@@ -1735,26 +1755,8 @@ register_check_parameters(
),
default_value = (80.0, 90.0)
)
- ),
- ("status",
- Dictionary(
- title = _('Override check state based on channel state (only for
channels)'),
- elements = [
- ("STOPPED", MonitoringState(
- title = _("State when channel is stopped"),
- default_value = 1)),
- ("RETRYING", MonitoringState(
- title = _("State when channel is retrying"),
- default_value = 2)),
- ("RUNNING", MonitoringState(
- title = _("State when channel is running"),
- default_value = 0)),
- ("other", MonitoringState(
- title = _("State when channel status is
unknown"),
- default_value = 2)),
- ],
- optional_keys = []
- )),
+ ), ] + \
+ websphere_mq_common_elements + [
("messages_not_processed",
Dictionary(
title = _("Settings for messages not processed"),
@@ -1783,9 +1785,20 @@ register_check_parameters(
),
],
),
- forth = transform_websphere_mq
+ forth = transform_websphere_mq_queues
+ ),
+ TextAscii(title = _("Name of channel or queue")),
+ match_type = "dict",
+)
+
+register_check_parameters(
+ subgroup_applications,
+ "websphere_mq_channels",
+ _("Websphere MQ Channels"),
+ Dictionary(
+ elements = websphere_mq_common_elements
),
- TextAscii(title = _("Name of Channel or Queue")),
+ TextAscii(title = _("Name of channel")),
match_type = "dict",
)