Module: check_mk
Branch: master
Commit: 3a25e7a069256c4b2f8aad31b1a1d511117aa910
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3a25e7a069256c…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri May 8 10:44:06 2015 +0200
#2265 FIX db2_version: improved check output when version information is missing
The version information of a db2 instance is taken from on of its snapshots.
If the instance had no snapshots, the check raised an exception.
---
.werks/2265 | 11 +++++++++++
ChangeLog | 1 +
checks/db2_version | 11 ++++++++---
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/.werks/2265 b/.werks/2265
new file mode 100644
index 0000000..68a667b
--- /dev/null
+++ b/.werks/2265
@@ -0,0 +1,11 @@
+Title: db2_version: improved check output when version information is missing
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1431074580
+Class: fix
+
+The version information of a db2 instance is taken from on of its snapshots.
+If the instance had no snapshots, the check raised an exception.
+
diff --git a/ChangeLog b/ChangeLog
index 2bc3f5b..cd75f38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -356,6 +356,7 @@
* 2077 FIX: Windows MSI Installer: fixed automatical install of agent plugins...
* 1244 FIX: windows_tasks: Fixed handling of tasks manually stopped by admin...
* 1245 FIX: printer_output: Now correctly detect a bin with unknown as name
+ * 2265 FIX: db2_version: improved check output when version information is
missing...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/db2_version b/checks/db2_version
index b610a74..6e7fa33 100644
--- a/checks/db2_version
+++ b/checks/db2_version
@@ -33,9 +33,14 @@ def inventory_db2_version(info):
def check_db2_version(item, no_params, info):
for line in info:
- instance, version = line[0].split(" ", 1)
- if item == instance:
- return 0, version
+ tokens = line[0].split(" ", 1)
+ if len(tokens) < 2:
+ if item == tokens[0]:
+ return 3, "No version information found"
+ else:
+ instance, version = tokens
+ if item == instance:
+ return 0, version
check_info['db2_version'] = {
"service_description" : "DB2 Version %s",