Module: check_mk
Branch: master
Commit: e9f1bb1318e9ed11f81b6f5d8d4b5c1a0c903525
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e9f1bb1318e9ed…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 9 11:29:04 2014 +0100
#1732 FIX dell_powerconnect_cpu: Fixed exception during inventory for incompatible
devices
---
.werks/1732 | 9 +++++++++
ChangeLog | 1 +
checks/dell_powerconnect_cpu | 30 +++++++++++++-----------------
3 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/.werks/1732 b/.werks/1732
new file mode 100644
index 0000000..a008356
--- /dev/null
+++ b/.werks/1732
@@ -0,0 +1,9 @@
+Title: dell_powerconnect_cpu: Fixed exception during inventory for incompatible devices
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418120926
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 0ce7f08..14a68da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -143,6 +143,7 @@
* 1729 FIX: apc_symmetra_test: Cleaned up check, fixed exception when self test date
is zero
* 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
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/dell_powerconnect_cpu b/checks/dell_powerconnect_cpu
index 9ba6be5..590da2a 100644
--- a/checks/dell_powerconnect_cpu
+++ b/checks/dell_powerconnect_cpu
@@ -24,27 +24,25 @@
# 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 PowerConnect Switches by : Chris Bowlby
<cbowlby(a)tenthpowertech.com>
-
# Relevant SNMP OIDs:
-#.1.3.6.1.4.1.89.1.1.0 = INTEGER: 65535
-#.1.3.6.1.4.1.89.1.2.0 = INTEGER: none(26)
-#.1.3.6.1.4.1.89.1.4.0 = Hex-STRING: E0
-#.1.3.6.1.4.1.89.1.5.0 = INTEGER: 1
-#.1.3.6.1.4.1.89.1.6.0 = INTEGER: true(1)
-#.1.3.6.1.4.1.89.1.7.0 = INTEGER: 91
-#.1.3.6.1.4.1.89.1.8.0 = INTEGER: 10
-#.1.3.6.1.4.1.89.1.9.0 = INTEGER: 4
+# .1.3.6.1.4.1.89.1.1.0 = INTEGER: 65535
+# .1.3.6.1.4.1.89.1.2.0 = INTEGER: none(26)
+# .1.3.6.1.4.1.89.1.4.0 = Hex-STRING: E0
+# .1.3.6.1.4.1.89.1.5.0 = INTEGER: 1
+# .1.3.6.1.4.1.89.1.6.0 = INTEGER: true(1)
+# .1.3.6.1.4.1.89.1.7.0 = INTEGER: 91
+# .1.3.6.1.4.1.89.1.8.0 = INTEGER: 10
+# .1.3.6.1.4.1.89.1.9.0 = INTEGER: 4
# Default values for parameters that can be overriden.
dell_powerconnect_cpu_default_levels = (80, 90)
# Inventory of dell power connect CPU details.
def inventory_dell_powerconnect_cpu(checkname, info):
- enabled, onesecondperc, oneminuteperc, fiveminutesperc = info[0]
- if enabled == '1' and onesecondperc != '' and int(onesecondperc)
>= 0:
- return [ (None, 'dell_powerconnect_cpu_default_levels') ]
+ if info:
+ enabled, onesecondperc, oneminuteperc, fiveminutesperc = info[0]
+ if enabled == '1' and onesecondperc != '' and int(onesecondperc)
>= 0:
+ return [ (None, 'dell_powerconnect_cpu_default_levels') ]
# Check of dell power connect CPU details.
def check_dell_powerconnect_cpu(item, params, info):
@@ -75,8 +73,6 @@ def check_dell_powerconnect_cpu(item, params, info):
return (3, "Invalid information in SNMP data")
-# Auto-detection of CPU elements.
-
check_info["dell_powerconnect_cpu"] = {
'check_function': check_dell_powerconnect_cpu,
'inventory_function': inventory_dell_powerconnect_cpu,
@@ -84,5 +80,5 @@ check_info["dell_powerconnect_cpu"] = {
'has_perfdata': True,
'snmp_info': ('.1.3.6.1.4.1.89.1', ['6',
'7', '8', '9']),
'snmp_scan_function': \
- lambda oid: ".1.3.6.1.4.1.674.10895" in
oid(".1.3.6.1.2.1.1.2.0"),
+ lambda oid: ".1.3.6.1.4.1.674.10895" in
oid(".1.3.6.1.2.1.1.2.0")
}