Module: check_mk
Branch: master
Commit: 96f473c6bb952cbf6f90a4549c3e1ca8f4440a4a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=96f473c6bb952c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jun 15 12:15:19 2015 +0200
#2330 FIX windows_intel_bonding: Fix exception in case of no existing bonding device
---
.werks/2329 | 9 ++++++
.werks/2330 | 9 ++++++
ChangeLog | 2 ++
checks/windows_intel_bonding | 69 ++++++++++++++++++++++--------------------
4 files changed, 56 insertions(+), 33 deletions(-)
diff --git a/.werks/2329 b/.werks/2329
new file mode 100644
index 0000000..3dfb53a
--- /dev/null
+++ b/.werks/2329
@@ -0,0 +1,9 @@
+Title: windows_intel_bonding: Fix exception in case of no existing bonding device
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i2
+Date: 1434363248
+Class: fix
+
+
diff --git a/.werks/2330 b/.werks/2330
new file mode 100644
index 0000000..cff7ccf
--- /dev/null
+++ b/.werks/2330
@@ -0,0 +1,9 @@
+Title: windows_intel_bonding: Fix exception in case of no existing bonding device
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i2
+Date: 1434363304
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 701baa1..ff1215d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,8 @@
* 1257 FIX: oracle_jobs: Fix: Discovery now supports the old oracle plugin again
* 1258 FIX: fileinfo solaris: Fixed configuration crash...
* 2221 FIX: cisco_temperature: Fixed order of device levels for some devices...
+ * 2329 FIX: windows_intel_bonding: Fix exception in case of no existing bonding
device
+ * 2330 FIX: windows_intel_bonding: Fix exception in case of no existing bonding
device
Multisite:
* 2260 Improved load time of Check_MK GUI...
diff --git a/checks/windows_intel_bonding b/checks/windows_intel_bonding
index ac9ff8a..1fd680e 100644
--- a/checks/windows_intel_bonding
+++ b/checks/windows_intel_bonding
@@ -25,23 +25,23 @@
# Boston, MA 02110-1301 USA.
-#<<<windows_intel_bonding>>>
-#Caption Name RedundancyStatus
-#Bond_10.4 {714F579F-D17A-40DC-B684-083C561EE352} 2
+# <<<windows_intel_bonding>>>
+# Caption Name RedundancyStatus
+# Bond_10.4 {714F579F-D17A-40DC-B684-083C561EE352} 2
#
-####
-#AdapterFunction AdapterStatus GroupComponent
PartComponent
-#1 1
IANet_TeamOfAdapters.CreationClassName="IANet_TeamOfAdapters",Name="{714F579F-D17A-40DC-B684-083C561EE352}"
IANet_PhysicalEthernetAdapter.CreationClassName="IANet_PhysicalEthernetAdapter",DeviceID="{18EC3002-F03B-4B69-AD88-BFEB700460DC}",SystemCreationClassName="Win32_ComputerSystem",SystemName="Z3061021"
-#2 2
IANet_TeamOfAdapters.CreationClassName="IANet_TeamOfAdapters",Name="{714F579F-D17A-40DC-B684-083C561EE352}"
IANet_PhysicalEthernetAdapter.CreationClassName="IANet_PhysicalEthernetAdapter",DeviceID="{1EDEBE50-005F-4533-BAFC-E863617F1030}",SystemCreationClassName="Win32_ComputerSystem",SystemName="Z3061021"
+# ###
+# AdapterFunction AdapterStatus GroupComponent
PartComponent
+# 1 1
IANet_TeamOfAdapters.CreationClassName="IANet_TeamOfAdapters",Name="{714F579F-D17A-40DC-B684-083C561EE352}"
IANet_PhysicalEthernetAdapter.CreationClassName="IANet_PhysicalEthernetAdapter",DeviceID="{18EC3002-F03B-4B69-AD88-BFEB700460DC}",SystemCreationClassName="Win32_ComputerSystem",SystemName="Z3061021"
+# 2 2
IANet_TeamOfAdapters.CreationClassName="IANet_TeamOfAdapters",Name="{714F579F-D17A-40DC-B684-083C561EE352}"
IANet_PhysicalEthernetAdapter.CreationClassName="IANet_PhysicalEthernetAdapter",DeviceID="{1EDEBE50-005F-4533-BAFC-E863617F1030}",SystemCreationClassName="Win32_ComputerSystem",SystemName="Z3061021"
#
-####
-#AdapterStatus Caption
DeviceID
-#51 TEAM : Bond_10.4 - Intel(R) Gigabit ET Dual Port Server Adapter
{18EC3002-F03B-4B69-AD88-BFEB700460DC}
-#51 TEAM : Bond_10.4 - Intel(R) Gigabit ET Dual Port Server Adapter #2
{1EDEBE50-005F-4533-BAFC-E863617F1030}
-#35 Broadcom BCM5709C NetXtreme II GigE (NDIS VBD Client) #43
{55799336-A84B-4DA5-8EB9-B7426AA1AB75}
-#35 Broadcom BCM5709C NetXtreme II GigE (NDIS VBD Client) #35
{7DB9B461-FAC0-4763-9AF9-9A6CA6648188}
-#35 Broadcom BCM5709C NetXtreme II GigE (NDIS VBD Client) #40
{82AE1F27-BF28-4E30-AC3D-809DF5FF0D39}
-#35 Broadcom BCM5709C NetXtreme II GigE (NDIS VBD Client) #38
{DC918766-F61C-4801-92F8-E5532907EA0D}
+# ###
+# AdapterStatus Caption
DeviceID
+# 51 TEAM : Bond_10.4 - Intel(R) Gigabit ET Dual Port Server Adapter
{18EC3002-F03B-4B69-AD88-BFEB700460DC}
+# 51 TEAM : Bond_10.4 - Intel(R) Gigabit ET Dual Port Server Adapter #2
{1EDEBE50-005F-4533-BAFC-E863617F1030}
+# 35 Broadcom BCM5709C NetXtreme II GigE (NDIS VBD Client) #43
{55799336-A84B-4DA5-8EB9-B7426AA1AB75}
+# 35 Broadcom BCM5709C NetXtreme II GigE (NDIS VBD Client) #35
{7DB9B461-FAC0-4763-9AF9-9A6CA6648188}
+# 35 Broadcom BCM5709C NetXtreme II GigE (NDIS VBD Client) #40
{82AE1F27-BF28-4E30-AC3D-809DF5FF0D39}
+# 35 Broadcom BCM5709C NetXtreme II GigE (NDIS VBD Client) #38
{DC918766-F61C-4801-92F8-E5532907EA0D}
def get_real_adapter_name(bond, name):
prefix = "TEAM : %s - " % bond
@@ -55,28 +55,31 @@ def parse_windows_intel_bonding(info):
try:
# Get bond info
- lines.next() # Skip header
- while True:
- line = lines.next()
- if line[0] == "###":
- break
- bond_caption = " ".join(line[:-2])
- bond_name, bond_mode = line[-2], line[-1]
- bonds[bond_name] = { "caption": bond_caption, "mode":
bond_mode}
+ line = lines.next()
+ if line[0] != "###":
+ while True:
+ line = lines.next()
+ if line[0] == "###":
+ break
+ bond_caption = " ".join(line[:-2])
+ bond_name, bond_mode = line[-2], line[-1]
+ bonds[bond_name] = { "caption": bond_caption, "mode":
bond_mode}
# Get adapter info
- lines.next() # Skip header
- while True:
- line = lines.next()
- if line[0] == "###":
- break
- adapter_function, adapter_status = line[0], line[1]
- adapter_bond =
line[2].split(",")[-1].split("=")[1][1:-1]
- adapter = line[3].split(",")[1].split("=")[1][1:-1]
- adapters[adapter] = { "function": adapter_function,
"status": adapter_status, "bond": adapter_bond }
+ line = lines.next()
+ if line[0] != "###":
+ while True:
+ line = lines.next()
+ if line[0] == "###":
+ break
+ adapter_function, adapter_status = line[0], line[1]
+ print (line)
+ adapter_bond =
line[2].split(",")[-1].split("=")[1][1:-1]
+ adapter = line[3].split(",")[1].split("=")[1][1:-1]
+ adapters[adapter] = { "function": adapter_function,
"status": adapter_status, "bond": adapter_bond }
# Get adapter names
- lines.next() # Skip header
+ line = lines.next() # Skip header
while True:
line = lines.next()
adapter_names[line[-1]] = " ".join(line[1:-1])