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 # Example output from agent:
31 # Server IP Address: 10.1.36.13
32 # Agent Rev: 7.32.25 (1.56)
35 # Agent/Host Information
36 # -----------------------
40 # Agent Rev: 7.32.25 (1.56)
43 # Node: A-CKM00114701225
46 # Peer Signature: 3187006
47 # Revision: 05.32.000.5.201
50 # Model Type: Rackmount
53 # Serial No: CKM00114701225
57 # Name of the software package: -Compression
58 # Revision of the software package: -
62 # Is installation completed: YES
63 # Is this System Software: NO
65 # [... more software packages follow ...]
68 def parse_emcvnx_info(info
):
77 'System Fault LED': 'info',
78 'Server IP Address': 'info',
79 'System Date': 'info',
80 'System Time': 'info',
81 'Serial Number For The SP': 'info',
82 'Storage Processor': 'storage',
83 'Storage Processor Network Name': 'storage',
84 'Storage Processor IP Address': 'storage',
85 'Storage Processor Subnet Mask': 'storage',
86 'Storage Processor Gateway Address': 'storage',
87 'Storage Processor IPv6 Mode': 'storage',
88 'Link Status': 'link',
89 'Current Speed': 'link',
90 'Requested Speed': 'link',
91 'Auto-Negotiate': 'link',
92 'Capable Speeds': 'link',
93 'Statistics Logging': 'config',
94 'SP Read Cache State': 'config',
95 'SP Write Cache State': 'config',
96 'Hw_flush_on': 'config',
97 'Idle_flush_on': 'config',
98 'Lw_flush_off': 'config',
100 'Average Requests': 'io',
103 'Total Writes': 'io',
104 'Read_requests': 'io',
105 'Write_requests': 'io',
107 'Blocks_written': 'io',
108 'Sum_queue_lengths_by_arrivals': 'io',
109 'Arrivals_to_non_zero_queue': 'io',
110 'Write_cache_flushes': 'io',
111 'Write_cache_blocks_flushed': 'io',
114 preparsed
, errors
= preparse_emcvnx_info(info
)
116 for key
, value
in preparsed
:
117 subcheck
= key_to_subcheck
.get(key
)
119 parsed
[subcheck
].append((key
, value
))
120 return parsed
, errors
123 def inventory_emcvnx_info(parsed
, subcheck
):
124 output
, _errors
= parsed
126 return [(None, None)]
129 # .--Info----------------------------------------------------------------.
131 # | |_ _|_ __ / _| ___ |
132 # | | || '_ \| |_ / _ \ |
133 # | | || | | | _| (_) | |
134 # | |___|_| |_|_| \___/ |
136 # '----------------------------------------------------------------------'
139 def check_emcvnx_info(item
, _no_params
, parsed
):
140 output
, errors
= parsed
143 yield 2, ('Error(s) while parsing the output. This may effect the '
144 'discovery of other emcvnx services. Please check your naviseccli '
145 'configuration. Errors are: %s' % (' '.join(errors
)))
147 for key
, value
in output
['info']:
149 if key
== 'System Fault LED' and value
!= 'OFF':
151 yield status
, "%s: %s" % (key
, value
)
154 check_info
['emcvnx_info'] = {
155 "parse_function": parse_emcvnx_info
,
156 "inventory_function": lambda x
: inventory_emcvnx_info(x
, 'info'),
157 "check_function": check_emcvnx_info
,
158 "service_description": "EMC VNX Info",
159 "includes": ["emcvnx.include"],
162 # .--Storage-------------------------------------------------------------.
164 # | / ___|| |_ ___ _ __ __ _ __ _ ___ |
165 # | \___ \| __/ _ \| '__/ _` |/ _` |/ _ \ |
166 # | ___) | || (_) | | | (_| | (_| | __/ |
167 # | |____/ \__\___/|_| \__,_|\__, |\___| |
169 # '----------------------------------------------------------------------'
172 def check_emcvnx_storage(item
, params
, parsed
):
174 for key
, value
in output
['storage']:
175 yield 0, '%s: %s' % (key
, value
)
178 check_info
['emcvnx_info.storage'] = {
179 "inventory_function": lambda x
: inventory_emcvnx_info(x
, 'storage'),
180 "check_function": check_emcvnx_storage
,
181 "service_description": "EMC VNX Storage Processor"
184 # .--Link----------------------------------------------------------------.
186 # | | | (_)_ __ | | __ |
187 # | | | | | '_ \| |/ / |
188 # | | |___| | | | | < |
189 # | |_____|_|_| |_|_|\_\ |
191 # '----------------------------------------------------------------------'
194 def check_emcvnx_link(item
, params
, parsed
):
196 for key
, value
in output
['link']:
198 if key
== u
'Link Status' and value
!= u
'Link-Up':
200 yield status
, '%s: %s' % (key
, value
)
203 check_info
['emcvnx_info.link'] = {
204 "inventory_function": lambda x
: inventory_emcvnx_info(x
, 'link'),
205 "check_function": check_emcvnx_link
,
206 "service_description": "EMC VNX Link"
209 # .--Config--------------------------------------------------------------.
211 # | / ___|___ _ __ / _(_) __ _ |
212 # | | | / _ \| '_ \| |_| |/ _` | |
213 # | | |__| (_) | | | | _| | (_| | |
214 # | \____\___/|_| |_|_| |_|\__, | |
216 # '----------------------------------------------------------------------'
219 def check_emcvnx_config(item
, params
, parsed
):
221 for key
, value
in output
['config']:
222 yield 0, '%s: %s' % (key
, value
)
225 check_info
['emcvnx_info.config'] = {
226 "inventory_function": lambda x
: inventory_emcvnx_info(x
, 'config'),
227 "check_function": check_emcvnx_config
,
228 "service_description": "EMC VNX Config"
231 # .--IO------------------------------------------------------------------.
238 # '----------------------------------------------------------------------'
241 def check_emcvnx_io(item
, params
, parsed
):
243 for key
, value
in output
['io']:
245 if key
== 'Hard errors' and value
!= 'N/A':
247 yield status
, '%s: %s' % (key
, value
)
250 check_info
['emcvnx_info.io'] = {
251 "inventory_function": lambda x
: inventory_emcvnx_info(x
, 'io'),
252 "check_function": check_emcvnx_io
,
253 "service_description": "EMC VNX IO"