Module: check_mk
Branch: master
Commit: 2c4a983834b8d8f433a9446aec40f9b44cd2f029
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2c4a983834b8d8…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Mar 25 17:04:34 2014 +0100
ibm_svc_mdiskgrp: New check for status and usage of MDisksGrps in IBM SVC / V7000 devices
---
.werks/770 | 8 +++
ChangeLog | 1 +
checkman/ibm_svc_mdiskgrp | 43 ++++++++++++
checks/ibm_svc_mdiskgrp | 95 +++++++++++++++++++++++++++
pnp-templates/check_mk-ibm_svc_mdiskgrp.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
6 files changed, 149 insertions(+)
diff --git a/.werks/770 b/.werks/770
new file mode 100644
index 0000000..a8833c9
--- /dev/null
+++ b/.werks/770
@@ -0,0 +1,8 @@
+Title: ibm_svc_mdiskgrp: New check for status and usage of MDisksGrps in IBM SVC / V7000
devices
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1395763421
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index ce1239a..3f2c08e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -131,6 +131,7 @@
* 0598 kentix_temp, kentix_humidity: new checks for Kentix MultiSensor-Rack
* 0768 ibm_svc_license: New check for Licensing Status on IBM SVC / V7000 devices
* 0769 ibm_svc_mdisk: new check for status and mode of MDisks in an IBM SVC / V7000
device
+ * 0770 ibm_svc_mdiskgrp: New check for status and usage of MDisksGrps in IBM SVC /
V7000 devices
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/ibm_svc_mdiskgrp b/checkman/ibm_svc_mdiskgrp
new file mode 100644
index 0000000..7f5846d
--- /dev/null
+++ b/checkman/ibm_svc_mdiskgrp
@@ -0,0 +1,43 @@
+title: IBM SVC / V7000: Status and Usage of MDisksGrps
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Checks the status and usage of MDisksGrps in an IBM SVC / V7000 device.
+
+ It uses the check logic of the {df} check, so for configuration parameters
+ and examples please refer to the man page of {df}.
+
+ Additionally the status of the MDisksGrp is checked. On every other status
+ than {online} the check results in {CRIT} status.
+
+item:
+ The name of the MDisksGrp
+
+inventory:
+ Creates one check for every MDiskGrp in th IBM SVC / V7000 device.
+
+examples:
+ # set levels for the MDiskGrp Quorum_1 to 90% for WARN and 95% for CRIT
+ # for all hosts with the host tag ibmsvc
+ checkgroup_parameters['filesystem'] = [
+ ( {'levels': (90.0, 95.0)}, ['ibmsvc'], ALL_HOSTS,
['Quorum_1$'] ),
+ ] + checkgroup_parameters['filesystem']
+
+perfdata:
+ Three values: The first value is the used space of in the MDiskGrp
+ in MB. Also the minimum (0 MB), maximum (Capacity of the MDiskGrp)
+ and the warning and critical levels in MB are provided.
+ The second is the change of the usage in MB per range since the last check
+ (e.g. in MB per 24 hours) and the 3rd is the averaged change (so called
+ trend), also in MB per range. Please note, that performance data for
+ trends is enabled per default. You can globally disable that in {main.mk}
+ with {filesystem_default_levels["trend_perfdata"] = False}.
+
+[parameters]
+parameters (dict): See man page of {df}.
+
+[configuration]
+filesystem_default_levels: And other, see man page of {df}.
+
diff --git a/checks/ibm_svc_mdiskgrp b/checks/ibm_svc_mdiskgrp
new file mode 100644
index 0000000..c28ba6d
--- /dev/null
+++ b/checks/ibm_svc_mdiskgrp
@@ -0,0 +1,95 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# Example output from agent:
+# <<<ibm_svc_mdiskgrp:sep(58)>>>
+#
0:Quorum_2:online:1:0:704.00MB:64:704.00MB:0.00MB:0.00MB:0.00MB:0:0:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
1:stp5_450G_03:online:18:6:29.43TB:256:21.68TB:8.78TB:7.73TB:7.75TB:29:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
4:stp5_450G_02:online:15:14:24.53TB:256:277.00GB:24.26TB:24.26TB:24.26TB:98:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
9:stp6_450G_03:online:18:6:29.43TB:256:21.68TB:8.78TB:7.73TB:7.75TB:29:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
10:stp6_450G_02:online:15:14:24.53TB:256:277.00GB:24.26TB:24.26TB:24.26TB:98:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
15:stp6_300G_01:online:15:23:16.34TB:256:472.50GB:15.88TB:15.88TB:15.88TB:97:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
16:stp5_300G_01:online:15:23:16.34TB:256:472.50GB:15.88TB:15.88TB:15.88TB:97:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
17:Quorum_1:online:1:0:512.00MB:256:512.00MB:0.00MB:0.00MB:0.00MB:0:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
18:Quorum_0:online:1:0:512.00MB:256:512.00MB:0.00MB:0.00MB:0.00MB:0:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
21:stp5_450G_01:online:12:31:19.62TB:256:320.00GB:19.31TB:19.31TB:19.31TB:98:0:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
22:stp6_450G_01:online:12:31:19.62TB:256:320.00GB:19.31TB:19.31TB:19.31TB:98:0:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
23:stp5_600G_01:online:3:2:6.54TB:256:512.00MB:6.54TB:6.54TB:6.54TB:99:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+#
24:stp6_600G_01:online:3:2:6.54TB:256:512.00MB:6.54TB:6.54TB:6.54TB:99:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+
+def ibm_svc_mdiskgrp_to_mb(size):
+ if size.endswith("MB"):
+ size = int(float(size.replace("MB", "")))
+ elif size.endswith("GB"):
+ size = int(float(size.replace("GB", ""))) * 1024
+ elif size.endswith("TB"):
+ size = int(float(size.replace("TB", ""))) * 1024 * 1024
+ elif size.endswith("PB"):
+ size = int(float(size.replace("PB", ""))) * 1024 * 1024 *
1024
+ elif size.endswith("EB"):
+ size = int(float(size.replace("EB", ""))) * 1024 * 1024 * 1024
* 1024
+ return size
+
+def inventory_ibm_svc_mdiskgrp(info):
+ inventory = []
+ for mgrp_id, mgrp_name, mgrp_status, mdisk_count, vdisk_count, capacity, \
+ extent_size, free_capacity, virtual_capacity, used_capacity, \
+ real_capacity, overallocation, mgrp_warning, easy_tier, easy_tier_status, \
+ compression_active, compression_virtual_capacity,
compression_compressed_capacity, \
+ compression_uncompressed_capacity in info:
+ inventory.append( (mgrp_name, {}) )
+ return inventory
+
+def check_ibm_svc_mdiskgrp(item, params, info):
+ for mgrp_id, mgrp_name, mgrp_status, mdisk_count, vdisk_count, capacity, \
+ extent_size, free_capacity, virtual_capacity, used_capacity, \
+ real_capacity, overallocation, mgrp_warning, easy_tier, easy_tier_status, \
+ compression_active, compression_virtual_capacity,
compression_compressed_capacity, \
+ compression_uncompressed_capacity in info:
+ if mgrp_name == item:
+ if mgrp_status != "online":
+ return 2, "MDiskGrp %s reports status %s" % (item,
mgrp_status)
+ fslist = []
+ size_mb = ibm_svc_mdiskgrp_to_mb(capacity)
+ avail_mb = ibm_svc_mdiskgrp_to_mb(free_capacity)
+ fslist.append((item, size_mb, avail_mb))
+ status, message, perfdata = df_check_filesystem_list(item, params,
fslist)
+ message += ", MDiskGrp %s reports status %s" % (item,
mgrp_status)
+ return status, message, perfdata
+
+ return 3, "MDiskGrp %s not found in agent output" % item
+
+
+check_info["ibm_svc_mdiskgrp"] = {
+ "check_function" : check_ibm_svc_mdiskgrp,
+ "inventory_function" : inventory_ibm_svc_mdiskgrp,
+ "service_description" : "IBM SVC MDiskGrp %s",
+ "has_perfdata" : True,
+ "group" : "filesystem",
+ "includes" : [ "df.include" ],
+ "default_levels_variable" : "filesystem_default_levels",
+}
+
diff --git a/pnp-templates/check_mk-ibm_svc_mdiskgrp.php
b/pnp-templates/check_mk-ibm_svc_mdiskgrp.php
new file mode 120000
index 0000000..aac1010
--- /dev/null
+++ b/pnp-templates/check_mk-ibm_svc_mdiskgrp.php
@@ -0,0 +1 @@
+check_mk-hitachi_hnas_volume.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index dee8d8e..b9f7f4a 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -75,6 +75,7 @@ perfometers["check_mk-hitachi_hnas_span"] =
perfometer_check_mk_df
perfometers["check_mk-hitachi_hnas_volume"] = perfometer_check_mk_df
perfometers["check_mk-emcvnx_raidgroups.capacity"] = perfometer_check_mk_df
perfometers["check_mk-emcvnx_raidgroups.capacity_contiguous"] =
perfometer_check_mk_df
+perfometers["check_mk-ibm_svc_mdiskgrp"] = perfometer_check_mk_df
def perfometer_esx_vsphere_datastores(row, check_command, perf_data):
used_mb = perf_data[0][1]