Module: check_mk
Branch: master
Commit: d95f1c667c93038de25f1677c693ad80fd9b937c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d95f1c667c9303…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Jan 23 17:46:26 2014 +0100
Again added missing files
---
checkman/hp_proliant_raid | 16 ++++++++++
checks/hp_proliant_raid | 78 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 94 insertions(+)
diff --git a/checkman/hp_proliant_raid b/checkman/hp_proliant_raid
new file mode 100644
index 0000000..2fa59bf
--- /dev/null
+++ b/checkman/hp_proliant_raid
@@ -0,0 +1,16 @@
+title: HP Proliant Servers: Raid status`
+agents: snmp
+catalog: hw/server/hp
+license: GPL
+distribution: check_mk
+description:
+ This check connects to the SNMP agent installed on an operating system
+ on a HP Proliant server and reads the information from the {CPQHLTH-MIB}
+ MIB.
+ The systems SNMP agent is extended by the HP Management Agents which need
+ to be installed on the monitored systems.
+
+ The check monitors the state of all logical and physical devices
+
+inventory:
+ One check is automatically created for each logical device.
diff --git a/checks/hp_proliant_raid b/checks/hp_proliant_raid
new file mode 100644
index 0000000..7901451
--- /dev/null
+++ b/checks/hp_proliant_raid
@@ -0,0 +1,78 @@
+#!/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_hp_proliant_raid(info):
+ if len(info) > 0:
+ inventory = []
+ for line in info:
+ inventory.append((line[0], None))
+ return inventory
+
+def check_hp_proliant_raid(item, _no_params, info):
+ hp_proliant_raid_statusmap = {
+ 3 : "More physical drives have failed than the fault tolerance mode can
handle.",
+ 4 : "Logical drive is not configured.",
+ 5 : "Recovery for at least one physical drive hasfailed. No data loss
currently.",
+ 6 : "Logical drive is ready for recovery but is still operating in Interim
Recovery Mode.",
+ 8 : "The wrong physical drive was replaced after failure.",
+ 9 : "A physical drive is not responding.",
+ 10 : "Enclosue is overheated but drives still functioning and should be
shutdown.",
+ 11 : "Enclosure is overheated and drives are shutdown.",
+ 12 : "Logical drive is currently doing Automatic Data Expansion.",
+ 13 : "Logical drive is currently unavailable.",
+ 14 : "Logical drive is in the queue for expansion.",
+
+ }
+ for line in info:
+ if line[0] == item:
+ state, size_mb, percent_rebuild = map(saveint, line[1:])
+ drive_size = "Logical Volume Size: %s" %
get_bytes_human_readable(size_mb * 1024 * 1024 )
+ if state == 7:
+ return 1, "Rebuild: %d%% finished. %s" % ( percent_rebuild,
drive_size )
+ if state == 2:
+ return 0, "In normal operation mode. " + drive_size
+ if state in [ 4, 5, 6, 12, 14 ]:
+ return 1, hp_proliant_raid_statusmap[state] + drive_size
+ if state in [ 3, 8, 9, 10, 12, 13 ]:
+ return 2, hp_proliant_raid_statusmap[state] + drive_size
+ return (3, "Drive not found or Uknown state")
+
+check_info["hp_proliant_raid"] = {
+ 'check_function': check_hp_proliant_raid,
+ 'inventory_function': inventory_hp_proliant_raid,
+ 'service_description': 'Logical Device %s',
+ 'snmp_info': (
+ ".1.3.6.1.4.1.232.3.2.3.1.1", [
+ 14, # Drive Name
+ 4, # Logical Drive status
+ 9, # Drive Size
+ 12, # Percent rebuild
+ ]
+ ),
+ 'snmp_scan_function': \
+ lambda oid: "proliant" in
oid(".1.3.6.1.4.1.232.2.2.4.2.0").lower(),
+}