diff options
| author | Davide Madrisan <davide.madrisan@gmail.com> | 2014-02-20 13:12:26 +0100 |
|---|---|---|
| committer | Jan Wagner <waja@cyconet.org> | 2014-06-28 20:47:51 +0200 |
| commit | 4231415878daedefd707a39e54f7b438238908d6 (patch) | |
| tree | 0ab1894452718bb34dc68d51ea5f5741a9d15d9b /plugins | |
| parent | 7508da9360a77c6799e74a8109b768a1b8fbba11 (diff) | |
| download | monitoring-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.c | 9 |
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) | |||
| 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 | } |
