Module: check_mk
Branch: master
Commit: f7562ed165b6d3fdee6862448e2fe0f043572be3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f7562ed165b6d3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Dec 15 15:07:28 2011 +0100
Added first version of oracle_asm_diskgroup
---
checks/oracle_asm_diskgroup | 50 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/checks/oracle_asm_diskgroup b/checks/oracle_asm_diskgroup
new file mode 100644
index 0000000..1c6ac46
--- /dev/null
+++ b/checks/oracle_asm_diskgroup
@@ -0,0 +1,50 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2012 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.
+
+# Example output from asmcmd lsdg:
+# State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB
Usable_file_MB Offline_disks Voting_files Name
+# MOUNTED NORMAL N 512 4096 1048576 512000 92888 0
46444 0 N DATA/
+# MOUNTED NORMAL N 512 4096 1048576 3072 2146 309
918 0 Y OCR_VOTE/
+# The agent section <<<oracle_asm_diskgroup>>> does not output the
header line
+
+check_includes['oracle_asm_diskgroup'] = [ "df.include" ]
+
+def inventory_oracle_asm_diskgroup(info):
+ return [ (line[-1].rstrip("/"), {}) for line in info ]
+
+def check_oracle_asm_diskgroup(item, params, info):
+
+ for state, typ, rebal, sector, block, au, total_mb, \
+ free_mb, req_mir_free_mb, usable_file_mb, offline_disks, \
+ voting_files, name in info:
+ if name.rstrip('/') == item:
+ return df_check_filesystem(g_hostname, item, int(total_mb),
+ int(free_mb), params)
+ return (3, "UNKNOWN - Disk group not found")
+
+check_info["oracle_asm_diskgroup"] = (check_oracle_asm_diskgroup, "ASM
Diskgroup %s", 1, inventory_oracle_asm_diskgroup)
+checkgroup_of['oracle_asm_diskgroup'] = "fs"
+check_default_levels["oracle_asm_diskgroup"] =
"filesystem_default_levels"