Module: check_mk
Branch: master
Commit: 5329dc3a9b0f39a313e646a8519e6344c42ec111
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5329dc3a9b0f39…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Thu Jul 5 07:57:29 2018 +0200
Some minor perfdata fixes for more rigorous testing
wmi.include: Fix default values for perfdata
skype: Avoid casting perfvalue to list
Change-Id: I5fa56fba3230d747012f9ed3d6bd1bef6c2b2df5
---
checks/skype | 9 +++------
checks/wmi.include | 6 +++---
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/checks/skype b/checks/skype
index bd08607..b7fc9c2 100644
--- a/checks/skype
+++ b/checks/skype
@@ -557,16 +557,13 @@ def check_skype_mobile(item, params, parsed):
label=" active",
perfvar="ucwa_active_sessions")
if status != 3:
- if perfdata:
- perfdata = list(perfdata[0])
- perfdata[0] += "_" + name.lower()
- perfdata = [perfdata]
-
+ perfdata = [('%s_%s' % (p[0], name.lower()),) + p[1:] for p in
perfdata]
yield status, "%s: %s" % (name, infotext), perfdata
+
else:
# add a perfcounter with 0 sessions for all missing devices so we can
# still properly build a combined graph for active sessions
- yield 0, None, [("active_sessions_%s" % name.lower(), 0)]
+ yield 0, None, [("active_sessions_%s" % name.lower(), 0, None,
None, None, None)]
yield wmi_yield_raw_counter(parsed["LS:WEB - Throttling and
Authentication"], item,
"WEB - Total Requests In Processing",
diff --git a/checks/wmi.include b/checks/wmi.include
index 16036bf..00f35e6 100644
--- a/checks/wmi.include
+++ b/checks/wmi.include
@@ -298,12 +298,12 @@ def get_wmi_time(table, row):
return float(timestamp) / float(frequency)
-def wmi_make_perfvar(varname, value, perfscale, levels, min_value="",
max_value=""):
+def wmi_make_perfvar(varname, value, perfscale, levels, min_value=None, max_value=None):
value = value * perfscale
if levels is not None:
- upper_levels = levels.get('upper', ("", ""))
+ upper_levels = levels.get('upper', (None, None))
else:
- upper_levels = ("", "")
+ upper_levels = (None, None)
res = (varname, value, upper_levels[0], upper_levels[1], min_value, max_value)
return res