diff options
Diffstat (limited to 'plugins/check_tcp.c')
-rw-r--r-- | plugins/check_tcp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index 0a6e2b27..f75c523c 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c | |||
@@ -32,13 +32,12 @@ char *progname; | |||
32 | const char *copyright = "1999-2008"; | 32 | const char *copyright = "1999-2008"; |
33 | const char *email = "devel@monitoring-plugins.org"; | 33 | const char *email = "devel@monitoring-plugins.org"; |
34 | 34 | ||
35 | #include <ctype.h> | ||
36 | |||
37 | #include "common.h" | 35 | #include "common.h" |
38 | #include "netutils.h" | 36 | #include "netutils.h" |
39 | #include "utils.h" | 37 | #include "utils.h" |
40 | #include "utils_tcp.h" | 38 | #include "utils_tcp.h" |
41 | 39 | ||
40 | #include <ctype.h> | ||
42 | #include <sys/select.h> | 41 | #include <sys/select.h> |
43 | 42 | ||
44 | #ifdef HAVE_SSL | 43 | #ifdef HAVE_SSL |
@@ -354,8 +353,13 @@ main (int argc, char **argv) | |||
354 | printf("Unexpected response from host/socket on "); | 353 | printf("Unexpected response from host/socket on "); |
355 | else | 354 | else |
356 | printf("%.3f second response time on ", elapsed_time); | 355 | printf("%.3f second response time on ", elapsed_time); |
357 | if(server_address[0] != '/') | 356 | if(server_address[0] != '/') { |
358 | printf("port %d", server_port); | 357 | if (host_specified) |
358 | printf("%s port %d", | ||
359 | server_address, server_port); | ||
360 | else | ||
361 | printf("port %d", server_port); | ||
362 | } | ||
359 | else | 363 | else |
360 | printf("socket %s", server_address); | 364 | printf("socket %s", server_address); |
361 | } | 365 | } |