Module: check_mk
Branch: master
Commit: 1f8dc39436beb14837c2e3b6731f3fe087e2f921
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1f8dc39436beb1…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Oct 16 16:15:29 2013 +0200
check_tcp: Now able to set custom service description
---
ChangeLog | 1 +
checks/check_tcp | 2 +-
web/plugins/wato/active_checks.py | 6 ++++++
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 6525e3e..3110be6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,7 @@
* steelhead_perrs: New check for Rivergate Gateways
* alcatel_power: Check for power supplies on Alcatel switches
* qnap_disks: New check for Hardisks in Qnap devices
+ * check_tcp: Now able to set custom service description
WATO:
* You can now have site-specific global settings when using
diff --git a/checks/check_tcp b/checks/check_tcp
index c491171..8c4d780 100644
--- a/checks/check_tcp
+++ b/checks/check_tcp
@@ -84,7 +84,7 @@ def check_tcp_arguments(params):
active_check_info['tcp'] = {
"command_line" : '$USER1$/check_tcp $ARG1$',
"argument_function" : check_tcp_arguments,
- "service_description" : lambda args: "TCP Port %d" % args[0],
+ "service_description" : lambda args:
args[1].get("svc_description", "TCP Port %d" % args[0]),
"has_perfdata" : True,
}
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index c25ccc7..52d46d2 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -239,6 +239,12 @@ register_rule(group,
help = _("If you specify a hostname here, then a dynamic
DNS lookup "
"will be done instead of using the IP address of
the host "
"as configured in your host properties."))),
+ ( "svc_description",
+ TextAscii(
+ title = _("Custom service description"),
+ allow_empty = False,
+ help = _("Here you can specify a custom service
description. "
+ "If this parameter is not set the service is named
<tt>TCP Port {Portnumber}</tt>"))),
( "response_time",
Tuple(
title = _("Expected response time"),