2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
11 # +------------------------------------------------------------------+
13 # This file is part of Check_MK.
14 # The official homepage is at http://mathias-kettner.de/check_mk.
16 # check_mk is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by
18 # the Free Software Foundation in version 2. check_mk is distributed
19 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
20 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
22 # tails. You should have received a copy of the GNU General Public
23 # License along with GNU Make; see the file COPYING. If not, write
24 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
25 # Boston, MA 02110-1301 USA.
27 # <<<windows_os_bonding:sep(58)>>>
29 # Bonding Mode: Dynamic
34 # Slave Interface: Ethernet_14
35 # Slave Description: Intel(R) Ethernet 10G 2P X520-k bNDC #2
37 # Slave Speed: 10 Gbps
38 # Slave MAC address: 18-A9-9B-9F-AD-28
41 # Slave Interface: Ethernet_10
42 # Slave Description: Intel(R) Ethernet 10G 2P X520-k bNDC
44 # Slave Speed: 10 Gbps
45 # Slave MAC address: 18-A9-9B-9F-AD-2A
48 def parse_windows_os_bonding(info
):
53 item
= line
[1].lstrip()
54 if line
[0] == "Team Name":
57 bonds
[bond
]["interfaces"] = {}
58 elif line
[0] == "Bonding Mode":
59 bonds
[bond
]["mode"] = item
60 elif line
[0] == "Status":
61 bonds
[bond
]["status"] = item
.lower()
62 elif line
[0] == "Speed":
63 bonds
[bond
]["speed"] = item
64 elif line
[0] == "Slave Name":
66 bonds
[bond
]["interfaces"][slave
] = {}
67 elif line
[0] == "Slave Status":
68 bonds
[bond
]["interfaces"][slave
]["status"] = item
.lower()
69 elif line
[0] == "Slave MAC address":
70 bonds
[bond
]["interfaces"][slave
]["hwaddr"] = item
.lower().replace("-", ":")
74 check_info
['windows_os_bonding'] = {
75 "parse_function": parse_windows_os_bonding
,
76 "check_function": check_bonding
,
77 "inventory_function": inventory_bonding
,
78 "service_description": "Bonding Interface %s",
79 "default_levels_variable": "bonding_default_levels",
81 "includes": ["bonding.include"],