Module: check_mk
Branch: master
Commit: af5e9bb9ace30b0b53232f93fe837b7e3c8a866a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=af5e9bb9ace30b…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Thu May 18 14:20:01 2017 +0200
4736 FIX ucs_bladecenter_if: Fixed crash if fabric interconnects are aggregated
This check has never supported aggregated fabric interconnects until now.
Change-Id: Ibc246402f6f454cb56081739a5e52dc58849234a
---
.werks/4736 | 10 ++++++++++
checks/ucs_bladecenter_if | 5 ++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/4736 b/.werks/4736
new file mode 100644
index 0000000..5fc56e9
--- /dev/null
+++ b/.werks/4736
@@ -0,0 +1,10 @@
+Title: ucs_bladecenter_if: Fixed crash if fabric interconnects are aggregated
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1495109864
+Class: fix
+
+This check has never supported aggregated fabric interconnects until now.
diff --git a/checks/ucs_bladecenter_if b/checks/ucs_bladecenter_if
index c16f880..d98ded7 100644
--- a/checks/ucs_bladecenter_if
+++ b/checks/ucs_bladecenter_if
@@ -92,7 +92,10 @@ def parse_ucs_bladecenter_if(info):
# Interconnect-Portchannel Members
for key, values in data.get("fabricDceSwSrvPcEp", {}).items():
- pc_name =
"/".join(values.get("Dn").split("/")[:-1])
+ if len(values.get("Dn").split("/")[:-1]) == 4:
+ pc_name =
"/".join(values.get("Dn").split("/")[:-1])
+ else:
+ pc_name =
"/".join(values.get("Dn").split("/")[:-2])
values["portchannel"] = icnt_pc_info[pc_name]
icnt_pc_info[pc_name].setdefault("members", 0)
icnt_pc_info[pc_name]["members"] += 1