aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Davide Madrisan <davide.madrisan@gmail.com> 2014-02-20 13:12:26 +0100
committerGravatar Jan Wagner <waja@cyconet.org> 2014-06-28 20:47:51 +0200
commit4231415878daedefd707a39e54f7b438238908d6 (patch)
tree0ab1894452718bb34dc68d51ea5f5741a9d15d9b
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>
-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 2714961f..0b87d687 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -354,8 +354,13 @@ main (int argc, char **argv)
printf("Unexpected response from host/socket on ");
else
printf("%.3f second response time on ", elapsed_time);
- if(server_address[0] != '/')
- printf("port %d", server_port);
+ if(server_address[0] != '/') {
+ if (host_specified)
+ printf("host %s and port %d",
+ server_address, server_port);
+ else
+ printf("port %d", server_port);
+ }
else
printf("socket %s", server_address);
}