Module: check_mk
Branch: master
Commit: 6d5a494780cc76325131844f4d7a7bdf350e39fb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d5a494780cc76…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri Jan 15 09:46:05 2016 +0100
#2919 hp_webmgmt_status: New check for health status of various Hewlett-Packard devices
This check supports different device types but apparently not all models. Among the
supported devices are some
switches and tape libraries of the storever series.
---
.werks/2919 | 10 ++++++++
ChangeLog | 1 +
checkman/hp_webmgmt_status | 18 ++++++++++++++
checks/hp_webmgmt_status | 58 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 87 insertions(+)
diff --git a/.werks/2919 b/.werks/2919
new file mode 100644
index 0000000..5a940e3
--- /dev/null
+++ b/.werks/2919
@@ -0,0 +1,10 @@
+Title: hp_webmgmt_status: New check for health status of various Hewlett-Packard devices
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1452847397
+Class: feature
+
+This check supports different device types but apparently not all models. Among the
supported devices are some
+switches and tape libraries of the storever series.
diff --git a/ChangeLog b/ChangeLog
index 4c63f18..b55f708 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -80,6 +80,7 @@
* 2916 checkpoint_fan, checkpoint_firewall, checkpoint_ha_problems,
checkpoint_ha_status, checkpoint_powersupply, checkpoint_svn_status, checkpoint_temp,
checkpoint_voltage: New checks for various aspects of checkpoint firewalls
* 2890 cisco_nexus_cpu, cisco_oldcpu: new checks for Cisco devices which do not
support CPU utilization information from CISCO PROCESS MIB
* 2918 agent_jolokia: jolokia can now be monitored using a special agent
+ * 2919 hp_webmgmt_status: New check for health status of various Hewlett-Packard
devices...
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checkman/hp_webmgmt_status b/checkman/hp_webmgmt_status
new file mode 100644
index 0000000..eecc07d
--- /dev/null
+++ b/checkman/hp_webmgmt_status
@@ -0,0 +1,18 @@
+title: HP Web Management: Status
+agents: snmp
+catalog: hw/network/hp
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the overall health status of various HP devices.
+
+ The check status is directly relayed from the device, with both "critical"
+ and "non-recoverable" device statuses translating to {CRIT}
+
+ It's not entirely clear which devices are covered by the check but it does
+ support some switches and tape libraries of the storever series.
+ It's possible support for the used mib is configurable in the device.
+
+inventory:
+ One service per management object is discovered, usually one.
+
diff --git a/checks/hp_webmgmt_status b/checks/hp_webmgmt_status
new file mode 100644
index 0000000..e9906dc
--- /dev/null
+++ b/checks/hp_webmgmt_status
@@ -0,0 +1,58 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2016 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_webmgmt_status(info):
+ for index, health in info:
+ yield index, None
+
+
+def check_hp_webmgmt_status(item, _no_params, info):
+ status_map = {
+ "1": (3, "unknown"),
+ "2": (3, "unused"),
+ "3": (0, "ok"),
+ "4": (1, "warning"),
+ "5": (2, "critical"),
+ "6": (2, "non-recoverable")
+ }
+ for index, health in info:
+ if index == item:
+ status, status_msg = status_map[health]
+ return status, "Device status: %s" % status_msg
+
+
+check_info['hp_webmgmt_status'] = {
+ 'check_function' : check_hp_webmgmt_status,
+ 'inventory_function' : inventory_hp_webmgmt_status,
+ 'service_description' : "Status %s",
+ 'snmp_scan_function' : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.11")\
+ and
oid(".1.3.6.1.4.1.11.2.36.1.1.5.1.1.1"),
+ 'snmp_info' : ('.1.3.6.1.4.1.11.2.36.1.1.5.1.1', [1, #
hpHttpMgDeviceIndex
+ 3 #
hpHttpMgDeviceHealth
+ ]),
+}
+