Cleanup config.nodes_of
[check_mk.git] / checks / hp_msa_system
blob5557f2f618089c4e5308d01f0ab781ce9d09e9ed
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2015 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 # <<<hp_msa_system>>>
28 # system 1 system-name IMSAKO2B1
29 # system 1 system-contact cia@cgm.com
30 # system 1 system-location Rack B1
31 # system 1 system-information Uninitialized Info
32 # system 1 midplane-serial-number 00C0FF1E82BB
33 # system 1 vendor-name HP
34 # system 1 product-id MSA 2040 SAN
35 # system 1 product-brand MSA Storage
36 # system 1 scsi-vendor-id HP
37 # system 1 scsi-product-id MSA 2040 SAN
38 # system 1 enclosure-count 1
39 # system 1 health OK
40 # system 1 health-numeric 0
41 # system 1 health-reason
42 # system 1 other-MC-status Operational
43 # system 1 other-MC-status-numeric 4754
44 # system 1 pfuStatus Idle
45 # system 1 supported-locales English (English), Spanish (español), French (français), German (Deutsch), Italian (italiano), Japanese (日本語), Dutch (Nederlands), Chinese-Simplified (简体中文), Chinese-Traditional (繁體中文), Korean (한국어)
46 # system 1 current-node-wwn 208000c0ff1e82bb
47 # system 1 fde-security-status Unsecured
48 # system 1 fde-security-status-numeric 1
49 # system 1 platform-type Gallium
50 # system 1 platform-type-numeric 3
51 # system 1 platform-brand HP Cardinals
52 # system 1 platform-brand-numeric 15
53 # redundancy 2 redundancy-mode Active-Active ULP
54 # redundancy 2 redundancy-mode-numeric 8
55 # redundancy 2 redundancy-status Redundant
56 # redundancy 2 redundancy-status-numeric 2
57 # redundancy 2 controller-a-status Operational
58 # redundancy 2 controller-a-status-numeric 0
59 # redundancy 2 controller-a-serial-number 7CE501N158
60 # redundancy 2 controller-b-status Operational
61 # redundancy 2 controller-b-status-numeric 0
62 # redundancy 2 controller-b-serial-number 7CE501M190
63 # redundancy 2 other-MC-status Operational
64 # redundancy 2 other-MC-status-numeric 4754
67 def parse_hp_msa_system(info):
68 parsed = {}
69 for line in info:
70 if line[2] == "system-name":
71 system_name = " ".join(line[3:])
72 parsed[system_name] = {"item_type": line[0]}
73 elif line[2] == "health":
74 parsed[system_name]["health"] = " ".join(line[3:])
75 elif line[2] == "health-reason":
76 parsed[system_name]["health-reason"] = " ".join(line[3:])
78 return parsed
81 check_info['hp_msa_system'] = {
82 'parse_function': parse_hp_msa_system,
83 'inventory_function': inventory_hp_msa_health,
84 'check_function': check_hp_msa_health,
85 'service_description': 'System Health %s',
86 'includes': ["hp_msa.include"],