Module: check_mk
Branch: master
Commit: db9243ebe8f92ac1ab8fa8822682d60a11112829
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=db9243ebe8f92a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Nov 9 13:31:43 2017 +0100
5241 FIX netapp_api_connection: removed some invalid warning messages, which appear on
virtual netapp systems
A virtual netapp system has no sensor information (temp, fan, etc.) available..
Change-Id: I5c9fe3ba6fb6f472c8440a871846fc5fc6d0d290
---
.werks/5241 | 11 +++++++++++
agents/special/agent_netapp | 17 ++++++++++++++---
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/.werks/5241 b/.werks/5241
new file mode 100644
index 0000000..b20167a
--- /dev/null
+++ b/.werks/5241
@@ -0,0 +1,11 @@
+Title: netapp_api_connection: removed some invalid warning messages, which appear on
virtual netapp systems
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1510230603
+
+A virtual netapp system has no sensor information (temp, fan, etc.) available..
diff --git a/agents/special/agent_netapp b/agents/special/agent_netapp
index 4a1d6c8..8829241 100755
--- a/agents/special/agent_netapp
+++ b/agents/special/agent_netapp
@@ -202,11 +202,19 @@ else:
class ErrorMessages():
def __init__(self):
- self.messages = set([])
+ self.messages = set()
def add_message(self, message):
self.messages.add(message)
+ def remove_messages(self, infix_text):
+ new_messages = set()
+ for message in self.messages:
+ if infix_text in message:
+ continue
+ new_messages.add(message)
+ self.messages = new_messages
+
def format_messages(self):
return "\n".join(self.messages)
@@ -544,10 +552,13 @@ def debug_node(node):
def output_error_section():
if opt_legacy:
- import pprint
- pprint.pprint(section_errors)
+ print "<<<netapp_api_connection>>>"
+ sys.stdout.write("\n".join(section_errors))
else:
print "<<<netapp_api_connection>>>"
+ # Remove some messages which may appear on a Netapp Simulator
+ server.error_messages.remove_messages("storage-shelf-environment-list-info:
Enclosure services scan not done")
+ server.error_messages.remove_messages("environment-sensors-get-iter: invalid
operation")
print server.error_messages.format_messages()
nodes = []