Module: check_mk
Branch: master
Commit: 693252fc23a00b38944983523204dc7da1b3ed1d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=693252fc23a00b…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Mar 6 07:47:05 2017 +0100
4482 FIX websphere_mq_instance: fixed missing installation info handling
Change-Id: I08fef270ef3948ed920709826650ae0be88d2d7d
---
.werks/4482 | 11 +++++++++++
checks/websphere_mq_instance | 15 ++++++++++-----
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/.werks/4482 b/.werks/4482
new file mode 100644
index 0000000..3ea7909
--- /dev/null
+++ b/.werks/4482
@@ -0,0 +1,11 @@
+Title: websphere_mq_instance: fixed missing installation info handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1488782802
+
+
diff --git a/checks/websphere_mq_instance b/checks/websphere_mq_instance
index 83f3aa9..3b33f05 100644
--- a/checks/websphere_mq_instance
+++ b/checks/websphere_mq_instance
@@ -178,9 +178,9 @@ def check_websphere_mq_manager(item, params, parsed):
status = data["STATUS"]
default = data["DEFAULT"]
standby = data["STANDBY"]
- installation_name = data["INSTNAME"]
- installation_path = data["INSTPATH"]
- installation_server = data["INSTVER"]
+ installation_name = data.get("INSTNAME")
+ installation_path = data.get("INSTPATH")
+ installation_version = data.get("INSTVER")
instances_modes = []
for instance, instance_info in parsed["instances"].items():
@@ -211,8 +211,13 @@ def check_websphere_mq_manager(item, params, parsed):
if "map_instance_states" in params:
state = get_websphere_mq_status("standby", standby, params)
- yield state, "Status: %s%s, Default: %s, Installation name: %s, Path: %s,
Version: %s" % \
- (standby.lower(), extra_info, default, installation_name,
installation_path, installation_server)
+ yield state, "Status: %s%s, Default: %s" % (standby.lower(),
extra_info, default)
+
+ for what, title in [ (installation_name, "Name"),
+ (installation_path, "Path"),
+ (installation_version, "Version") ]:
+ if what:
+ yield 0, "%s: %s" % (title, what)
check_info['websphere_mq_instance.manager'] = {