Module: check_mk
Branch: master
Commit: b09c57492b1272738118e1c1e17dbdc95087b767
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b09c57492b1272…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Aug 18 16:45:38 2015 +0200
cpu_util configuration now uses standardised time-unit widget
---
checks/cpu_util.include | 6 +++---
web/plugins/wato/check_parameters.py | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/checks/cpu_util.include b/checks/cpu_util.include
index 13fcbd3..55c16ff 100644
--- a/checks/cpu_util.include
+++ b/checks/cpu_util.include
@@ -178,15 +178,15 @@ def check_cpu_util_unix(values, params, cores = None):
threshold, warn_core, crit_core = params["core_util_time"]
if total_perc > threshold:
timestamp = get_item_state(core_state_name, 0)
- high_load_duration = (this_time - timestamp) / 60
+ high_load_duration = (this_time - timestamp)
if timestamp == 0:
set_item_state(core_state_name, this_time)
elif high_load_duration > crit_core:
yield 2, "%s is under high load for %s minutes (warn/crit at
%s/%s minutes)" %\
- (core, high_load_duration, warn_core, crit_core)
+ (core, high_load_duration / 60, warn_core / 60, crit_core / 60)
elif high_load_duration > warn_core:
yield 1, "%s is under high load for %s minutes (warn/crit at
%s/%s minutes)" %\
- (core, high_load_duration, warn_core, crit_core)
+ (core, high_load_duration / 60, warn_core / 60, crit_core / 60)
else:
clear_item_state(core_state_name)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index d336eee..bd9f86a 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -4305,8 +4305,8 @@ register_check_parameters(
title = _("Alert on high utilization over an extended time
period on a single core"),
elements = [
Percentage(title = _("High utilization at "),
default_value = 100.0),
- Integer(title = _("Warning after "), default_value =
5, unit = "min"),
- Integer(title = _("Critical after "), default_value =
15, unit = "min"),
+ Age(title = _("Warning after "), default_value = 5 *
60),
+ Age(title = _("Critical after "), default_value = 15
* 60),
],
help = _("A single thread fully utilizing a single core
(potentially due to a bug) "
"may go unnoticed when only monitoring the total
utilization of the CPU. "