Module: check_mk
Branch: master
Commit: d7f2e41014ad2bc10739d1d0f71a2104a01d3791
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d7f2e41014ad2b…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Wed May 21 10:28:56 2014 +0200
fast_lta_silent_cubes.capacity: New check for Total Capacity over all Silent Cubes on FAST
LTA Storage Systems
---
.werks/957 | 8 +++
ChangeLog | 1 +
checkman/fast_lta_silent_cubes.capacity | 35 +++++++++++++
checks/fast_lta_silent_cubes | 55 ++++++++++++++++++++
.../check_mk-fast_lta_silent_cubes.capacity.php | 1 +
pnp-templates/check_mk-hitachi_hnas_span.php | 26 +++++++++
web/plugins/perfometer/check_mk.py | 1 +
7 files changed, 127 insertions(+)
diff --git a/.werks/957 b/.werks/957
new file mode 100644
index 0000000..0f8a83f
--- /dev/null
+++ b/.werks/957
@@ -0,0 +1,8 @@
+Title: fast_lta_silent_cubes.capacity: New check for Total Capacity over all Silent Cubes
on FAST LTA Storage Systems
+Level: 2
+Component: checks
+Version: 1.2.5i3
+Date: 1400660881
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index f0a9fda..e6b4441 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -51,6 +51,7 @@
* 0162 if_brocade: New if64 Check version for Brocade VDX Switches...
NOTE: Please refer to the migration notes!
* 0956 fast_lta_headunit.status, fast_lta_headunit.replication: New checks for FAST
LTA Storage Systems
+ * 0957 fast_lta_silent_cubes.capacity: New check for Total Capacity over all Silent
Cubes on FAST LTA Storage Systems
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
* 0786 FIX: zfsget: fixed compatibility with older Solaris agents...
* 0809 FIX: brocade_fcport: Fixed recently introduced problem with port speed
detection
diff --git a/checkman/fast_lta_silent_cubes.capacity
b/checkman/fast_lta_silent_cubes.capacity
new file mode 100644
index 0000000..a16c511
--- /dev/null
+++ b/checkman/fast_lta_silent_cubes.capacity
@@ -0,0 +1,35 @@
+title: FAST LTA Storage Systems: Total Capacity over all Silent Cubes
+agents: snmp
+catalog: hw/storagehw/fastlta
+license: GPL
+distribution: check_mk
+description:
+ Checks the total / used capacity over all silent cubes connected to a FAST
+ LTA Storage System.
+
+ Returns {WARN} or {CRIT} if usage is above given levels.
+
+ It uses the check logic of the {df} check, so for configuration
+ parameters and examples please refer to the man page of {df}.
+
+item:
+ "Total" for now is the only item.
+
+perfdata:
+ Three values: The first value is the used space in total over all connected
+ silent cubes in MB. Also the minimum (0 MB), maximum (total size over all
+ silent cubes) 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}.
+
+inventory:
+ Finds exactly one check on every system (head unit).
+
+[parameters]
+parameters (dict): See man page of {df}.
+
+[configuration]
+filesystem_default_levels: And other, see man page of {df}.
diff --git a/checks/fast_lta_silent_cubes b/checks/fast_lta_silent_cubes
new file mode 100644
index 0000000..581fd6a
--- /dev/null
+++ b/checks/fast_lta_silent_cubes
@@ -0,0 +1,55 @@
+#!/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.
+
+
+def inventory_fast_lta_silent_cubes_status(info):
+ if len(info[0]) > 1:
+ return [ ("Total", {}) ]
+ else:
+ return []
+
+def check_fast_lta_silent_cubes_status(item, params, info):
+ fslist = []
+ for total, used in info:
+ size_mb = int(total) / 1048576.0
+ avail_mb = ( int(total) - int(used) ) / 1048576.0
+ fslist.append((item, size_mb, avail_mb))
+
+ return df_check_filesystem_list(item, params, fslist)
+
+check_info["fast_lta_silent_cubes.capacity"] = {
+ "check_function" : check_fast_lta_silent_cubes_status,
+ "inventory_function" : inventory_fast_lta_silent_cubes_status,
+ "service_description" : "Silent Cubes Capacity %s",
+ "has_perfdata" : True,
+ "group" : "filesystem",
+ "includes" : [ "df.include" ],
+ "snmp_info" : (".1.3.6.1.4.1.27417.3", [2, #
scTotalCapacity
+ 3] # scTotalUsedCapacity
+ ),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.8072.3.2.10"),
+}
+
diff --git a/pnp-templates/check_mk-fast_lta_silent_cubes.capacity.php
b/pnp-templates/check_mk-fast_lta_silent_cubes.capacity.php
new file mode 120000
index 0000000..aac1010
--- /dev/null
+++ b/pnp-templates/check_mk-fast_lta_silent_cubes.capacity.php
@@ -0,0 +1 @@
+check_mk-hitachi_hnas_volume.php
\ No newline at end of file
diff --git a/pnp-templates/check_mk-hitachi_hnas_span.php
b/pnp-templates/check_mk-hitachi_hnas_span.php
index 6b314eb..18544ad 100644
--- a/pnp-templates/check_mk-hitachi_hnas_span.php
+++ b/pnp-templates/check_mk-hitachi_hnas_span.php
@@ -128,4 +128,30 @@ if (isset($RRD['growth'])) {
$def[3] .= "COMMENT:\"\\n\" ";
}
+if (isset($RRD['trend_hoursleft'])) {
+ // Trend
+ $opt[4] = "--vertical-label 'Days left' -l -1 -u 365 -X0 --title
'$hostname: Days left for $servicedesc' ";
+ $def[4] = "DEF:hours_left=${RRD_AVG['trend_hoursleft']} ";
+ $def[4] .= "DEF:hours_left_min=${RRD_MIN['trend_hoursleft']} ";
+ // negative hours indicate no growth
+ // the dataset hours_left_isneg stores this info for each point as True/False
+ $def[4] .= "CDEF:hours_left_isneg=hours_left_min,-1,EQ ";
+ $def[4] .= "CDEF:hours_left_unmon=hours_left_min,400,0,IF ";
+ $def[4] .= "CDEF:days_left=hours_left,24,/ ";
+ $def[4] .= "CDEF:days_left_cap=days_left,400,MIN ";
+ // Convert negative points to 400 (y-axis cap)
+ $def[4] .= "CDEF:days_left_cap_positive=hours_left_isneg,400,days_left_cap,IF
";
+ // The AREA has a rendering problem. Points are too far to the right
+ $def[4] .= "AREA:hours_left_unmon#AA2200: ";
+
+ $def[4] .= "AREA:days_left_cap_positive#22AA44:\"Days left\:\"
";
+ if ($ACT[4] == -1)
+ {
+ $def[4] .= "COMMENT:\"Not growing\" ";
+ }
+ else {
+ $def[4] .= "GPRINT:days_left:LAST:\"%7.2lf days\" ";
+ }
+}
+
?>
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index d2023a4..eb758ae 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -117,6 +117,7 @@ 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
+perfometers["check_mk-fast_lta_silent_cubes.capacity"] =
perfometer_check_mk_df
def perfometer_esx_vsphere_datastores(row, check_command, perf_data):
used_mb = perf_data[0][1]