Module: check_mk
Branch: master
Commit: 4c2e2cb8b7d8850c6c6f2f60eb4c90a1e1142b75
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4c2e2cb8b7d885…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Feb 21 10:30:45 2015 +0100
Fixed a few exceptions in Perf-O-Meters
---
checks/hpux_tunables | 2 +-
web/plugins/perfometer/check_mk.py | 8 +++++++-
web/plugins/views/perfometer.py | 2 ++
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/checks/hpux_tunables b/checks/hpux_tunables
index 647810d..0fa9ee5 100644
--- a/checks/hpux_tunables
+++ b/checks/hpux_tunables
@@ -114,7 +114,7 @@ check_info["hpux_tunables.maxfiles_lim"] = {
}
check_info["hpux_tunables.semmni"] = {
- "check_function" : lambda i, p, o: check_hpux_tunables(i, p, o,
"semmni", "semaphore ids"),
+ "check_function" : lambda i, p, o: check_hpux_tunables(i, p, o,
"semmni", "semaphore_ids"),
"inventory_function" : lambda i: inventory_hpux_tunables(i,
"semmni"),
"service_description" : "Number of IPC Semaphore IDs",
"has_perfdata" : True,
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index d25355a..74f11e1 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -99,7 +99,7 @@ def perfometer_check_mk_mem_used(row, check_command, perf_data):
swap_total = float(entry[1]) # mem.linux
if not ram_used:
- return
+ return "",""
virt_total = ram_total + swap_total
virt_used = ram_used + swap_used
@@ -910,6 +910,9 @@ def perfometer_check_mk_arcserve_backup(row, check_command,
perf_data):
perfometers["check_mk-arcserve_backup"] = perfometer_check_mk_arcserve_backup
def perfometer_check_mk_ibm_svc_host(row, check_command, perf_data):
+ if len(perf_data) < 5:
+ return "", ""
+
h = '<table><tr>'
active = int(perf_data[0][1])
inactive = int(perf_data[1][1])
@@ -940,6 +943,9 @@ def perfometer_check_mk_ibm_svc_host(row, check_command, perf_data):
perfometers["check_mk-ibm_svc_host"] = perfometer_check_mk_ibm_svc_host
def perfometer_check_mk_ibm_svc_license(row, check_command, perf_data):
+ if len(perf_data) < 2:
+ return "", ""
+
licensed = float(perf_data[0][1])
used = float(perf_data[1][1])
if used == 0 and licensed == 0:
diff --git a/web/plugins/views/perfometer.py b/web/plugins/views/perfometer.py
index bf9651e..9fd016b 100644
--- a/web/plugins/views/perfometer.py
+++ b/web/plugins/views/perfometer.py
@@ -152,6 +152,8 @@ def paint_perfometer(row):
return "", ""
title, h = perf_painter(row, check_command, perf_data)
+ if not h:
+ return "", ""
# Test code for optically detecting old-style Perf-O-Meters
if config.debug:
title = '{ ' + title + ' }'