Module: check_mk
Branch: master
Commit: 9edd416f7166ab7413342c90d9b181e6ebc09990
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9edd416f7166ab…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Tue Apr 7 23:18:11 2015 +0200
commit after werk failure
---
.werks/2112 | 9 +++++
ChangeLog | 1 +
checkman/hitachi_hnas_bossock | 29 ++++++++++++++++
checks/hitachi_hnas_bossock | 62 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 15 ++++++++
5 files changed, 116 insertions(+)
diff --git a/.werks/2112 b/.werks/2112
new file mode 100644
index 0000000..22c65ac
--- /dev/null
+++ b/.werks/2112
@@ -0,0 +1,9 @@
+Title: hitachi_hnas_bossock: new check to monitor number of running Bossock Fibers
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1428441368
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 8671ab2..1fa6c17 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -155,6 +155,7 @@
NOTE: Please refer to the migration notes!
* 2185 canon_pages: added support for b/w A4 and color A4/A3 counters
* 2186 check_mk_agent.aix: use GNU df in order to exclude NFS for filesystem
monitoring...
+ * 2112 hitachi_hnas_bossock: new check to monitor number of running Bossock Fibers
* 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/hitachi_hnas_bossock b/checkman/hitachi_hnas_bossock
new file mode 100644
index 0000000..03c6aa6
--- /dev/null
+++ b/checkman/hitachi_hnas_bossock
@@ -0,0 +1,29 @@
+title: Hitachi HNAS: Number of Bossock Fibers
+agents: snmp
+catalog: hw/storagehw/hitachi
+license: GPL
+distribution: check_mk
+description:
+ Monitors the number of Bossock Fibers in Hitachi HNAS storage systems.
+ It was tested against Hitachi HNAS Modell 3090 but probably will work
+ for other HNAS devices using the BlueArc MIB - give it a try.
+
+ The checks gets WARN or CRIT depending on the warning and critical levels
+ for the number of fibers.
+
+inventory:
+ Creates one check for every cluster node in the HNAS system.
+
+item:
+ The ID of the node
+
+perfdata:
+ The number of Bossock Fibers
+
+[parameters]
+parameters (tuple): warn, crit levels (int, int)
+
+[configuration]
+hitachi_hnas_bossock_default_levels(tuple): The standard levels for {WARN} and
+ {CRIT}, preset to (250, 350)
+
diff --git a/checks/hitachi_hnas_bossock b/checks/hitachi_hnas_bossock
new file mode 100644
index 0000000..4b3aaaf
--- /dev/null
+++ b/checks/hitachi_hnas_bossock
@@ -0,0 +1,62 @@
+#!/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.
+
+
+hitachi_hnas_bossock_default_levels = (250, 350)
+
+def inventory_hitachi_hnas_bossock(info):
+ for clusternode, fibers in info:
+ yield clusternode, 'hitachi_hnas_bossock_default_levels'
+
+def check_hitachi_hnas_bossock(item, params, info):
+ for clusternode, fibers in info:
+ if clusternode == item:
+ warn, crit = params
+ infotext = "%s running (levels %d/%d)" % (fibers, warn, crit)
+
+ if int(fibers) >= crit:
+ state = 2
+ elif int(fibers) >= warn:
+ state = 1
+ else:
+ state = 0
+
+ perfdata = [ ("fibers", fibers, warn, crit) ]
+
+ return state, infotext, perfdata
+
+check_info["hitachi_hnas_bossock"] = {
+ "check_function" : check_hitachi_hnas_bossock,
+ "inventory_function" : inventory_hitachi_hnas_bossock,
+ "service_description" : "Bossock Fibers on Node %s",
+ "has_perfdata" : True,
+ "group" : "bossock_fibers",
+ "snmp_info" : (".1.3.6.1.4.1.11096.6.1.1.6.7.4.1", [
+ 1, # clusterNodeStatsCnID
+ 2, # runningBossockFibers
+ ]),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.11096.6"),
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 42156cc..a2a6c12 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -8673,3 +8673,18 @@ register_check_parameters(
),
None
)
+
+register_check_parameters(
+ subgroup_storage,
+ "bossock_fibers",
+ _("Number of Running Bossock Fibers"),
+ Tuple(
+ title = _("Number of fibers"),
+ elements = [
+ Integer(title = _("Warning at"), unit=_("fibers")),
+ Integer(title = _("Critical at"), unit=_("fibers")),
+ ]
+ ),
+ TextAscii( title = _("Node ID")),
+ "first"
+)