Module: check_mk
Branch: master
Commit: 40c80ae73479d4804d7516ceb34ef8e9df781f2e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=40c80ae73479d4…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Mar 7 15:40:07 2017 +0100
4486 FIX avaya_88xx, avaya_88xx_cpu: fixed invalid data handling, ie. ValueError: invalid
literal for int() with base 10: ''
Change-Id: Ie08254b9b99b2560aaa7884bd87022e23c3daf23
---
.werks/4486 | 11 +++++++++++
checks/avaya_88xx | 9 +++++++--
checks/avaya_88xx_cpu | 7 ++++---
3 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/.werks/4486 b/.werks/4486
new file mode 100644
index 0000000..403b4ce
--- /dev/null
+++ b/.werks/4486
@@ -0,0 +1,11 @@
+Title: avaya_88xx, avaya_88xx_cpu: fixed invalid data handling, ie. ValueError: invalid
literal for int() with base 10: ''
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1488897554
+
+
diff --git a/checks/avaya_88xx b/checks/avaya_88xx
index f084bd4..a932e97 100644
--- a/checks/avaya_88xx
+++ b/checks/avaya_88xx
@@ -29,6 +29,7 @@ def parse_avaya_88xx(info):
for line in info:
parsed["fanstate"].append(line[0])
parsed["temp"].append(line[1])
+
return parsed
def inventory_avaya_88xx_fan(parsed):
@@ -58,14 +59,18 @@ factory_settings["avaya_88xx_default_levels"] = {
def inventory_avaya_88xx(parsed):
sensors = parsed["temp"]
for idx, temp in enumerate(sensors):
- yield str(idx), {}
+# if temp:
+ yield str(idx), {}
def check_avaya_88xx(item, params, parsed):
sensors = parsed["temp"]
if len(sensors) < int(item):
return
- return check_temperature(int(sensors[int(item)]), params, "avaya_88xx_%s" %
item)
+ reading = sensors[int(item)]
+ if reading:
+ return check_temperature(int(reading), params, "avaya_88xx_%s" % item)
+
check_info["avaya_88xx"] = {
'parse_function': parse_avaya_88xx,
diff --git a/checks/avaya_88xx_cpu b/checks/avaya_88xx_cpu
index fe614f0..cab64b8 100644
--- a/checks/avaya_88xx_cpu
+++ b/checks/avaya_88xx_cpu
@@ -29,14 +29,16 @@ factory_settings["avaya_88xx_cpu_default_levels"] = {
"levels" : (90, 95),
}
+
def inventory_avaya_88xx_cpu(info):
return [(None, {})]
+
def check_avaya_88xx_cpu(_no_item, params, info):
if not info:
return
+ return check_cpu_util(int(info[0][0]), params, time.time())
- return check_cpu_util(int(info[0][1]), params, time.time())
check_info["avaya_88xx_cpu"] = {
'check_function': check_avaya_88xx_cpu,
@@ -45,8 +47,7 @@ check_info["avaya_88xx_cpu"] = {
'default_levels_variable': "avaya_88xx_cpu_default_levels",
'group': 'cpu_utilization',
'has_perfdata': True,
- # RAPID-CITY MIB
- 'snmp_info': ( ".1.3.6.1.4.1.2272.1.1", [ 13, 20,
21, 41, 47 ]), # rcSysCpuUtil
+ 'snmp_info': ( ".1.3.6.1.4.1.2272.1.1", [ 20 ]), #
RAPID-CITY MIB::rcSysCpuUtil
'snmp_scan_function': lambda oid: ".1.3.6.1.4.1.2272" in
oid(".1.3.6.1.2.1.1.2.0"),
'includes': [ 'cpu_util.include' ],
}