Module: check_mk
Branch: master
Commit: a4e4d56a4e40576fa9b9301e4c5974225c55a350
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a4e4d56a4e4057…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Sun Oct 24 22:54:01 2010 +0200
hp_proliant_psu: Fixed multiple PSU detection on one system (Thanks to Andreas Döhler)
---
ChangeLog | 2 ++
checks/hp_proliant_psu | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 031b037..9e34fb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,8 @@
%u. That will be replaced with the user name and thus makes the
service description unique.
* win_dhcp_pools: better handle invalid agent output
+ * hp_proliant_psu: Fixed multiple PSU detection on one system (Thanks to
+ Andreas Döhler)
Livestatus:
* Prohibit { and } in regular expressions. This avoids a segmentation
diff --git a/checks/hp_proliant_psu b/checks/hp_proliant_psu
index 236dd0a..22d4d79 100644
--- a/checks/hp_proliant_psu
+++ b/checks/hp_proliant_psu
@@ -33,13 +33,13 @@ hp_proliant_redundant_map = { 1: 'other', 2:
'notRedundant', 3: 'redundant' }
def inventory_hp_proliant_psu(checkname, info):
if len(info) > 0:
- return [ (line[0], None) for line in info if line[2] == '3' ]
+ return [ (line[0] + '/' + line[1], None) for line in info if line[2] ==
'3' ]
else:
return []
def check_hp_proliant_psu(item, params, info):
for line in info:
- if line[0] == item:
+ if '/' in item and line[0] + line [1] == itemi or line[0] == item:
chassis, bay, present, status, redundant = line
snmp_status = hp_proliant_psu_status_map[int(status)]
status = hp_proliant_status2nagios_map[snmp_status]