Module: check_mk
Branch: master
Commit: 6f7b837e22ba52c5b3830dcf768bac6029402569
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6f7b837e22ba52…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Nov 7 09:57:42 2016 +0100
added missing check
---
checks/netapp_api_luns | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
diff --git a/checks/netapp_api_luns b/checks/netapp_api_luns
new file mode 100644
index 0000000..bad6515
--- /dev/null
+++ b/checks/netapp_api_luns
@@ -0,0 +1,69 @@
+#!/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-
+# tails. 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.
+
+# <<<netapp_api_luns:sep(9)>>>
+# lun /vol/iscsi_crm_dblogs/crm_dblogs_lu01 read-only false size 644286182400 vserver
ISCSI_CRM size-used 538924421120 online true volume iscsi_crm_dblogs
+
+def inventory_netapp_api_luns(parsed):
+ for lun in parsed.keys():
+ yield lun, {}
+
+def check_netapp_api_luns(item, params, parsed):
+ lun = parsed.get(item)
+
+ if not lun:
+ yield 3, "LUN not found in agent output"
+ return
+
+ if lun.get("online") != "true":
+ yield 1, "LUN is %s" % lun.get("online")
+
+ if lun.get("read-only") != "false":
+ yield 1, "read-only is %s" % lun.get("read-only")
+
+ mega = 1024.0 * 1024.0
+ size_total = int(lun.get("size")) / mega
+ size_avail = size_total - (int(lun.get("size-used")) / mega)
+
+ if params == True:
+ yield 0, "Total size: %s, Used space is ignored" %
get_bytes_human_readable(size_total)
+ else:
+ yield df_check_filesystem_single(g_hostname, item, size_total, size_avail, 0,
None, None, params)
+
+
+def netapp_api_luns_item(name):
+ return name.rsplit("/", 1)[-1]
+
+check_info["netapp_api_luns"] = {
+ 'check_function' : check_netapp_api_luns,
+ 'inventory_function' : inventory_netapp_api_luns,
+ 'parse_function' : lambda x: netapp_api_parse_lines(x,item_func =
netapp_api_luns_item),
+ 'service_description' : 'LUN %s',
+ 'has_perfdata' : True,
+ 'group' : "netapp_luns",
+ 'includes' : [ "df.include",
"netapp_api.include" ],
+ "default_levels_variable" : "filesystem_default_levels",
+}