Module: check_mk
Branch: master
Commit: a145684d558c5abf5e96924e1284881c04cd1590
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a145684d558c5a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Mar 13 10:08:29 2019 +0100
7238 FIX check_smtp: Float warning / critical thresholds can now be configured using the
GUI
The active check check_smtp already supported floating point warning and critical
thresholds, but the GUI only accepted integral numbers.
Change-Id: I89f5eaad50bb69c6bc2d952363c7df9456ff63c2
---
.werks/7238 | 12 ++++++++++++
checks/check_smtp | 2 +-
cmk/gui/plugins/wato/active_checks.py | 22 ++++++++++++++++++----
3 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/.werks/7238 b/.werks/7238
new file mode 100644
index 0000000..4585c89
--- /dev/null
+++ b/.werks/7238
@@ -0,0 +1,12 @@
+Title: check_smtp: Float warning / critical thresholds can now be configured using the
GUI
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1552466701
+
+The active check check_smtp already supported floating point warning and critical
+thresholds, but the GUI only accepted integral numbers.
diff --git a/checks/check_smtp b/checks/check_smtp
index 425ff8c..3ff9da4 100644
--- a/checks/check_smtp
+++ b/checks/check_smtp
@@ -62,7 +62,7 @@ def check_smtp_arguments(params):
args += ' -f %s' % quote_shell_string(settings["from"])
if "response_time" in settings:
- args += ' -w %d -c %d' % (settings["response_time"][0],
settings["response_time"][1])
+ args += ' -w %0.4f -c %0.4f' % (settings["response_time"][0],
settings["response_time"][1])
if "timeout" in settings:
args += ' -t %d' % settings["timeout"]
diff --git a/cmk/gui/plugins/wato/active_checks.py
b/cmk/gui/plugins/wato/active_checks.py
index 6cc087c..34e4003 100644
--- a/cmk/gui/plugins/wato/active_checks.py
+++ b/cmk/gui/plugins/wato/active_checks.py
@@ -1569,15 +1569,29 @@ class RulespecActiveChecksSmtp(HostRulespec):
"SMTP AUTH type to check (default none, only
LOGIN supported)"
),
elements=[
- TextAscii(title=_("Username"), size=12,
allow_empty=False),
- Password(title=_("Password"), size=12,
allow_empty=False),
+ TextAscii(
+ title=_("Username"),
+ size=12,
+ allow_empty=False,
+ ),
+ Password(
+ title=_("Password"),
+ size=12,
+ allow_empty=False,
+ ),
])),
("response_time",
Tuple(
title=_("Expected response time"),
elements=[
- Integer(title=_("Warning if above"),
unit=_("sec")),
- Integer(title=_("Critical if above"),
unit=_("sec")),
+ Float(
+ title=_("Warning if above"),
+ unit=_("sec"),
+ ),
+ Float(
+ title=_("Critical if above"),
+ unit=_("sec"),
+ ),
])),
("timeout",
Integer(