Module: check_mk
Branch: master
Commit: b87c7760b095680d6c87f8e115dc0dc8fdc58e44
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b87c7760b09568…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Oct 14 09:09:04 2015 +0200
#2679 FIX hp_proliant_power: Not discoverying when host is reporting "absent"
state
When the host is reporting a state of "absent" for power metering, this check
is useless, so not discovering the service when this state is reported.
---
.werks/2679 | 10 ++++++++++
ChangeLog | 1 +
checks/hp_proliant_power | 14 +++++++++++---
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/.werks/2679 b/.werks/2679
new file mode 100644
index 0000000..00f9c39
--- /dev/null
+++ b/.werks/2679
@@ -0,0 +1,10 @@
+Title: hp_proliant_power: Not discoverying when host is reporting "absent"
state
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1444806472
+Class: fix
+
+When the host is reporting a state of "absent" for power metering, this check
+is useless, so not discovering the service when this state is reported.
diff --git a/ChangeLog b/ChangeLog
index 76a482f..96903d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -220,6 +220,7 @@
* 2657 FIX: windows agent: fixed failure to resolve named performance counters...
* 2676 FIX: cisco_asa_failover: Failover state is not treated as warning state
anymore...
* 2658 FIX: logwatch: unacknowledged messages exceeding the max size are now dropped,
even if they were already stored due to a previous bug...
+ * 2679 FIX: hp_proliant_power: Not discoverying when host is reporting
"absent" state...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/hp_proliant_power b/checks/hp_proliant_power
index b837ce6..eeef5fc 100644
--- a/checks/hp_proliant_power
+++ b/checks/hp_proliant_power
@@ -24,15 +24,23 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+# .2 cpqHePowerMeterStatus
+# Description: This value specifies whether Power Meter reading is supported by
this Server .
+# The following values are supported:
+# other(1) Could not read the Power Meter status.
+# present(2) The Power Meter data is available.
+# absent(3) The Power Meter data is not available at this time.
+
hp_prolaint_power_default_levels = ( 300, 400 )
def inventory_hp_proliant_power(info):
- if len(info) > 0 and info[0][0] != '0':
+ if len(info) > 0 and info[0][0] not in ['0', '3']:
return [ ( None, 'hp_prolaint_power_default_levels') ]
def check_hp_proliant_power(item, params, info):
status_table = {
1 : "other",
+ 2 : "present",
3 : "absent",
}
status, reading = map(int, info[0])
@@ -43,10 +51,10 @@ def check_hp_proliant_power(item, params, info):
levels = ''
if reading >= crit:
state = 2
- levels = '( Warning/Critical %s/%s )' % ( warn, crit )
+ levels = ' (Warning/Critical %s/%s)' % ( warn, crit )
elif reading >= warn:
state = 1
- levels = '( Warning/Critical %s/%s )' % ( warn, crit )
+ levels = ' (Warning/Critical %s/%s)' % ( warn, crit )
perf = [ ('watt', reading, warn, crit ) ]
return state, "Current reading: %d Watt" % reading + levels, perf