Module: check_mk
Branch: master
Commit: e680d189362bcacd02f0585e16fd02a4023fd9df
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e680d189362bca…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Nov 20 14:46:31 2013 +0100
New Check for Areca Raid Controllers
---
.werks/97 | 7 ++++
ChangeLog | 1 +
agents/plugins/arc_raid_status.sh | 5 +++
checkman/arc_raid_status | 19 ++++++++++
checks/arc_raid_status | 70 +++++++++++++++++++++++++++++++++++++
5 files changed, 102 insertions(+)
diff --git a/.werks/97 b/.werks/97
new file mode 100644
index 0000000..0471348
--- /dev/null
+++ b/.werks/97
@@ -0,0 +1,7 @@
+Title: New Check for Areca Raid Controllers
+Level: 1
+Component: checks
+Version: 1.2.3i7
+Date: 1384955153
+Class: feature
+
diff --git a/ChangeLog b/ChangeLog
index c647592..beab0ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@
* 0069 veeam_client: limits for time since last backup introduced
* 0214 Logwatch: context lines can now be disabled using nocontext=1...
* 0038 New checks for casa: casa_cpu_mem casa_cpu_temp casa_cpu_util casa_fan
casa_power
+ * 0097 New Check for Areca Raid Controllers
* 0024 FIX: cisco_wlc: removed configuration parameter ap_model
* 0065 FIX: veeam_client: check behaviour improved when backup is in progress
* 0066 FIX: veeam_jobs: check behaviour improved when backup is in progress
diff --git a/agents/plugins/arc_raid_status.sh b/agents/plugins/arc_raid_status.sh
new file mode 100644
index 0000000..fa3a722
--- /dev/null
+++ b/agents/plugins/arc_raid_status.sh
@@ -0,0 +1,5 @@
+#cli64 can be found at:
+# ftp://ftp.areca.com.tw/RaidCards/AP_Drivers/Linux/CLI/
+
+echo "<<<arc_raid_status>>>"
+cli64 rsf info | tail -n +3 | head -n -2
diff --git a/checkman/arc_raid_status b/checkman/arc_raid_status
new file mode 100644
index 0000000..105c905
--- /dev/null
+++ b/checkman/arc_raid_status
@@ -0,0 +1,19 @@
+title: Areca Raid Controllers
+agents: linux
+catalog: os/storage
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the health and current Status of a areca raid controller.
+ The check returns a {CRIT} for Degarde and Incompleted, {WARN} in case of Rebuilding.
+ Also {CRIT} is returned is an case that the number of disks in the array Changes.
+ The cli64 has be installed for the agent plugin to work. It can be downloaded here:
+ ftp://ftp.areca.com.tw/RaidCards/AP_Drivers/Linux/CLI/
+
+
+item:
+ The numeric number of the array, reported by areca cli tool
+
+inventory:
+ One check is created for array
+
diff --git a/checks/arc_raid_status b/checks/arc_raid_status
new file mode 100644
index 0000000..9d72745
--- /dev/null
+++ b/checks/arc_raid_status
@@ -0,0 +1,70 @@
+#!/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.
+
+# Example output from agent:
+# 1 Raid Set # 00 3 2250.5GB 0.0GB 123 Normal
+# ( # Name Disks TotalCap FreeCap DiskChannels State )
+
+def inventory_arc_raid_status(info):
+ return [ ( x[0], saveint(x[-5]) ) for x in info ]
+
+def check_arc_raid_status(item, params, info):
+ for line in info:
+ if line[0] == item:
+ messages = []
+ state = 0
+
+ raid_state = line[-1]
+ label = ""
+ if raid_state in [ "Degarde", "Incompleted" ]:
+ state = 2
+ label = "(!!)"
+ elif raid_state == "Rebuilding":
+ state = 1
+ label = "(!)"
+ elif raid_state != "Normal":
+ state = 2
+ label = "(!!)"
+ messages.append("Raid in state: %s%s" % ( raid_state, label ))
+
+ # Check the number of disks
+ i_disks = params
+ c_disks = saveint(line[-5])
+ if i_disks != c_disks:
+ message.append("Number of disks has changed from %d to %d(!!)"
% ( i_disks, c_disks ))
+ state = 2
+
+ return state, ", ".join(messages)
+
+ return 3, "Array not found"
+
+check_info["arc_raid_status"] = {
+ "check_function" : check_arc_raid_status,
+ "inventory_function" : inventory_arc_raid_status,
+ "service_description" : "Raid Array #%s",
+ "has_perfdata" : False,
+}
+