Module: check_mk
Branch: master
Commit: 1d30cee2e3f124efd69b7a3f5fe33ef45fca4afe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1d30cee2e3f124…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Thu Apr 5 12:35:25 2018 +0200
5754 FIX netapp_api_vf_stats: now uses the correct number of CPUs
Change-Id: I832d4824593044c02545927957f760a300e8aef3
---
.werks/5754 | 10 ++++++++++
checks/netapp_api_vf_stats | 20 ++++++++++++++------
2 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/.werks/5754 b/.werks/5754
new file mode 100644
index 0000000..71cb49e
--- /dev/null
+++ b/.werks/5754
@@ -0,0 +1,10 @@
+Title: netapp_api_vf_stats: now uses the correct number of CPUs
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i4
+Date: 1522924468
+Class: fix
+
+
diff --git a/checks/netapp_api_vf_stats b/checks/netapp_api_vf_stats
index cab4717..724bab6 100644
--- a/checks/netapp_api_vf_stats
+++ b/checks/netapp_api_vf_stats
@@ -31,12 +31,15 @@ netapp_api_vf_stats_cpu_util_default_levels = (90.0, 95.0)
def inventory_netapp_api_vf_stats(parsed):
- for key in parsed.keys():
+ stats, cpu = parsed
+ for key in stats.keys():
yield key, 'netapp_api_vf_stats_cpu_util_default_levels'
def check_netapp_api_vf_stats(item, params, parsed):
- vf = parsed.get(item)
+ stats, cpu = parsed
+
+ vf = stats.get(item)
if not vf:
return
@@ -51,7 +54,8 @@ def check_netapp_api_vf_stats(item, params, parsed):
if ticks_per_sec == 0:
raise MKCounterWrapped("Counter wrapped")
- num_processors = float(vf.get("num_processors", 1))
+ # vFilers are 7mode only and cannot appear in clustermoder
+ num_processors = float(cpu.get('7mode', {}).get("num_processors",
1))
used_perc = ticks_per_sec / num_processors / ticks_per_sec_base * 100
@@ -75,17 +79,21 @@ check_info["netapp_api_vf_stats"] = {
'has_perfdata' : True,
'group' : 'cpu_utilization_multiitem',
'service_description' : 'CPU utilization %s',
- 'includes' : [ "cpu_util.include",
"netapp_api.include" ]
+ 'includes' : [ "cpu_util.include",
"netapp_api.include" ],
+ 'extra_sections' : ['netapp_api_cpu'],
}
def inventory_netapp_api_vf_stats_traffic(parsed):
- for key in parsed.keys():
+ stats, _ = parsed
+ for key in stats.keys():
yield key, None
def check_netapp_api_vf_stats_traffic(item, params, parsed):
- vf = parsed.get(item)
+ stats, _ = parsed
+
+ vf = stats.get(item)
if not vf:
return
else: