Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / checks / hp_msa_disk
blob989687266f38b07bb01199c1bab02d74f53f4fe7
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 # drives 1 durable-id disk_01.01
28 # drives 1 enclosure-id 1
29 # drives 1 drawer-id 255
30 # drives 1 slot 1
31 # drives 1 location 1.1
32 # drives 1 port 0
33 # drives 1 scsi-id 0
34 # drives 1 blocks 1172123568
35 # drives 1 serial-number W7GB13NV
36 # drives 1 vendor HP
37 # drives 1 model EG0600FBVFP
38 # drives 1 revision HPDC
39 # drives 1 secondary-channel 0
40 # drives 1 container-index 0
41 # drives 1 member-index 0
42 # drives 1 description SAS
43 # drives 1 description-numeric 4
44 # drives 1 architecture HDD
45 # drives 1 architecture-numeric 1
46 # drives 1 interface SAS
47 # drives 1 interface-numeric 0
48 # drives 1 single-ported Disabled
49 # drives 1 single-ported-numeric 0
50 # drives 1 type SAS
51 # drives 1 type-numeric 4
52 # drives 1 usage LINEAR POOL
53 # drives 1 usage-numeric 1
54 # drives 1 job-running
55 # drives 1 job-running-numeric 0
56 # drives 1 state LINEAR POOL
57 # drives 1 current-job-completion
58 # drives 1 blink 0
59 # drives 1 locator-led Off
60 # drives 1 locator-led-numeric 0
61 # drives 1 speed 0
62 # drives 1 smart Enabled
63 # drives 1 smart-numeric 1
64 # drives 1 dual-port 1
65 # drives 1 error 0
66 # drives 1 fc-p1-channel 0
67 # drives 1 fc-p1-device-id 0
68 # drives 1 fc-p1-node-wwn 5000CCA07014111C
69 # drives 1 fc-p1-port-wwn 0000000000000000
70 # drives 1 fc-p1-unit-number 0
71 # drives 1 fc-p2-channel 0
72 # drives 1 fc-p2-device-id 0
73 # drives 1 fc-p2-node-wwn
74 # drives 1 fc-p2-port-wwn
75 # drives 1 fc-p2-unit-number 0
76 # drives 1 drive-down-code 0
77 # drives 1 owner A
78 # drives 1 owner-numeric 1
79 # drives 1 index 0
80 # drives 1 rpm 10
81 # drives 1 size 600.1GB
82 # drives 1 size-numeric 1172123568
83 # drives 1 sector-format 512n
84 # drives 1 sector-format-numeric 0
85 # drives 1 transfer-rate 6.0
86 # drives 1 transfer-rate-numeric 3
87 # drives 1 attributes
88 # drives 1 attributes-numeric 2
89 # drives 1 enclosure-wwn 500C0FF01E82BB3C
90 # drives 1 recon-state N/A
91 # drives 1 recon-state-numeric 0
92 # drives 1 copyback-state N/A
93 # drives 1 copyback-state-numeric 0
94 # drives 1 virtual-disk-serial 00c0ff1ec44a00001e23415500000000
95 # drives 1 disk-group IMSAKO2B1_U1_B01-04
96 # drives 1 storage-pool-name IMSAKO2B1_U1_B01-04
97 # drives 1 storage-tier N/A
98 # drives 1 storage-tier-numeric 0
99 # drives 1 ssd-life-left N/A
100 # drives 1 ssd-life-left-numeric 255
101 # drives 1 led-status-numeric 1
102 # drives 1 disk-dsd-count 0
103 # drives 1 spun-down 0
104 # drives 1 number-of-ios 0
105 # drives 1 total-data-transferred 0B
106 # drives 1 total-data-transferred-numeric 0
107 # drives 1 avg-rsp-time 0
108 # drives 1 fde-state Not FDE Capable
109 # drives 1 fde-state-numeric 1
110 # drives 1 lock-key-id 00000000
111 # drives 1 import-lock-key-id 00000000
112 # drives 1 fde-config-time N/A
113 # drives 1 fde-config-time-numeric 0
114 # drives 1 pi-formatted Unsupported
115 # drives 1 pi-formatted-numeric 4
116 # drives 1 power-on-hours 2663
117 # drives 1 health OK
118 # drives 1 health-numeric 0
119 # drives 1 health-reason
120 # drives 1 health-recommendation
121 # disk-statistics 1 durable-id disk_01.01
122 # disk-statistics 1 serial-number W7GB13NV
123 # disk-statistics 1 bytes-per-second 771.0KB
124 # disk-statistics 1 bytes-per-second-numeric 771072
125 # disk-statistics 1 iops 13
126 # disk-statistics 1 number-of-reads 49797666
127 # disk-statistics 1 number-of-writes 20095262
128 # disk-statistics 1 data-read 50.6TB
129 # disk-statistics 1 data-read-numeric 50656968970752
130 # disk-statistics 1 data-written 2800.2GB
131 # disk-statistics 1 data-written-numeric 2800282933760
132 # disk-statistics 1 queue-depth 0
133 # disk-statistics 1 reset-time 2015-05-22 13:55:39
134 # disk-statistics 1 reset-time-numeric 1432302939
135 # disk-statistics 1 start-sample-time 2015-08-18 10:37:02
136 # disk-statistics 1 start-sample-time-numeric 1439894222
137 # disk-statistics 1 stop-sample-time 2015-08-18 11:09:27
138 # disk-statistics 1 stop-sample-time-numeric 1439896167
139 # disk-statistics 1 smart-count-1 0
140 # disk-statistics 1 io-timeout-count-1 0
141 # disk-statistics 1 no-response-count-1 0
142 # disk-statistics 1 spinup-retry-count-1 0
143 # disk-statistics 1 number-of-media-errors-1 0
144 # disk-statistics 1 number-of-nonmedia-errors-1 6
145 # disk-statistics 1 number-of-block-reassigns-1 0
146 # disk-statistics 1 number-of-bad-blocks-1 0
147 # disk-statistics 1 smart-count-2 0
148 # disk-statistics 1 io-timeout-count-2 0
149 # disk-statistics 1 no-response-count-2 0
150 # disk-statistics 1 spinup-retry-count-2 0
151 # disk-statistics 1 number-of-media-errors-2 0
152 # disk-statistics 1 number-of-nonmedia-errors-2 1
153 # disk-statistics 1 number-of-block-reassigns-2 0
154 # disk-statistics 1 number-of-bad-blocks-2 0
156 # .--health--------------------------------------------------------------.
157 # | _ _ _ _ |
158 # | | |__ ___ __ _| | |_| |__ |
159 # | | '_ \ / _ \/ _` | | __| '_ \ |
160 # | | | | | __/ (_| | | |_| | | | |
161 # | |_| |_|\___|\__,_|_|\__|_| |_| |
162 # | |
163 # +----------------------------------------------------------------------+
164 # | main check |
165 # '----------------------------------------------------------------------'
167 check_info['hp_msa_disk'] = {
168 'parse_function': parse_hp_msa,
169 'inventory_function': inventory_hp_msa_health,
170 'check_function': check_hp_msa_health,
171 'service_description': 'Disk Health %s',
172 'includes': ["hp_msa.include"],
176 # .--disk IO-------------------------------------------------------------.
177 # | _ _ _ ___ ___ |
178 # | __| (_)___| | __ |_ _/ _ \ |
179 # | / _` | / __| |/ / | | | | | |
180 # | | (_| | \__ \ < | | |_| | |
181 # | \__,_|_|___/_|\_\ |___\___/ |
182 # | |
183 # '----------------------------------------------------------------------'
185 check_info['hp_msa_disk.io'] = {
186 'inventory_function': inventory_hp_msa_io,
187 'check_function': check_hp_msa_io,
188 'service_description': 'Disks IO %s',
189 'has_perfdata': True,
190 'group': 'diskstat',
191 'includes': ["hp_msa.include", "diskstat.include"],
195 # .--temperature---------------------------------------------------------.
196 # | _ _ |
197 # | | |_ ___ _ __ ___ _ __ ___ _ __ __ _| |_ _ _ _ __ ___ |
198 # | | __/ _ \ '_ ` _ \| '_ \ / _ \ '__/ _` | __| | | | '__/ _ \ |
199 # | | || __/ | | | | | |_) | __/ | | (_| | |_| |_| | | | __/ |
200 # | \__\___|_| |_| |_| .__/ \___|_| \__,_|\__|\__,_|_| \___| |
201 # | |_| |
202 # '----------------------------------------------------------------------'
204 factory_settings["hp_msa_disk_temp_default_levels"] = {
205 "levels": (40.0, 45.0), # just an assumption
209 def inventory_hp_msa_disk_temp(parsed):
210 return [("Disks", {})]
213 def check_hp_msa_disk_temp(item, params, parsed):
214 disks = []
215 for key, values in parsed.items():
216 disks.append((key, float(values["temperature-numeric"])))
218 return check_temperature_list(disks, params, "hp_msa_disk_temp_%s" % item)
221 check_info['hp_msa_disk.temp'] = {
222 'inventory_function': inventory_hp_msa_disk_temp,
223 'check_function': check_hp_msa_disk_temp,
224 'service_description': 'Temperature %s',
225 'group': 'temperature',
226 'has_perfdata': True,
227 'default_levels_variable': "hp_msa_disk_temp_default_levels",
228 'includes': ["hp_msa.include", "temperature.include"],