Module: check_mk
Branch: master
Commit: 99d6fb648b8d5ea759cbaf14537a1105dfcf52ce
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=99d6fb648b8d5e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 18 14:47:54 2013 +0100
FIX check_ftp: cleanup configuration via WATO, remove Hostname field
The <tt>check_ftp</tt> active check does not longer need nor allow to
specify a host name. The host name is always present: the host the check is
mapped onto. Also the specification of an alternative host name would not
be consistent with any of the other networking checks.
If you need an FTP check on a specific host then please add that host to
the monitoring. Exceptions can alsway be done via <tt>custom_checks</tt>.
---
.werks/399 | 16 ++++++++++++++++
ChangeLog | 1 +
checks/check_ftp | 9 +++++++--
web/plugins/wato/active_checks.py | 15 +++++----------
4 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/.werks/399 b/.werks/399
new file mode 100644
index 0000000..f2c11d9
--- /dev/null
+++ b/.werks/399
@@ -0,0 +1,16 @@
+Title: check_ftp: cleanup configuration via WATO, remove Hostname field
+Level: 2
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387374334
+Targetversion: future
+
+The <tt>check_ftp</tt> active check does not longer need nor allow to
+specify a host name. The host name is always present: the host the check is
+mapped onto. Also the specification of an alternative host name would not
+be consistent with any of the other networking checks.
+
+If you need an FTP check on a specific host then please add that host to
+the monitoring. Exceptions can alsway be done via <tt>custom_checks</tt>.
diff --git a/ChangeLog b/ChangeLog
index 9758651..f56a379 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -66,6 +66,7 @@
* 0387 FIX: df*: Negative filesystem space levels get a more clear text in check
output...
* 0351 FIX: local: Catch invalid state codes and map to 3 (UNKNOWN)...
* 0397 FIX: mrpe: tolerate performance variable names with spaces...
+ * 0399 FIX: check_ftp: cleanup configuration via WATO, remove Hostname field...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/checks/check_ftp b/checks/check_ftp
index 7200786..99cb288 100644
--- a/checks/check_ftp
+++ b/checks/check_ftp
@@ -25,7 +25,12 @@
# Boston, MA 02110-1301 USA.
def check_ftp_arguments(params):
- host, settings = params
+ if type(params) == tuple:
+ host, settings = params
+ else:
+ host = "$HOSTNAME$"
+ settings = params
+
args = ' -H %s' % quote_shell_string(host)
if "response_time" in settings:
@@ -60,7 +65,7 @@ def check_ftp_arguments(params):
active_check_info['ftp'] = {
"command_line" : '$USER1$/check_ftp $ARG1$',
"argument_function" : check_ftp_arguments,
- "service_description" : lambda args: "FTP %s" % args[0],
+ "service_description" : lambda args: type(args) == tuple and ("FTP
%s" % args[0]) or "FTP",
"has_perfdata" : True,
}
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index 7285211..4372fbd 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -94,14 +94,8 @@ register_rule(group,
register_rule(group,
"active_checks:ftp",
- Tuple(
- title = _("Check FTP Services"),
- elements = [
- TextAscii ( title = _("Hostname"), allow_empty = False,
- help = _("The hostname of the FTP server you want to check.
"
- "It is possible to use $HOSTNAME$.")
- ),
- Dictionary(
+ Transform(
+ Dictionary(
elements = [
( "response_time",
Tuple(
@@ -161,8 +155,9 @@ register_rule(group,
default_value = 30)
),
]),
- ]
- )
+ forth = lambda x: type(x) == tuple and x[1] or x,
+ title = _("Check FTP Service"),
+ )
)