Module: check_mk
Branch: master
Commit: 993c970897545df300850452bf3f21dc75b0687d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=993c970897545d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 29 15:27:13 2013 +0100
Added note to inventory draft
---
doc/drafts/LIESMICH.hardwareinventur | 7 +++++++
modules/check_mk_base.py | 2 +-
modules/prediction.py | 16 +++++++++++-----
web/htdocs/wato.py | 18 ++++++++++++++----
4 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/doc/drafts/LIESMICH.hardwareinventur b/doc/drafts/LIESMICH.hardwareinventur
index d3c9196..efca246 100644
--- a/doc/drafts/LIESMICH.hardwareinventur
+++ b/doc/drafts/LIESMICH.hardwareinventur
@@ -208,3 +208,10 @@ sind ja einfach anzuzeigen. Wenn aber etwas gebraucht wird wie
"Version von
RPM-Paket X", dann ist das X ja variabel. Dies könnten wir evtl. lösen,
in dem wir den bestehenden Mechanismus zum Anzeigen von Service-Daten in
Hosttabellen verwenden.
+
+
+-------------------------------------------------------------------------------
+ N O T I Z E N
+-------------------------------------------------------------------------------
+
+- Das ganze muss natürlich auch auf Workstations funktionieren!
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index e2aed27..657749f 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1361,7 +1361,7 @@ def pnp_cleanup(s):
# | These functions are used in some of the checks. |
# +----------------------------------------------------------------------+
-# Generic function for checking a value against levels. This also support
+# Generic function for checking a value against levels. This also supports
# predictive levels.
# value: currently measured value
# dsname: name of the datasource in the RRD that corresponds to this value
diff --git a/modules/prediction.py b/modules/prediction.py
index bf114d3..db1041f 100644
--- a/modules/prediction.py
+++ b/modules/prediction.py
@@ -314,15 +314,21 @@ def get_predictive_levels(dsname, params, cf, levels_factor=1.0):
if p in params:
how, (warn, crit) = params[p]
if how == "absolute":
- levels.append((ref_value + (sig * warn * levels_factor), ref_value +
(sig * crit * levels_factor)))
+ this_levels = (ref_value + (sig * warn * levels_factor), ref_value +
(sig * crit * levels_factor))
elif how == "relative":
- levels.append((ref_value + sig * (ref_value * warn / 100),
- ref_value + sig * (ref_value * crit / 100)))
+ this_levels = (ref_value + sig * (ref_value * warn / 100),
+ ref_value + sig * (ref_value * crit / 100))
else: # how == "stdev":
- levels.append((ref_value + sig * (stdev * warn),
- ref_value + sig * (stdev * crit)))
+ this_levels = (ref_value + sig * (stdev * warn),
+ ref_value + sig * (stdev * crit))
+
+ if what == "upper" and "levels_upper_min" in params:
+ limit_warn, limit_crit = params["levels_upper_min"]
+ this_levels = (max(limit_warn, this_levels[0]), max(limit_crit,
this_levels[1]))
+ levels.append(this_levels)
else:
levels.append((None, None))
+
# print levels
return ref_value, levels
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 24c2aca..eb2fc5c 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -12159,7 +12159,7 @@ def PredictiveLevels(**args):
dif = args.get("default_difference", (2.0, 4.0))
return Dictionary(
title = _("Predictive Levels"),
- optional_keys = [ "weight", "levels_upper",
"levels_lower" ],
+ optional_keys = [ "weight", "levels_upper",
"levels_upper_min", "levels_lower", "levels_lower_max" ],
default_keys = [ "levels_upper" ],
columns = 1,
headers = "sup",
@@ -12188,7 +12188,7 @@ def PredictiveLevels(**args):
# )),
( "levels_upper",
CascadingDropdown(
- title = _("Dynamic levels (upper bound)"),
+ title = _("Dynamic levels - upper bound"),
choices = [
( "absolute",
_("Absolute difference from prediction"),
@@ -12216,9 +12216,20 @@ def PredictiveLevels(**args):
)),
]
)),
+ ( "levels_upper_min",
+ Tuple(
+ title = _("Limit for upper bound dynamic levels"),
+ help = _("Regardless of how the dynamic levels upper bound are
computed according to the prediction: "
+ "the will never be set below the following limits. This
avoids false alarms "
+ "during times where the predicted levels would be very
low."),
+ elements = [
+ Float(title = _("Warning level is at least")),
+ Float(title = _("Critical level is at least")),
+ ]
+ )),
( "levels_lower",
CascadingDropdown(
- title = _("Dynamic levels (lower bound)"),
+ title = _("Dynamic levels - lower bound"),
choices = [
( "absolute",
_("Absolute difference from prediction"),
@@ -12246,7 +12257,6 @@ def PredictiveLevels(**args):
)),
]
)),
-
]
)