Module: check_mk
Branch: master
Commit: 71d4c47b732b990241d19642cfad2b46a859ba95
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=71d4c47b732b99…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Nov 9 13:46:39 2015 +0100
#2783 FIX esx_vsphere_datastores: fixed crash when no provisioning levels were set
---
.werks/2783 | 10 ++++++++++
ChangeLog | 1 +
checks/esx_vsphere_datastores | 8 ++++++--
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/.werks/2783 b/.werks/2783
new file mode 100644
index 0000000..4aee48c
--- /dev/null
+++ b/.werks/2783
@@ -0,0 +1,10 @@
+Title: esx_vsphere_datastores: fixed crash when no provisioning levels were set
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1447073109
+
+
diff --git a/ChangeLog b/ChangeLog
index c603c85..49cfed1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -61,6 +61,7 @@
* 2773 FIX: omd_staomd_status: handle case where site's software installation is
broken
* 2754 FIX: ipmitool: Killing asynchronous ipmitool call after 300 seconds...
* 2755 FIX: apc_symmetra: Check is handling missing data more robust now
+ * 2783 FIX: esx_vsphere_datastores: fixed crash when no provisioning levels were set
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/esx_vsphere_datastores b/checks/esx_vsphere_datastores
index d7b55e8..5ef9176 100644
--- a/checks/esx_vsphere_datastores
+++ b/checks/esx_vsphere_datastores
@@ -90,8 +90,12 @@ def check_esx_vsphere_datastores(item, params, info):
infotext += ", uncommitted: %.2f GB, provisioning: %.1f%%%s" % (
uncommitted_mb / 1024, prov_percent, prov_txt)
if perfdata:
- prov_warn_mb = size_mb / 100 * warn
- prov_crit_mb = size_mb / 100 * crit
+ if warn:
+ prov_warn_mb = size_mb / 100 * warn
+ prov_crit_mb = size_mb / 100 * crit
+ else:
+ prov_warn_mb = None
+ prov_crit_mb = None
perfdata += [
('uncommitted', str(uncommitted_mb) + 'MB'),
('overprovisioned', str(prov_mb) + 'MB', prov_warn_mb,
prov_crit_mb),