Module: check_mk
Branch: master
Commit: 5d6f5ccc344469f003db866ca9b3f947b3bfb432
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5d6f5ccc344469…
Author: Óscar Nájera <on(a)mathias-kettner.de>
Date: Mon Nov 26 15:34:02 2018 +0100
6653 Threshold Levels for steal cpu time in Linux/Unix
Steal CPU time is the percentage of time a virtual CPU waits for a real CPU
while the hypervisor is servicing another virtual processor. Its presense
can be now monitored by setting up threshold limits as a fraction of the
total CPU utilization time.
CMK-1282
Change-Id: Ic075684811867bd040f75f24c008d984c71beb20
---
.werks/6653 | 13 +++++++++++++
checks/cpu_util.include | 3 ++-
cmk/gui/plugins/wato/check_parameters.py | 9 +++++++++
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/.werks/6653 b/.werks/6653
new file mode 100644
index 0000000..25a7cc3
--- /dev/null
+++ b/.werks/6653
@@ -0,0 +1,13 @@
+Title: Threshold Levels for steal cpu time in Linux/Unix
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1543244373
+Class: feature
+
+Steal CPU time is the percentage of time a virtual CPU waits for a real CPU
+while the hypervisor is servicing another virtual processor. Its presense
+can be now monitored by setting up threshold limits as a fraction of the
+total CPU utilization time.
diff --git a/checks/cpu_util.include b/checks/cpu_util.include
index 1e6cd10..f9deecd 100644
--- a/checks/cpu_util.include
+++ b/checks/cpu_util.include
@@ -159,7 +159,8 @@ def check_cpu_util_unix(values, params, cores=None):
# where these counters are not being used
steal = diff_values[7]
steal_perc = 100.0 * float(steal) / float(sum_jiffies)
- yield 0, "steal: %.1f%%" % steal_perc, [("steal", steal_perc)]
+ yield check_levels(
+ steal_perc, "steal", params.get('steal'),
human_readable_func=get_percent_human_readable)
guest = diff_values[8] + diff_values[9]
guest_perc = 100.0 * float(guest) / float(sum_jiffies)
diff --git a/cmk/gui/plugins/wato/check_parameters.py
b/cmk/gui/plugins/wato/check_parameters.py
index 0044b7b..12a07ed 100644
--- a/cmk/gui/plugins/wato/check_parameters.py
+++ b/cmk/gui/plugins/wato/check_parameters.py
@@ -9444,6 +9444,15 @@ register_check_parameters(
"for data coming from or going to disk. If you have a significant
disk wait "
"the the bottleneck of your server is IO. Please note that
depending on the "
"applications being run this might or might not be totally
normal."))),
+ ("steal",
+ Tuple(
+ title=_("Levels on steal CPU utilization"),
+ elements=[
+ Percentage(title=_("Warning at a steal time of"),
default_value=30.0),
+ Percentage(title=_("Critical at a steal time of"),
default_value=50.0)
+ ],
+ help=_("Here you can set levels on the steal CPU
utilization."),
+ )),
] + cpu_util_common_elements),
forth=transform_cpu_iowait,
),