Module: check_mk
Branch: master
Commit: 8b6f717760b25c7ef374324ce3abbbbf271eb30c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8b6f717760b25c…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Jun 27 14:25:37 2014 +0200
hp_proliant_power: New check to monitor the Power Meter on Prolaint Servers and iLO
Boards
---
.werks/170 | 8 +++++
ChangeLog | 1 +
checkman/hp_proliant_power | 16 +++++++++
checks/hp_proliant_power | 68 ++++++++++++++++++++++++++++++++++++
web/plugins/perfometer/check_mk.py | 1 +
5 files changed, 94 insertions(+)
diff --git a/.werks/170 b/.werks/170
new file mode 100644
index 0000000..9ce90f1
--- /dev/null
+++ b/.werks/170
@@ -0,0 +1,8 @@
+Title: hp_proliant_power: New check to monitor the Power Meter on Prolaint Servers and
iLO Boards
+Level: 1
+Component: checks
+Version: 1.2.5i5
+Date: 1403871902
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 7bb5f9c..2cdb7ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
* 0168 f5_bigip_pool: Added Wato configuration...
* 0995 raritan_pdu_outletcount: new check for outlet count of Raritan PX-2000 family
PDUs
* 0169 websphere_mq_channels,ebsphere_mq_queues: New Checks to monitor IBM Websphere
MQ Queues and Channels...
+ * 0170 hp_proliant_power: New check to monitor the Power Meter on Prolaint Servers
and iLO Boards
* 0994 FIX: agent plugin smart: fixed syntax error
* 0989 FIX: logwatch.ec: Fix forwarding multiple messages via syslog/TCP...
* 0943 FIX: if.include: fixed incorrect traffic percentage values in the check output
of if checks...
diff --git a/checkman/hp_proliant_power b/checkman/hp_proliant_power
new file mode 100644
index 0000000..51f6ab7
--- /dev/null
+++ b/checkman/hp_proliant_power
@@ -0,0 +1,16 @@
+title: HP Proliant Servers: Power Meter
+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 (or iLO Board) 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 the power meter and his current reading in Watt.
+
+inventory:
+ One check is automatically created.
diff --git a/checks/hp_proliant_power b/checks/hp_proliant_power
new file mode 100755
index 0000000..f4cf877
--- /dev/null
+++ b/checks/hp_proliant_power
@@ -0,0 +1,68 @@
+#!/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.
+
+hp_prolaint_power_default_levels = ( 300, 400 )
+
+def inventory_hp_proliant_power(info):
+ if len(info) > 0:
+ return [ ( None, 'hp_prolaint_power_default_levels') ]
+
+def check_hp_proliant_power(item, params, info):
+ status_table = {
+ 1 : "other",
+ 3 : "absent",
+ }
+ status, reading = map(saveint, info[0])
+ if status != 2:
+ return 2, "Power Meter state: %s" % ( status_table[status] )
+ warn, crit = params
+ state = 0
+ levels = ''
+ if reading > crit:
+ state = 2
+ levels = '( Warning/Critical %s/%s )' % ( warn, crit )
+ elif reading > warn:
+ state = 1
+ levels = '( Warning/Critical %s/%s )' % ( warn, crit )
+
+ perf = [ ('watt', reading, warn, crit ) ]
+ return state, "Current reading: %d Watt" % reading + levels, perf
+
+check_info["hp_proliant_power"] = {
+ 'group' : 'epower',
+ 'check_function' : check_hp_proliant_power,
+ 'inventory_function' : inventory_hp_proliant_power,
+ 'service_description' : 'HW Power Meter',
+ 'snmp_info': (
+ ".1.3.6.1.4.1.232.6.2.15", [
+ "2", # cpqHePowerMeterStatus
+ "3", # cpqHePowerMeterCurrReading
+ ]
+ ),
+ 'snmp_scan_function' : \
+ lambda oid: "proliant" in
oid(".1.3.6.1.4.1.232.2.2.4.2.0").lower(),
+ 'has_perfdata' : True
+}
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index dd8eba1..28951d8 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -375,6 +375,7 @@ def perfometer_power(row, check_command, perf_data):
perfometers["check_mk-dell_poweredge_amperage.power"] = perfometer_power
perfometers["check_mk-dell_chassis_power"] = perfometer_power
perfometers["check_mk-dell_chassis_powersupplies"] = perfometer_power
+perfometers["check_mk-hp-proliant_power"] = perfometer_power
def perfometer_users(row, check_command, perf_data):
state = row["service_state"]