aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_tcp.c
diff options
context:
space:
mode:
authorGravatar Jan Wagner <waja@cyconet.org> 2014-06-30 15:02:38 +0200
committerGravatar Jan Wagner <waja@cyconet.org> 2014-06-30 15:13:39 +0200
commitb62f2c14fbcec04c021774a9fe0275e395d9eecc (patch)
tree24233f99298d32314602a1283dcecbcf9ce35a58 /plugins/check_tcp.c
parented914472e92157ef8a304d8c2916058f24c7c964 (diff)
parent4277f47bffb65bafeb9b8e256dd7116ce747e850 (diff)
downloadmonitoring-plugins-b62f2c14fbcec04c021774a9fe0275e395d9eecc.tar.gz
Merge PR #1265 from waja/check_tcp_server_addr
Diffstat (limited to 'plugins/check_tcp.c')
-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 ebdccd1b..bd7736b5 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -353,8 +353,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("%s port %d",
+ server_address, server_port);
+ else
+ printf("port %d", server_port);
+ }
else
printf("socket %s", server_address);
}