Module: check_mk
Branch: master
Commit: e8cdc365bc57ef65455ddff71fb5203a18812909
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e8cdc365bc57ef…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri May 11 10:56:32 2018 +0200
6077 FIX ps: Using number of cores sent by Linux agent is now configurable
Change-Id: Id41bc32f82c1a41f3a49a116f3fe3a50f57c4182
---
.werks/6077 | 11 +++++++++++
checks/ps | 2 +-
web/plugins/wato/check_parameters.py | 20 ++++++++++++++++++++
3 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/.werks/6077 b/.werks/6077
new file mode 100644
index 0000000..ecd0ba9
--- /dev/null
+++ b/.werks/6077
@@ -0,0 +1,11 @@
+Title: ps: Using number of cores sent by Linux agent is now configurable
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0b4
+Date: 1526028276
+
+
diff --git a/checks/ps b/checks/ps
index 9489fc7..52eec64 100644
--- a/checks/ps
+++ b/checks/ps
@@ -242,7 +242,7 @@ def inventory_ps(info):
def check_ps(item, params, info):
(cpu_cores, parsed), mem_info, solaris_mem_info, statgrab_mem_info, aix_memory_info,
cpu_info = info
- if cpu_info and len(cpu_info[0]) == 6:
+ if cpu_info and len(cpu_info[0]) == 6 and params.get('use_linux_cpu_cores'):
cpu_cores = int(cpu_info[0][5])
if mem_info:
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 2092288..18328ab 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1361,6 +1361,26 @@ process_level_elements = [
],
default_value = "disable",
)),
+ ("use_linux_cpu_cores", Checkbox(
+ title=_("Use number of cores sent by agent (Linux)"),
+ label=_("Enable")
+ )),
+ ('process_info', DropdownChoice(
+ title = _("Enable per-process details in long-output"),
+ label = _("Enable per-process details"),
+ help = _("If active, the long output of this service will contain a list of
"
+ "all the matching processes and their details (i.e. PID, CPU
usage, memory usage). "
+ "Please note that HTML output will only work if \"Escape
HTML codes in plugin output\" is "
+ "disabled in global settings. This might expose you to
Cross-Site-Scripting (everyone "
+ "with write-access to checks could get scripts executed on the
monitoring site in the context "
+ "of the user of the monitoring site) so please do this if you
understand the consequences."),
+ choices = [
+ (None, _("Disable")),
+ ("text", _("Text output")),
+ ("html", _("HTML output"))
+ ],
+ default_value = "disable",
+ )),
]
# In version 1.2.4 the check parameters for the resulting ps check