Module: check_mk
Branch: master
Commit: b3739e1be6ffcab7af02c0678dd83d317a058b01
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b3739e1be6ffca…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Feb 9 09:52:28 2018 +0100
5764 FIX df.include: Fixed dynamic levels in ruleset 'Filesystem (used space and
growth)'
When configuring dynamic levels, eg. for filesystems, if you configure
the dynamic levels for example like this:
larger than 100GB: 90% WARN / 95% CRIT
larger than 1TB: 95% WARN / 98% CRIT
This will result in all filesystems smaller than 100GB in always being OK.
If you also want to set levels for all filesystems smaller than 100GB
then you have to choose 0 bytes, eg.
larger than 0B: 85% WARN / 90% CRIT
With werk 2725 this was not allowed any more. Fixed that.
Change-Id: I2fb4bdf0911f22b48df0bfc925f0393db0e9f71c
---
.werks/5764 | 23 +++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 6 +++---
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/.werks/5764 b/.werks/5764
new file mode 100644
index 0000000..58e096e
--- /dev/null
+++ b/.werks/5764
@@ -0,0 +1,23 @@
+Title: df.include: Fixed dynamic levels in ruleset 'Filesystem (used space and
growth)'
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i3
+Date: 1518165866
+
+When configuring dynamic levels, eg. for filesystems, if you configure
+the dynamic levels for example like this:
+
+larger than 100GB: 90% WARN / 95% CRIT
+larger than 1TB: 95% WARN / 98% CRIT
+
+This will result in all filesystems smaller than 100GB in always being OK.
+If you also want to set levels for all filesystems smaller than 100GB
+then you have to choose 0 bytes, eg.
+
+larger than 0B: 85% WARN / 90% CRIT
+
+With werk 2725 this was not allowed any more. Fixed that.
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 5e12d3e..3d024e8 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -7377,9 +7377,9 @@ def get_free_used_dynamic_valuespec(what, name, default_value =
(80.0, 90.0)):
]
def validate_dynamic_levels(value, varprefix):
- if [ v for v in value if v[0] == 0 ]:
- raise MKUserError(varprefix, _("You need to specify levels for "
- "%ss larger than 0 bytes.") % name)
+ if [ v for v in value if v[0] < 0 ]:
+ raise MKUserError(varprefix, _("You need to specify levels "
+ "of at least 0 bytes."))
return Alternative(
title = _("Levels for %s %s") % (name, title),