Module: check_mk
Branch: master
Commit: 70cac2262cbed47c7d3dcd693d611cf9d169258d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=70cac2262cbed4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Feb 11 08:56:09 2016 +0100
#3049 FIX esx_vsphere_hostsystem.mem_usage_cluster: Fixed exception when no thresholds
configured
---
.werks/3049 | 9 +++++++++
ChangeLog | 1 +
checks/esx_vsphere_hostsystem | 11 +++++++----
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.werks/3049 b/.werks/3049
new file mode 100644
index 0000000..729bebb
--- /dev/null
+++ b/.werks/3049
@@ -0,0 +1,9 @@
+Title: esx_vsphere_hostsystem.mem_usage_cluster: Fixed exception when no thresholds
configured
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1455177358
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 8497636..1d8b088 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -264,6 +264,7 @@
* 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
+ * 3049 FIX: esx_vsphere_hostsystem.mem_usage_cluster: Fixed exception when no
thresholds configured
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/esx_vsphere_hostsystem b/checks/esx_vsphere_hostsystem
index d687676..4077a85 100644
--- a/checks/esx_vsphere_hostsystem
+++ b/checks/esx_vsphere_hostsystem
@@ -122,9 +122,13 @@ def check_esx_vsphere_hostsystem_mem_cluster(item, params, info):
level = total_memory_usage / total_memory_size * 100
label = ""
state = 0
+ warn_perf, crit_perf = None, None
for count, levels in sorted_params:
if nodes_count >= count:
warn, crit = levels
+ warn_perf = warn * total_memory_size / 100
+ crit_perf = cirt * total_memory_size / 100
+
if level > crit:
state = 2
label = " (Levels at %d%%/%d%%)" % (warn, crit)
@@ -133,11 +137,10 @@ def check_esx_vsphere_hostsystem_mem_cluster(item, params, info):
label = " (Levels at %d%%/%d%%)" % (warn, crit)
break
-
- perf = [("usage", total_memory_usage, warn * total_memory_size / 100,
- crit * total_memory_size / 100, 0, total_memory_size)]
+ perf = [("usage", total_memory_usage, warn_perf, crit_perf, 0,
total_memory_size)]
yield state, "%d%%%s used - %s/%s" % \
- (level, label, get_bytes_human_readable(total_memory_usage),
get_bytes_human_readable(total_memory_size)), perf
+ (level, label, get_bytes_human_readable(total_memory_usage),
+ get_bytes_human_readable(total_memory_size)), perf
check_info['esx_vsphere_hostsystem.mem_usage_cluster'] = {