Module: check_mk
Branch: master
Commit: 503bcae2d2ed6258a9633860021bbccd55299a2d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=503bcae2d2ed62…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Jan 11 11:21:01 2017 +0100
4265 FIX netapp_api_cpu: fixed missing number of cpus
Change-Id: Ia898ce3d4006d3e40142b39c1ee9dd1a399f6b35
---
.werks/4265 | 10 ++++++++++
ChangeLog | 1 +
checks/netapp_api_cpu | 10 ++++++----
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.werks/4265 b/.werks/4265
new file mode 100644
index 0000000..a083280
--- /dev/null
+++ b/.werks/4265
@@ -0,0 +1,10 @@
+Title: netapp_api_cpu: fixed missing number of cpus
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i4
+Date: 1484130017
+
+
diff --git a/ChangeLog b/ChangeLog
index a970a2f..178cf3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,7 @@
* 4263 FIX: oracle_crs_res: fixed UnboundLocalError; 'crs_nodename'
referenced before assignment...
* 4264 FIX: wmic_process: fixed invalid info handling
* 4211 FIX: esx_vsphere_counters: No longer crash when counters are available for
instances without a read value
+ * 4265 FIX: netapp_api_cpu: fixed missing number of cpus
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/netapp_api_cpu b/checks/netapp_api_cpu
index f3aa21b..a72f767 100644
--- a/checks/netapp_api_cpu
+++ b/checks/netapp_api_cpu
@@ -74,8 +74,8 @@ def check_netapp_api_cpu_utilization(item, params, parsed, mode):
now = time.time()
- cpu_busy = int(data["cpu_busy"])
- num_cpus = int(data["num_processors"])
+ cpu_busy = int(data["cpu_busy"])
+ num_cpus_str = data.get("num_processors")
ticks_per_sec = get_rate("netapp_api_cpu.utilization", now, cpu_busy,
onwrap=RAISE)
cpusecs_per_sec = ticks_per_sec / 1000000.0
used_perc = 100.0 * cpusecs_per_sec
@@ -88,8 +88,10 @@ def check_netapp_api_cpu_utilization(item, params, parsed, mode):
used_perc = 100
state, infotext, perfdata = check_cpu_util(used_perc, params, now).next()
- perfdata[0] = perfdata[0][:5] + (num_cpus,)
- infotext += ", %d CPUs" % num_cpus
+ if num_cpus_str is not None:
+ num_cpus = int(num_cpus_str)
+ perfdata[0] = perfdata[0][:5] + (num_cpus,)
+ infotext += ", %d CPUs" % num_cpus
return state, infotext, perfdata
# Clustermode CPU utilization