Module: check_mk
Branch: master
Commit: 3a16ad24f6cbb9b9baeb365567c86e8f663d730c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3a16ad24f6cbb9…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed Feb 8 11:46:08 2017 +0100
4191 FIX esx_vsphere_hostsystem.cpu_usage: Fixed wrong total GHz
Fixed calculation of total available CPU GHz. Previously it was handled like KB tk MB.
Change-Id: Ib2791f9c457c11561369858f3f18965fcf4ea312
---
.werks/4191 | 9 +++++++++
ChangeLog | 1 +
checks/esx_vsphere_hostsystem | 4 ++--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.werks/4191 b/.werks/4191
new file mode 100644
index 0000000..1054351
--- /dev/null
+++ b/.werks/4191
@@ -0,0 +1,9 @@
+Title: esx_vsphere_hostsystem.cpu_usage: Fixed wrong total GHz
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i4
+Date: 1486550603
+Class: fix
+
+Fixed calculation of total available CPU GHz. Previously it was handled like KB tk MB.
diff --git a/ChangeLog b/ChangeLog
index 41aae63..9ba84c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -96,6 +96,7 @@
* 4123 FIX: active check check_sql: changed handling of query results and fixed
hostname parameter...
* 4325 FIX: check_cpu_peaks: Make the check working with current Check_MK APi
* 4339 FIX: fixed AtrributeError in oracle sessions ruleset
+ * 4191 FIX: esx_vsphere_hostsystem.cpu_usage: Fixed wrong total GHz...
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/esx_vsphere_hostsystem b/checks/esx_vsphere_hostsystem
index be18453..881a4e1 100644
--- a/checks/esx_vsphere_hostsystem
+++ b/checks/esx_vsphere_hostsystem
@@ -67,7 +67,7 @@ def check_esx_vsphere_hostsystem_cpu(item, params, info):
num_cores = int(data['hardware.cpuInfo.numCpuCores'][0])
num_threads = int(data['hardware.cpuInfo.numCpuThreads'][0])
used_mhz = float(data['summary.quickStats.overallCpuUsage'][0])
- mhz_per_core = float(data['hardware.cpuInfo.hz'][0]) / 1024.0 / 1024.0
+ mhz_per_core = float(data['hardware.cpuInfo.hz'][0]) / 1000.0 / 1000.0
total_mhz = mhz_per_core * num_cores
usage = used_mhz / total_mhz * 100
@@ -79,7 +79,7 @@ def check_esx_vsphere_hostsystem_cpu(item, params, info):
this_time = time.time()
state, infotext, perfdata = check_cpu_util(usage, params).next()
- infotext += ", %.2fGHz/%.2fGHz" % (used_mhz / 1024.0, total_mhz / 1024.0)
+ infotext += ", %.2fGHz/%.2fGHz" % (used_mhz / 1000.0, total_mhz / 1000.0)
infotext += ", %d sockets, %d cores/socket, %d threads" % (
num_sockets, num_cores / num_sockets, num_threads)