summaryrefslogtreecommitdiffstats
path: root/plugins/check_ntp_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_ntp_time.c')
-rw-r--r--plugins/check_ntp_time.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c
index d543d6b..bbcaa0b 100644
--- a/plugins/check_ntp_time.c
+++ b/plugins/check_ntp_time.c
@@ -344,7 +344,11 @@ double offset_request(const char *host, int *status){
344 die(STATE_UNKNOWN, "can not create new socket"); 344 die(STATE_UNKNOWN, "can not create new socket");
345 } 345 }
346 if(connect(socklist[i], ai_tmp->ai_addr, ai_tmp->ai_addrlen)){ 346 if(connect(socklist[i], ai_tmp->ai_addr, ai_tmp->ai_addrlen)){
347 die(STATE_UNKNOWN, "can't create socket connection"); 347 /* don't die here, because it is enough if there is one server
348 answering in time. This also would break for dual ipv4/6 stacked
349 ntp servers when the client only supports on of them.
350 */
351 DBG(printf("can't create socket connection on peer %i: %s\n", i, strerror(errno)));
348 } else { 352 } else {
349 ufds[i].fd=socklist[i]; 353 ufds[i].fd=socklist[i];
350 ufds[i].events=POLLIN; 354 ufds[i].events=POLLIN;
@@ -602,6 +606,7 @@ void print_help(void){
602 print_usage(); 606 print_usage();
603 printf (UT_HELP_VRSN); 607 printf (UT_HELP_VRSN);
604 printf (UT_EXTRA_OPTS); 608 printf (UT_EXTRA_OPTS);
609 printf (UT_IPv46);
605 printf (UT_HOST_PORT, 'p', "123"); 610 printf (UT_HOST_PORT, 'p', "123");
606 printf (" %s\n", "-q, --quiet"); 611 printf (" %s\n", "-q, --quiet");
607 printf (" %s\n", _("Returns UNKNOWN instead of CRITICAL if offset cannot be found")); 612 printf (" %s\n", _("Returns UNKNOWN instead of CRITICAL if offset cannot be found"));
@@ -635,6 +640,6 @@ void
635print_usage(void) 640print_usage(void)
636{ 641{
637 printf ("%s\n", _("Usage:")); 642 printf ("%s\n", _("Usage:"));
638 printf(" %s -H <host> [-w <warn>] [-c <crit>] [-v verbose]\n", progname); 643 printf(" %s -H <host> [-4|-6] [-w <warn>] [-c <crit>] [-v verbose]\n", progname);
639} 644}
640 645