Module: check_mk
Branch: master
Commit: f9dc314289c20c1a5589dc458249596987e67073
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f9dc314289c20c…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Apr 7 14:51:18 2016 +0200
3312 check_ssh: service description can be set
---
.werks/3312 | 9 +++++++++
ChangeLog | 1 +
checks/check_ssh | 11 ++++++++++-
web/plugins/wato/active_checks.py | 4 ++++
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/.werks/3312 b/.werks/3312
new file mode 100644
index 0000000..c08d2bc
--- /dev/null
+++ b/.werks/3312
@@ -0,0 +1,9 @@
+Title: check_ssh: service description can be set
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1460033328
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 77a5276..0b56b60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -47,6 +47,7 @@
* 3109 dotnet_clrmemory: levels are now configurable
* 3311 apc_netbotz_sensors, apc_netbotz_sensors.dewpoint,
apc_netbotz_sensors.humidity: new checks for APC Netbotz devices which support the
NETBOTZV2 MIB
* 3115 logwatch: made check cluster-able...
+ * 3312 check_ssh: service description can be set
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative
to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checks/check_ssh b/checks/check_ssh
index 0e091d4..902e455 100644
--- a/checks/check_ssh
+++ b/checks/check_ssh
@@ -24,6 +24,14 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+
+def check_ssh_desc(params):
+ if params.get("description"):
+ return "SSH %s" % params["description"]
+ else:
+ return "SSH"
+
+
def check_ssh_arguments(params):
args = []
if 'timeout' in params:
@@ -39,10 +47,11 @@ def check_ssh_arguments(params):
return " ".join(args)
+
active_check_info['ssh'] = {
"command_line" : '$USER1$/check_ssh $ARG1$',
"argument_function" : check_ssh_arguments,
- "service_description" : lambda args: "SSH",
+ "service_description" : check_ssh_desc,
"has_perfdata" : True,
}
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index f9677ea..8bf83a2 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -186,6 +186,10 @@ register_rule(group,
title = _("Check SSH service"),
help = _("This rulset allow you to configure a SSH check for a host"),
elements = [
+ ( "description",
+ TextUnicode(
+ title = _("Service Description"),
+ )),
("port",
Integer(
title = _("TCP port number"),