Module: check_mk
Branch: master
Commit: 5d07bc69afb2790a84a65074086f65eb5bcfa251
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5d07bc69afb279…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Dec 1 12:51:24 2016 +0100
3998 FIX agent_netapp / netapp_api_if: improved mechanism to collect interface infos.
fixes invalid if-speed
The speed of most interface was not correctly determined.
This has been fixed by the new agent. You need to do a new service
discovery of the netapp systems. Otherwise the existing netapp_api_if
checks will raise a warning, stating that the speed differs.
---
.werks/3998 | 12 ++++++++++++
ChangeLog | 2 ++
agents/special/agent_netapp | 44 ++++++++++++++++++++++++++++++--------------
3 files changed, 44 insertions(+), 14 deletions(-)
diff --git a/.werks/3998 b/.werks/3998
new file mode 100644
index 0000000..1e03a22
--- /dev/null
+++ b/.werks/3998
@@ -0,0 +1,12 @@
+Title: agent_netapp / netapp_api_if: improved mechanism to collect interface infos. fixes
invalid if-speed
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.4.0i3
+Date: 1480592904
+Class: fix
+
+The speed of most interface was not correctly determined.
+This has been fixed by the new agent. You need to do a new service
+discovery of the netapp systems. Otherwise the existing netapp_api_if
+checks will raise a warning, stating that the speed differs.
diff --git a/ChangeLog b/ChangeLog
index 0abbb95..b59d44e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,8 @@
* 3943 FIX: ntp.time: fixed parameters in discovered checks...
* 3994 FIX: windows agent: fixed memory and file handle leak when using windows
eventlog...
* 4081 FIX: dell_powerconnect_cpu: Fixed broken metrics
+ * 3998 FIX: agent_netapp / netapp_api_if: improved mechanism to collect interface
infos. fixes invalid if-speed...
+ NOTE: Please refer to the migration notes!
Multisite:
* 4070 Added a painter for the service check period
diff --git a/agents/special/agent_netapp b/agents/special/agent_netapp
index 2f1d3a4..f6f9c0a 100755
--- a/agents/special/agent_netapp
+++ b/agents/special/agent_netapp
@@ -890,28 +890,44 @@ try:
if interfaces:
print "<<<netapp_api_if:sep(9)>>>"
- port_dict = create_dict(ports, custom_key = ["node",
"port"], is_counter = False)
- if_dict = create_dict(if_counters, custom_key = "instance_name")
- map_if_nodeport_to_name = {}
- for key, values in if_dict.items():
- map_if_nodeport_to_name[(values["node_name"],
values["current_port"])] = key
-
- mod_port_dict = {}
- for key, values in port_dict.items():
- port_key = map_if_nodeport_to_name.get((values["node"],
values["port"]))
- if port_key:
- mod_port_dict[port_key] = values
+ extra_info = {}
+ interface_dict = create_dict(interfaces, custom_key =
"interface-name", is_counter = False)
+ port_dict = create_dict(ports, custom_key = ["node",
"port"], is_counter = False)
+ if_counters_dict = create_dict(if_counters, custom_key =
"instance_name")
+ # Process counters
# NetApp clustermode reports sent_data instead of send_data..
- for key, values in if_dict.items():
+ for key, values in if_counters_dict.items():
for old, new in [ ("sent_data", "send_data"),
("sent_packet", "send_packet"),
("sent_errors", "send_errors") ]:
values[new] = values[old]
del values[old]
- extra_info = if_dict
- for key, values in mod_port_dict.items():
+ extra_counter_info = {}
+ for key, values in if_counters_dict.items():
+ if ":" in key:
+ vserver, name = key.split(":", 1)
+ else:
+ name = key
+ extra_counter_info[name] = values
+
+ # Process ports
+ extra_port_info = {}
+ for the_port, port_values in port_dict.items():
+ port_name = port_values.get("port")
+ port_node = port_values.get("node")
+
+ node, port = the_port.split("|")
+ for if_key, if_values in interface_dict.items():
+ port = if_values.get("current-port")
+ node = if_values.get("current-node")
+ if port_name == port and port_node == node:
+ extra_port_info[if_key] = port_values
+
+ extra_info = extra_counter_info
+ for key, values in extra_port_info.items():
+ extra_info.setdefault(key, {})
extra_info[key].update(values)
print format_config(interfaces, "interface",
"interface-name",