Cleanup config.nodes_of
[check_mk.git] / checks / emc_vplex_director_stats
blobbc8eec2d1a317c68489f565d9dda156369378768
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
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.
28 def parse_emc_director_stats(info):
29 directors = {}
30 now = time.time()
31 for line in info:
32 directors["%s_FE" % line[0]] = {
33 "node": None,
34 "read_ios": get_rate("fe_readio.%s" % line[0], now, int(line[1])),
35 "write_ios": get_rate("fe_writeio.%s" % line[0], now, int(line[2])),
36 "queue_length": int(line[3]),
37 "average_read_wait": float(line[5]) / 1000000,
38 "average_write_wait": float(line[6]) / 1000000,
39 "read_throughput": get_rate("fe_readbytes.%s" % line[0], now, int(line[7])),
40 "write_throughput": get_rate("fe_writebytes.%s" % line[0], now, int(line[8])),
42 directors["%s_BE" % line[0]] = {
43 "node": None,
44 "read_ios": get_rate("be_readio.%s" % line[0], now, int(line[9])),
45 "write_ios": get_rate("be_writeio.%s" % line[0], now, int(line[10])),
46 "average_read_wait": float(line[11]) / 1000000,
47 "average_write_wait": float(line[12]) / 1000000,
48 "read_throughput": get_rate("be_readbytes.%s" % line[0], now, int(line[13])),
49 "write_throughput": get_rate("be_writebytes.%s" % line[0], now, int(line[14])),
52 return directors
55 def inventory_emc_director_stats(parsed):
56 return inventory_diskstat_generic([(None, x) for x in parsed.keys()])
59 def check_emc_director_stats(item, params, parsed):
60 # The check_diskstat_dict function may compute average values
61 # We won't allow this if some of the counters have wrapped
62 if last_counter_wrap():
63 raise MKCounterWrapped("Value overflow")
64 return check_diskstat_dict(item, params, parsed)
66 check_info["emc_vplex_director_stats"] = {
67 "parse_function" : parse_emc_director_stats,
68 "check_function" : check_emc_director_stats,
69 "inventory_function" : inventory_emc_director_stats,
70 "service_description" : "Disk IO Director %s",
71 "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.1.0") == "" and\
72 oid(".1.3.6.1.4.1.1139.21.2.2.8.1.*"),
73 "snmp_info" : (".1.3.6.1.4.1.1139.21.2.2", [
74 "1.1.3", # vplexDirectorName
76 "4.1.1", # vplexDirectorFEOpsRead
77 "4.1.2", # vplexDirectorFEOpsWrite
78 "4.1.3", # vplexDirectorFEOpsQueued
79 "4.1.4", # vplexDirectorFEOpsActive
80 "4.1.5", # vplexDirectorFEOpsAvgReadLatency
81 "4.1.6", # vplexDirectorFEOpsAvgWriteLatency
82 "4.1.7", # vplexDirectorFEBytesRead
83 "4.1.8", # vplexDirectorFEBytesWrite
85 "6.1.1", # vplexDirectorBEOpsRead
86 "6.1.2", # vplexDirectorBEOpsWrite
87 "6.1.5", # vplexDirectorBEOpsAvgReadLatency
88 "6.1.6", # vplexDirectorBEOpsAvgWriteLatency
89 "6.1.7", # vplexDirectorBEBytesRead
90 "6.1.8", # vplexDirectorBEBytesWrite
91 OID_END ]),
92 "has_perfdata" : True,
93 "group" : "diskstat",
94 "default_levels_variable" : "diskstat_default_levels",
95 "includes" : [ "diskstat.include" ],