Module: check_mk
Branch: master
Commit: 42c8e562af432ff17139f6eda2452d492144c82a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=42c8e562af432f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Feb 10 12:01:11 2016 +0100
#3174 FIX Fix exception in Check_MK agent version check if version number does not contain
three parts
---
.werks/3174 | 9 +++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 8 +++++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/3174 b/.werks/3174
new file mode 100644
index 0000000..2d6588d
--- /dev/null
+++ b/.werks/3174
@@ -0,0 +1,9 @@
+Title: Fix exception in Check_MK agent version check if version number does not contain
three parts
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1455102033
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index b8140b6..82ca4ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -263,6 +263,7 @@
* 2990 FIX: netapp_api_vs_traffic: fixed incorrect CIFS latency...
* 2978 FIX: agent_appdynamics: fixed missing closing brackets for piggyback data
* 3172 FIX: fjdarye100_rluns fjdarye101_rluns fjdarye60_rluns: Correctly detect
RAID 0 state...
+ * 3174 FIX: Fix exception in Check_MK agent version check if version number does not
contain three parts
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 423f733..dca5b44 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1283,6 +1283,8 @@ def is_expected_agent_version(agent_version, expected_version):
return True
except Exception, e:
+ if opt_debug:
+ raise
raise MKGeneralException("Unable to check agent version (Agent: %s Expected:
%s, Error: %s)" %
(agent_version, expected_version, e))
@@ -1306,7 +1308,11 @@ def parse_check_mk_version(v):
return number and int(number) or 0, s
return number and int(number) or 0, ''
- major, minor, rest = v.split('.')
+ parts = v.split('.')
+ while len(parts) < 3:
+ parts.append("0")
+
+ major, minor, rest = parts
sub, rest = extract_number(rest)
if not rest: