Module: check_mk
Branch: master
Commit: 9b1c6b4c4037068ccf73da27b58f29d986dcab88
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9b1c6b4c403706…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Tue Oct 14 16:04:15 2014 +0200
ps: fix for include function and minor code cleanup
---
checks/ps | 6 +++---
checks/ps.include | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/checks/ps b/checks/ps
index 5746a94..919fcbb 100644
--- a/checks/ps
+++ b/checks/ps
@@ -154,14 +154,14 @@ def inventory_ps_perf(info):
def check_ps(item, params, info, with_perfdata):
cpu_cores, info = ps_parse_info(info) # parse windows wmic information
- return check_ps_common("processes", item, params, info, with_perfdata =
with_perfdata, cpu_cores = cpu_cores)
+ return check_ps_common(item, params, info, with_perfdata = with_perfdata, cpu_cores =
cpu_cores )
check_info['ps'] = {
"check_function" : lambda i,p,n: check_ps(i,p,n,False),
"inventory_function" : inventory_ps,
"service_description" : "proc_%s",
- "includes" : "ps.include",
+ "includes" : [ "ps.include" ],
"has_perfdata" : False,
"node_info" : True, # add first column with actual host name
"group" : "ps",
@@ -171,7 +171,7 @@ check_info['ps.perf'] = {
"check_function" : lambda i,p,n: check_ps(i,p,n,True),
"inventory_function" : inventory_ps_perf,
"service_description" : "proc_%s",
- "includes" : "ps.include",
+ "includes" : [ "ps.include" ],
"has_perfdata" : True,
"node_info" : True, # add first column with actual host name
"group" : "ps",
diff --git a/checks/ps.include b/checks/ps.include
index 28f6d11..f8b162c 100644
--- a/checks/ps.include
+++ b/checks/ps.include
@@ -198,7 +198,7 @@ def process_matches(ps, procname, l_user):
# "warnmax" : 1,
# }
-def check_ps_common(what, item, params, info, with_perfdata = False, cpu_cores = 1):
+def check_ps_common(item, params, info, with_perfdata = False, cpu_cores = 1, info_name =
"processes" ):
now = time.time()
if type(params) in (list, tuple):
if len(params) == 5:
@@ -308,7 +308,7 @@ def check_ps_common(what, item, params, info, with_perfdata = False,
cpu_cores =
else:
perfdata = []
- infotext = "%d %s" % (count, what)
+ infotext = "%d %s" % (count, info_name)
if running_on:
infotext += " [running on %s]" % ", ".join(running_on)