Module: check_mk
Branch: master
Commit: bf3bb7bba35b919e53b4b210a6550bfe512d100d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bf3bb7bba35b91…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Sep 27 11:15:03 2018 +0200
6732 FIX agent_netapp: Skip attributes which are not available
Change-Id: I349aa1d1891e53391ef93fcb31e5839654f2c135
---
.werks/6732 | 11 +++++++++++
agents/special/agent_netapp | 24 ++++++++++++++----------
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/.werks/6732 b/.werks/6732
new file mode 100644
index 0000000..3dca08e
--- /dev/null
+++ b/.werks/6732
@@ -0,0 +1,11 @@
+Title: agent_netapp: Skip attributes which are not available
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1538039636
+
+
diff --git a/agents/special/agent_netapp b/agents/special/agent_netapp
index 0539ba0..884e083 100755
--- a/agents/special/agent_netapp
+++ b/agents/special/agent_netapp
@@ -658,13 +658,15 @@ def query(what, return_toplevel_node = False):
while tag_string:
# We need to start additinal query until all data is fetched
tag_response = server.get_response([what, [["max-records",
max_records],["tag", tag_string]]])
-
- # Get attributes-list and add this content to the initial response
- tag_string =
tag_response.get_results().child_get_string("next-tag")
- attr_childs =
tag_response.get_results().child_get("attributes-list")
+ if tag_response.result_status() != "passed":
+ return
if tag_response.get_results().child_get_string("num-records") ==
"0":
break
- results.extend_attributes_list(attr_childs)
+
+ # Get attributes-list and add this content to the initial response
+ tag_string =
tag_response.get_results().child_get_string("next-tag")
+ attr_children =
tag_response.get_results().child_get("attributes-list")
+ results.extend_attributes_list(attr_children)
if return_toplevel_node:
return results
@@ -720,13 +722,15 @@ def query_counters(what):
# We need to start additinal query until all data is fetched
tag_response =
server.get_response(["perf-object-instance-list-info-iter",
[["objectname", what],
["max-records", max_records], ["tag", tag_string]]])
-
- # Get attributes-list and add this content to the initial response
- tag_string =
tag_response.get_results().child_get_string("next-tag")
- attr_childs =
tag_response.get_results().child_get("attributes-list")
+ if tag_response.result_status() != "passed":
+ return
if tag_response.get_results().child_get_string("num-records")
== "0":
break
- results.extend_attributes_list(attr_childs)
+
+ # Get attributes-list and add this content to the initial response
+ tag_string =
tag_response.get_results().child_get_string("next-tag")
+ attr_children =
tag_response.get_results().child_get("attributes-list")
+ results.extend_attributes_list(attr_children)
if response.results_status() != "passed":
return