Module: check_mk
Branch: master
Commit: 0a5d52114eeaf1cc11c5d4ac5f19bd19b402e6d3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0a5d52114eeaf1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Sep 11 10:54:51 2015 +0200
emcvnx_sp_util: first version of new check
---
checks/emcvnx_sp_util | 68 ++++++++++++++++++++++++++++++++++
web/plugins/metrics/check_mk.py | 15 +++++++-
web/plugins/wato/check_parameters.py | 15 ++++++++
3 files changed, 97 insertions(+), 1 deletion(-)
diff --git a/checks/emcvnx_sp_util b/checks/emcvnx_sp_util
new file mode 100644
index 0000000..bfdbfd0
--- /dev/null
+++ b/checks/emcvnx_sp_util
@@ -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.
+
+# <<<emcvnx_sp_util:sep(58)>>>
+# Controller busy ticks: 1639432
+# Controller idle ticks: 1773844
+
+# suggested by customer
+emcvnx_sp_util_default_levels = (50.0, 60.0)
+
+
+def inventory_emcvnx_sp_util(info):
+ return [ (None, "emcvnx_sp_util_default_levels") ]
+
+
+def check_emcvnx_sp_util(item, params, info):
+ for line in info:
+ if len(line) == 2 and "busy" in line[0]:
+ busy_ticks = float(line[1])
+ elif len(line) == 2 and "idle" in line[0]:
+ idle_ticks = float(line[1])
+
+ warn, crit = params
+ sp_util = get_rate(None, time.time(), busy_ticks / (busy_ticks + idle_ticks) )
+ infotext = "%.1f%%" % sp_util
+ if sp_util >= crit:
+ state = 2
+ elif sp_util >= warn:
+ state = 1
+ else:
+ state = 0
+
+ if state > 0:
+ infotext += " (warn/crit at %.1f%%/%.1f%%)" % (warn, crit)
+
+ return state, infotext, [ ("storage_processor_util", sp_util, warn, crit,
0, 100.0) ]
+
+
+check_info['emcvnx_sp_util'] = {
+ "inventory_function" : inventory_emcvnx_sp_util,
+ "check_function" : check_emcvnx_sp_util,
+ "service_description" : "Storage Processor Utilization",
+ "group" : "sp_util",
+ "has_perfdata" : True,
+}
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index eff752c..cb199df 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -2532,7 +2532,13 @@ metric_info["error_rate"] = {
metric_info["citrix_load"] = {
"title" : _("Citrix Load"),
"unit" : "%",
- "color" : "34/c",
+ "color" : "34/a",
+}
+
+metric_info["storage_processor_util"] = {
+ "title" : _("Storage Processor Utilization"),
+ "unit" : "%",
+ "color" : "34/a",
}
#.
@@ -4273,6 +4279,13 @@ perfometer_info.append({
"exponent" : 2,
})
+perfometer_info.append({
+ "type" : "linear",
+ "segments" : [ "storage_processor_util" ],
+ "total" : 100.0,
+})
+
+
#.
# .--Graphs--------------------------------------------------------------.
# | ____ _ |
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index e9c30c4..72c0d86 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2996,6 +2996,21 @@ register_check_parameters(
)
register_check_parameters(
+ subgroup_os,
+ "sp_util",
+ _("Storage Processor Utilization"),
+ Tuple(
+ title = _("Specify levels in percentage of storage processor usage"),
+ elements = [
+ Percentage(title = _("Warning at"), default_value = 50.0),
+ Percentage(title = _("Critical at"), default_value = 60.0),
+ ]
+ ),
+ None,
+ "first",
+)
+
+register_check_parameters(
subgroup_storage,
"esx_vsphere_datastores",
_("ESX Datastores (used space and growth)"),