Module: check_mk
Branch: master
Commit: 3dc15d62dbc3c8ebfcaa9799956e58d848333900
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3dc15d62dbc3c8…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Jan 28 16:30:32 2015 +0100
#1218 Inital Agent Version for zOS (IBM Mainframes)
This is only the first Version of the Agent. It has to be extended in the future.
---
.werks/1218 | 10 +++++
ChangeLog | 1 +
agents/z_os/README.convert | 2 +
agents/z_os/check_mk_agent | 1 +
agents/z_os/uptime | 1 +
checks/df_zos | 91 ++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 106 insertions(+)
diff --git a/.werks/1218 b/.werks/1218
new file mode 100644
index 0000000..0f989ac
--- /dev/null
+++ b/.werks/1218
@@ -0,0 +1,10 @@
+Title: Inital Agent Version for zOS (IBM Mainframes)
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1422458934
+Class: feature
+
+This is only the first Version of the Agent. It has to be extended in the future.
+
diff --git a/ChangeLog b/ChangeLog
index afa4d95..86cc635 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -62,6 +62,7 @@
* 1217 dell_om_sensors: Check now uses generic temperature template...
NOTE: Please refer to the migration notes!
* 1929 netapp_api_if: improved inventory and check output of virtual interfaces...
+ * 1218 Inital Agent Version for zOS (IBM Mainframes)...
* 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/agents/z_os/README.convert b/agents/z_os/README.convert
new file mode 100644
index 0000000..c9cc254
--- /dev/null
+++ b/agents/z_os/README.convert
@@ -0,0 +1,2 @@
+iconv -f ibm-1047 -t utf-8 FILE_NAME |tr "\205" "\12"|tr -d
"\302"
+
diff --git a/agents/z_os/check_mk_agent b/agents/z_os/check_mk_agent
new file mode 100644
index 0000000..29443f8
--- /dev/null
+++ b/agents/z_os/check_mk_agent
@@ -0,0 +1 @@
+{
§
@ònP`¢
£@N§¥
§£@mÅÄÃmÁÄÄmÅÙÙÕÖò~ñ
§£@×ÁãÈ~a
§£@ÔÒmÓÉÂÄÉÙ~a€¢aa
mm
£
§£@ÔÒmÃÖÕÆÄÉÙ~a
£a
m{@Ô
@¢€
k@š@¢£
@
¢@
@€×ÁãÈ~[×ÁãÈza€¢a@@@@@@{@Á@
§
€£
¢@@×ÓäÇÉÕâÄÉÙ@Š@¢š@
@
§
€£
@@£
{@€€£@
@£@£
@€£€£@@£
@
£K@×€¢@
@£
@Š{@¢
£¢@@€¢£@€£€£@
¢@Š£@}LLL}@@}nnn}×ÓäÇÉÕâÄÉÙ~[ÔÒmÓÉÂÄÉÙa€¢{@Á@
§
€£
¢@@ÓÖÃÁÓÄÉÙ@Š@š@
§
€£
@@£
{@€£€£@¢
£
@£@£
@¢
£@LLLnnnK@×
¢
{@
@£@
@€
££@@
£¢@€£@@
¢KÓÖÃÁÓÄÉÙ~[ÔÒmÓÉÂÄÉÙa{@Á@
¢@@â×ÖÖÓÄÉÙ@Š@¢š@
@£@£
@
£{@€£€£@@£
š@
@£@€££
@M¢
@
Š]â×ÖÖÓÄÉÙ~[ÔÒmÃÖÕÆÄÉÙa¢
@LLL
mnnn@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@å
¢z@ñKòKô@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@Á
£Öâz@©aÖâ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@×€¢Ä
£šz@[×ÓäÇÉÕâÄÉÙ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ÓÄ
£šz@[ÓÖÃÁÓÄÉÙ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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¢£@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
\ No newline at end of file
diff --git a/agents/z_os/uptime b/agents/z_os/uptime
new file mode 100644
index 0000000..5c956a3
--- /dev/null
+++ b/agents/z_os/uptime
@@ -0,0 +1 @@
+a\@ÙÅçç@\aÃåã@@@@@@~@ÃòÄMâãÖÙÁÇÅMñðkô]]@@@@@@@@@@@@@@@@a\@£@£@Ãåã@@@@@@@@@\aâÔÃÁ@@@@@~@âãÖÙÁÇÅMÄòçMÃåã@N@ñùö]kô]@@@@@@@@@a\@£@£@âÔÃÁ@@@@@@@@\aâÔÃÁ@@@@@~@ÂÉãÁÕÄMâÔÃÁk}÷ÆÆÆÆÆÆÆ}ç]@@@@@@@@@@a\@©
@@
@£@@\aâÔÃÁ@@@@@~@ÃòÄMâÔÃÁ]@@@@@@@@@@@@@@@@@@@@@@@@@a\@¥
£@£@
@@@\aa\@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\aa\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\aa\@@ã
@É×Ó@£
@¢@¢£
@@
@
@£@`@¢@£@
@@@@@\aa\@@£
@£
@£
k@£@
¢@£@
@¥
£
@@£@
§@@@@@@\aa\@@£
@
@¢@
¢@£@
@
¥
K@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\aa\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\aÉ×ÓãÉÔÅ@@~@ÃòÄMâãÖÙÁÇÅMÄòçMâÔÃÁ@N@óóö]kô]]@@@a\@É×Ó@ã
@`@š@@@@\aÉ×ÓÄÁãÅ@@~@ÃòÄMâãÖÙÁÇÅMÄòçMâÔÃÁ@N@óôð]kô]]@@@a\@É×Ó@Ä£
@`@ðÃèèÄÄÄÆ@@\aÉ×ÓÄÁãÅ@@~@ÄòçMÉ×ÓÄÁãÅ]@@@@@@@@@@@@@@@@@@@@@@a\@¥
£@@£@
§@@\aÉ×ÓÄÁãÅ@@~@âäÂâãÙMÉ×ÓÄÁãÅkòkõ]@@@@@@@@@@@@@@@a\@
@èèÄÄÄ@@@@@@@@@@@\aÉ×ÓãÉÔÅ@@~@É×ÓãÉÔÅ@a@ñðð@@@@@@@@@@@@@@@@@@@@@a\@
¥
@€
£¢@@@@@\a@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a\@òô@\@öð@\@öð@~@øöôðð@\aâÁè@MÄÁãÅMÂ]`ÄÁãÅMÂkÉ×ÓÄÁãÅkÑ]]\øöôððNMãÉÔÅMâ]`É×ÓãÉÔÅ]@ð@@
\ No newline at end of file
diff --git a/checks/df_zos b/checks/df_zos
new file mode 100644
index 0000000..e66a6ed
--- /dev/null
+++ b/checks/df_zos
@@ -0,0 +1,91 @@
+#!/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.
+
+# <<<df_zos>>>
+# SYS5.OMVS.ALF0.HFS 720 92 504 16% /ALF0
+# HFS, Read/Write, Device:2, ACLS=Y
+# Filetag : T=off codeset=0
+#
+# SYS5.OMVS.SYSPLEX.ROOT 720 224 372 38% /
+# HFS, Read Only, Device:1, ACLS=Y
+# Filetag : T=off codeset=0
+
+# FS Types:
+# AUTOMNT
+# TFS
+# ZFS
+# NFS
+# HFS
+
+def df_zos_convert(data):
+ entries = []
+ found = False
+ for line in data:
+ if len(line) == 6:
+ entry = list(line)
+ found = True
+ continue
+ elif found:
+ entry.append(line[0][:-1]) #Filesystem Type
+ # Read/Write
+ if len(line) == 4:
+ entry.append('rw')
+ # Read Only
+ else:
+ entry.append('ro')
+ entries.append(entry)
+ found = False
+ return entries
+
+df_zos_exclude_list = ['AUTOMNT', 'TFS', 'NFS']
+
+def inventory_df_zos(info):
+ info = df_zos_convert(info)
+ mplist = []
+ for line in info:
+ if line[-1] == "rw" and line[-2] not in df_zos_exclude_list:
+ mplist.append(line[5])
+ return df_inventory(mplist)
+
+
+def check_df_zos(item, params, info):
+ info_convert = df_zos_convert(info)
+ fslist = []
+ for fs, size, used, avail, used_perc, mount_point, fs_type, fs_state in
info_convert:
+ size_mb = float(size) / 1024
+ avail_mb = float(avail) / 1024
+ fslist.append((mount_point, size_mb, avail_mb))
+ return df_check_filesystem_list(item, params, fslist)
+
+check_info['df_zos'] = {
+ "check_function" : check_df_zos,
+ "inventory_function" : inventory_df_zos,
+ "service_description" : "Filesystem %s",
+ "has_perfdata" : True,
+ "group" : "filesystem",
+ "default_levels_variable" : "filesystem_default_levels",
+ "includes" : [ "df.include" ],
+}