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; const char *copyright = "1999-2008"; const char *email = "devel@monitoring-plugins.org"; -#include <ctype.h> - #include "common.h" #include "netutils.h" #include "utils.h" #include "utils_tcp.h" +#include <ctype.h> #include <sys/select.h> #ifdef HAVE_SSL @@ -354,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); } |