summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorDavide Madrisan <davide.madrisan@gmail.com>2014-02-20 12:12:26 (GMT)
committerJan Wagner <waja@cyconet.org>2014-06-28 18:47:51 (GMT)
commit4231415878daedefd707a39e54f7b438238908d6 (patch)
tree0ab1894452718bb34dc68d51ea5f5741a9d15d9b /plugins
parent7508da9360a77c6799e74a8109b768a1b8fbba11 (diff)
downloadmonitoring-plugins-4231415878daedefd707a39e54f7b438238908d6.tar.gz
check_tcp: also display the server addr when host_specified is set. This will help the admins when multiple checks are configured
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_tcp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 2714961..0b87d68 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -354,8 +354,13 @@ main (int argc, char **argv)
354 printf("Unexpected response from host/socket on "); 354 printf("Unexpected response from host/socket on ");
355 else 355 else
356 printf("%.3f second response time on ", elapsed_time); 356 printf("%.3f second response time on ", elapsed_time);
357 if(server_address[0] != '/') 357 if(server_address[0] != '/') {
358 printf("port %d", server_port); 358 if (host_specified)
359 printf("host %s and port %d",
360 server_address, server_port);
361 else
362 printf("port %d", server_port);
363 }
359 else 364 else
360 printf("socket %s", server_address); 365 printf("socket %s", server_address);
361 } 366 }