X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fcheck_ssh.c;h=3bbf44dc10813c94cf5371d9270085b4d840a811;hb=1bc7a4a198aefde2389c9c1685baed0da7856bf5;hp=b9b8a2d3eeb4898be031fc41f57d0c9f70d814b2;hpb=884aee06674755ef44e4042803ae84a0faac5b10;p=nagiosplug.git diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index b9b8a2d..3bbf44d 100644 --- a/plugins/check_ssh.c +++ b/plugins/check_ssh.c @@ -215,6 +215,10 @@ ssh_connect (char *haddr, int hport, char *remote_version) char *ssh_proto = NULL; char *ssh_server = NULL; static char *rev_no = VERSION; + struct timeval tv; + double elapsed_time; + + gettimeofday(&tv, NULL); result = my_tcp_connect (haddr, hport, &sd); @@ -250,9 +254,12 @@ ssh_connect (char *haddr, int hport, char *remote_version) exit (STATE_WARNING); } + elapsed_time = (double)deltime(tv) / 1.0e6; + printf - (_("SSH OK - %s (protocol %s)\n"), - ssh_server, ssh_proto); + (_("SSH OK - %s (protocol %s) | %s\n"), + ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s", + FALSE, 0, FALSE, 0, TRUE, 0, TRUE, (int)socket_timeout)); close(sd); exit (STATE_OK); } @@ -299,7 +306,7 @@ print_help (void) void print_usage (void) { - printf (_("Usage:")); + printf ("%s\n", _("Usage:")); printf ("%s [-46] [-t ] [-r ] [-p ] \n", progname); }