Module: check_mk
Branch: master
Commit: 3020f99c0d452a879f6f3c8a8420d53033288e36
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3020f99c0d452a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jan 9 12:46:37 2015 +0100
#1838 emc_datadomain_mtree: New check for EMC Datadomain MTrees
Thanks to Hubert Bösl!
---
.werks/1838 | 10 ++++++
ChangeLog | 1 +
checkman/emc_datadomain_mtree | 23 ++++++++++++++
checks/emc_datadomain_mtree | 68 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 102 insertions(+)
diff --git a/.werks/1838 b/.werks/1838
new file mode 100644
index 0000000..0b2f5b6
--- /dev/null
+++ b/.werks/1838
@@ -0,0 +1,10 @@
+Title: emc_datadomain_mtree: New check for EMC Datadomain MTrees
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1420803970
+Class: feature
+
+Thanks to Hubert Bösl!
+
diff --git a/ChangeLog b/ChangeLog
index 19c6102..9f4eae1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,7 @@
NOTE: Please refer to the migration notes!
* 1831 diskstat: detect multipath devices and handle them instead of the physical
paths...
* 1462 netscaler_ha: new check to monitor the HA state of Citrix Netscaler
appliances
+ * 1838 emc_datadomain_mtree: New check for EMC Datadomain MTrees...
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/checkman/emc_datadomain_mtree b/checkman/emc_datadomain_mtree
new file mode 100644
index 0000000..75712e9
--- /dev/null
+++ b/checkman/emc_datadomain_mtree
@@ -0,0 +1,23 @@
+title: EMC Datadomain: MTree Usage
+agents: snmp
+catalog: hw/storagehw/emc
+license: GPL
+distribution: check_mk
+description:
+ Reports the Precompiled MTree usage in GB of the EMC Datadomain
+ Deduplication Storage Systems. The state of the check is determined
+ from the state reported by the device as follows:
+ The check is {OK} when the System reports {3} (readWrite), {4} (replicationDestination)
+ {5} (retentionLockEnabled), {6} (retentionLockDisabled). The check is {WARN}
+ when the MTree reports a state of {1} (readOnly).
+ The check is {CRIT} when the Mtree reports a state of {1} (deleted).
+
+item:
+ Name of the Mtree
+
+perfdata:
+ The Precompiled size of the MTree Data in Bytes
+
+inventory:
+ Automatically configures one check for every cwMTreesensor found on the
+ device
diff --git a/checks/emc_datadomain_mtree b/checks/emc_datadomain_mtree
new file mode 100644
index 0000000..55eab49
--- /dev/null
+++ b/checks/emc_datadomain_mtree
@@ -0,0 +1,68 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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.
+
+
+def inventory_emc_datadomain_mtree(info):
+ for line in info:
+ yield line[0], None
+
+
+def check_emc_datadomain_mtree(item, _no_params, info):
+ state_table = {
+ "0": ("unknown", 3),
+ "1": ("deleted", 2),
+ "2": ("read-only", 1),
+ "3": ("read-write", 0),
+ "4": ("replication destination", 0),
+ "5": ("retention lock enabled", 0),
+ "6": ("retention lock disabled", 0),
+ }
+ for line in info:
+ if item == line[0]:
+ dev_name = line[0]
+ dev_precomp = line[1]
+ dev_state = line[2]
+ dev_state_str, dev_state_rc = state_table.get(dev_state, ("invalid code
%s" % dev_state, 3))
+ precompiled = int(float(dev_precomp) * 1024 * 1024 * 1024)
+ perfdata = [('precompiled', precompiled)]
+ infotext = "Status: %s, Precomiled: %s" % (dev_state_str,
get_bytes_human_readable(precompiled))
+ return dev_state_rc, infotext, perfdata
+
+
+check_info["emc_datadomain_mtree"] = {
+ "check_function" : check_emc_datadomain_mtree,
+ "inventory_function" : inventory_emc_datadomain_mtree,
+ "service_description" : "MTree %s",
+ "has_perfdata" : True,
+ "snmp_info" : (".1.3.6.1.4.1.19746.1.15.2.1.1",
+ [
+ 2, # MtreeListName
+ 3, # MtreeListPreComGi
+ 4, # MtreeListStatus
+ ]
+ ),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.1.0").startswith("Data Domain OS")
+}