Skipping inventory of not supported System temp sesnor for M6220 devices
Message-ID: <5486e7dc.hy10RBEjNBJkumwM%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 42db02d0b8eee4286daf91993ffff9e400aa8585
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=42db02d0b8eee4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 9 12:51:56 2014 +0100
#1733 FIX dell_powerconnect_psu: Skipping inventory of not supported System temp sesnor
for M6220 devices
These switches report invalid values for the System temperature sensor. Now skipping
the inventory of this sensor. If you aleady have this sensor inventorized, simply do
a complete reinventory to get the check removed.
---
.werks/1733 | 11 ++++++
ChangeLog | 1 +
checks/dell_powerconnect_psu | 82 +++++++++++++++++++++++++++---------------
3 files changed, 65 insertions(+), 29 deletions(-)
diff --git a/.werks/1733 b/.werks/1733
new file mode 100644
index 0000000..ac1d509
--- /dev/null
+++ b/.werks/1733
@@ -0,0 +1,11 @@
+Title: dell_powerconnect_psu: Skipping inventory of not supported System temp sesnor for
M6220 devices
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418125839
+Class: fix
+
+These switches report invalid values for the System temperature sensor. Now skipping
+the inventory of this sensor. If you aleady have this sensor inventorized, simply do
+a complete reinventory to get the check removed.
diff --git a/ChangeLog b/ChangeLog
index 14a68da..a754489 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -144,6 +144,7 @@
* 1730 FIX: apc_symmetra: Fixed exception when last diagnose date was not known
* 1731 FIX: ipmi_sensors: Fixed agent part when ipmi-sensors call on first agent
run...
* 1732 FIX: dell_powerconnect_cpu: Fixed exception during inventory for incompatible
devices
+ * 1733 FIX: dell_powerconnect_psu: Skipping inventory of not supported System temp
sesnor for M6220 devices...
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/dell_powerconnect_psu b/checks/dell_powerconnect_psu
index 26bbc8a..3ef5762 100644
--- a/checks/dell_powerconnect_psu
+++ b/checks/dell_powerconnect_psu
@@ -24,19 +24,16 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# Author: Lars Michelsen <lm(a)mathias-kettner.de>
-# Modified for Dell Sensors By: Chris Bowlby <cbowlby(a)tenthpowertech.com>
-
# Tested with Dell PowerConnect 5448 and 5424 models.
# Relevant SNMP OIDs:
-#.1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.1.67109185 = INTEGER: 67109185
-#.1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.1.67109186 = INTEGER: 67109186
-#.1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.2.67109185 = STRING: "ps1_unit1"
-#.1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.2.67109186 = STRING: "ps2_unit1"
-#.1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.3.67109185 = INTEGER: 1
-#.1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.3.67109186 = INTEGER: 5
-#.1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.4.67109185 = INTEGER: 5
-#.1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.4.67109186 = INTEGER: 4
+# .1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.1.67109185 = INTEGER: 67109185
+# .1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.1.67109186 = INTEGER: 67109186
+# .1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.2.67109185 = STRING: "ps1_unit1"
+# .1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.2.67109186 = STRING: "ps2_unit1"
+# .1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.3.67109185 = INTEGER: 1
+# .1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.3.67109186 = INTEGER: 5
+# .1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.4.67109185 = INTEGER: 5
+# .1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1.4.67109186 = INTEGER: 4
# Status codes:
# 1 => normal,
@@ -54,40 +51,67 @@
# 5 => internalRedundant
# GENERAL MAPS:
-dell_powerconnect_psu_status_map = { '1': 'normal', '2':
'warning', '3': 'critical', '4': 'shutdown',
'5': 'notPresent', '6': 'notFunctioning' }
-dell_powerconnect_psu_supply_map = { '1': 'Unknown', '2':
'Alternating Current', '3': 'Direct Current', '4':
'External Power Supply', '5': 'Internal Redundant' }
-dell_powerconnect_psu_status2nagios_map = { 'normal': 0, 'warning': 1,
'critical': 2, 'shutdown': 3, 'notPresent': 1,
'notFunctioning': 2 }
-dell_powerconnect_psu_state_performance_map = { '1': 1, '2': 0,
'3': 0, '4': 0, '5': 0, '6': 0 }
+dell_powerconnect_psu_status_map = {
+ '1': 'normal',
+ '2': 'warning',
+ '3': 'critical',
+ '4': 'shutdown',
+ '5': 'notPresent',
+ '6': 'notFunctioning',
+}
+
+dell_powerconnect_psu_supply_map = {
+ '1': 'Unknown',
+ '2': 'Alternating Current',
+ '3': 'Direct Current',
+ '4': 'External Power Supply',
+ '5': 'Internal Redundant',
+}
+
+dell_powerconnect_psu_status2nagios_map = {
+ 'normal' : 0,
+ 'warning' : 1,
+ 'critical' : 2,
+ 'shutdown' : 3,
+ 'notPresent' : 1,
+ 'notFunctioning' : 2,
+}
-# Inventory of all the PS devices in the switch
def inventory_dell_powerconnect_psu(checkname, info):
inventory = []
- for device_id, name, state, supply in info:
- if dell_powerconnect_psu_status_map[state] != 'notPresent':
+ hw_ident = info[0][0][0]
+ for device_id, name, state, supply in info[1]:
+ # M6220 are blade switches which report valid values only for the
"Main"
+ # sensor. The other one is reported as notFunctioning, but this is wrong.
+ # Simply ignore the "System" sensor for those devices.
+ if dell_powerconnect_psu_status_map[state] != 'notPresent' \
+ and ('M6220' not in hw_ident or name != 'System'):
inventory.append((name, None))
return inventory
-# Check of the states of each PS unit.
def check_dell_powerconnect_psu(item, _not_used, info):
- for device_id, name, state, supply in info:
+ hw_ident = info[0][0][0]
+ for device_id, name, state, supply in info[1]:
if name == item:
dell_powerconnect_status = dell_powerconnect_psu_status_map[state]
status = dell_powerconnect_psu_status2nagios_map[dell_powerconnect_status]
- return (status, 'Condition of PSU "%s" is %s, with source
%s' %
- (name, dell_powerconnect_status,
dell_powerconnect_psu_supply_map[supply]))
+ return status, 'Condition is %s, with source %s' % \
+ (dell_powerconnect_status,
dell_powerconnect_psu_supply_map[supply])
return (3, "item not found in snmp data")
-
-# Auto-detection of what PSU's are connected and active.
-
check_info["dell_powerconnect_psu"] = {
'check_function': check_dell_powerconnect_psu,
'inventory_function': inventory_dell_powerconnect_psu,
'service_description': 'Sensor %s',
- 'has_perfdata': True,
- 'snmp_info':
('.1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1', ['1', '2',
'3', '4']),
- 'snmp_scan_function': \
- lambda oid: ".1.3.6.1.4.1.674.10895" in
oid(".1.3.6.1.2.1.1.2.0"),
+ 'has_perfdata': False,
+ 'snmp_info': [('.1.3.6.1.4.1.674.10895.3000.1.2.100.1',
['0']), #productIdentificationDisplayName
+ ('.1.3.6.1.4.1.674.10895.3000.1.2.110.7.2.1', [
+ '1', # envMonSupplyStatusIndex
+ '2', # envMonSupplyStatusDescr
+ '3', # envMonSupplyState
+ '4', # envMonSupplySource
+ ])],
+ 'snmp_scan_function': lambda oid: ".1.3.6.1.4.1.674.10895" in
oid(".1.3.6.1.2.1.1.2.0"),
}