Module: check_mk
Branch: master
Commit: 3907338ab5878169ac2d6cfc9b86acc53121c259
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3907338ab58781…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 3 19:25:55 2014 +0100
#1623 FIX hp_proliant_mem: support for some yet unhandled status situations
---
.werks/1623 | 9 +++++++++
ChangeLog | 1 +
checks/hp_proliant_mem | 50 +++++++++++++++++++++++++++++++++++-------------
3 files changed, 47 insertions(+), 13 deletions(-)
diff --git a/.werks/1623 b/.werks/1623
new file mode 100644
index 0000000..dd21022
--- /dev/null
+++ b/.werks/1623
@@ -0,0 +1,9 @@
+Title: hp_proliant_mem: support for some yet unhandled status situations
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417631124
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 4dabc1e..e9e89f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -80,6 +80,7 @@
* 1622 FIX: megaraid_bbu: handle case isSOHGood and consider it as critical...
* 1617 FIX: lnx_if: Deal with data provided by cluster host
* 1618 FIX: ad_replication: Output of timeLastSuccess and timeLastFailure was
inverted...
+ * 1623 FIX: hp_proliant_mem: support for some yet unhandled status situations
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/hp_proliant_mem b/checks/hp_proliant_mem
index c6f08c2..c623b1b 100644
--- a/checks/hp_proliant_mem
+++ b/checks/hp_proliant_mem
@@ -34,12 +34,19 @@ hp_proliant_mem_type_map = {
5: 'simm',
6: 'pcmcia',
7: 'compaq-specific',
- 8: 'dimm',
+ 8: 'DIMM',
9: 'smallOutlineDimm',
- 10: 'rimm',
- 11: 'srimm',
- 12: 'fb-dimm',
+ 10: 'RIMM',
+ 11: 'SRIMM',
+ 12: 'FB-DIMM',
+ 13: 'DIMM DDR',
+ 14: 'DIMM DDR2',
+ 15: 'DIMM DDR3',
+ 16: 'DIMM FBD2',
+ 17: 'FB-DIMM DDR2',
+ 18: 'FB-DIMM DDR3',
}
+
hp_proliant_mem_status_map = {
1: "other",
2: "notPresent",
@@ -52,7 +59,10 @@ hp_proliant_mem_status_map = {
9: "notSupported",
10: "badConfig",
11: "degraded",
+ 12: "spare",
+ 13: "partial",
}
+
hp_proliant_mem_status2nagios_map = {
'n/a': 3,
'other': 3,
@@ -66,14 +76,24 @@ hp_proliant_mem_status2nagios_map = {
'notSupported': 2,
'badConfig': 2,
'degraded': 2,
+ 'spare': 0,
+ 'partial': 1,
+}
+
+hp_proliant_mem_condition_status2nagios_map = {
+ 'other' : 3,
+ 'ok' : 0,
+ 'degraded' : 2,
+ 'failed' : 2,
+ 'degradedModuleIndexUnknown' : 3
}
-hp_proliant_mem_condition_status2nagios_map = { 'other': 3, 'ok': 0,
'degraded': 2, 'failed': 2 }
hp_proliant_mem_condition_map = {
- 0: 'n/a',
- 1: 'other',
- 2: 'ok',
- 3: 'degraded',
+ 0: 'n/a',
+ 1: 'other',
+ 2: 'ok',
+ 3: 'degraded',
+ 4: 'degradedModuleIndexUnknown',
}
def inventory_hp_proliant_mem(info):
@@ -98,12 +118,14 @@ def check_hp_proliant_mem(item, params, info):
detail_output = ', Status: %s ' % snmp_status
status = hp_proliant_mem_status2nagios_map[snmp_status]
- if status == 1:
+ if status == 0:
+ detail_output += ''
+ elif status == 1:
detail_output += '(!) '
elif status == 2:
detail_output += '(!!) '
else:
- detail_output += '(UNKNOWN) '
+ detail_output += '(?) '
condition = 'n/a'
if int(module_condition) in hp_proliant_mem_condition_map:
@@ -111,12 +133,14 @@ def check_hp_proliant_mem(item, params, info):
condition_status = hp_proliant_mem_condition_status2nagios_map[condition]
detail_output += ', Condition: %s ' % condition
- if condition_status == 1:
+ if condition_status == 0:
+ detail_output += ''
+ elif condition_status == 1:
detail_output += '(!) '
elif condition_status == 2:
detail_output += '(!!) '
else:
- detail_output += '(UNKNOWN) '
+ detail_output += '(?) '
if condition_status > status:
status = condition_status