Module: check_mk
Branch: master
Commit: 24e9d3aa19221afd22b8b7bb308baae3f46ea30a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=24e9d3aa19221a…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon Jun 26 11:59:00 2017 +0200
4823 FIX netapp_api_cpu: Fixed crash if data for node is missing
The checkplugin does not crash anymore if the cpu data for a node is
missing. Instead the state will now change to UNKNOWN.
Change-Id: I1054e9a0d9e4ab04d82fd91fd871f8157fbdaf9c
---
.werks/4823 | 11 +++++++++++
checks/netapp_api_cpu | 2 ++
2 files changed, 13 insertions(+)
diff --git a/.werks/4823 b/.werks/4823
new file mode 100644
index 0000000..f555ff2
--- /dev/null
+++ b/.werks/4823
@@ -0,0 +1,11 @@
+Title: netapp_api_cpu: Fixed crash if data for node is missing
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1498471053
+Class: fix
+
+The checkplugin does not crash anymore if the cpu data for a node is
+missing. Instead the state will now change to UNKNOWN.
diff --git a/checks/netapp_api_cpu b/checks/netapp_api_cpu
index a72f767..e689d8f 100644
--- a/checks/netapp_api_cpu
+++ b/checks/netapp_api_cpu
@@ -69,6 +69,8 @@ def check_netapp_api_cpu_utilization(item, params, parsed, mode):
mode_data = parsed.get(mode)
if item:
data = mode_data.get(item)
+ if data == None:
+ return 3, "No data available!"
else:
data = mode_data