summaryrefslogtreecommitdiffstats
path: root/plugins/check_ntp.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_ntp.c')
-rw-r--r--plugins/check_ntp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index 76d19ba3..16be7c51 100644
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
@@ -398,7 +398,11 @@ double offset_request(const char *host, int *status){
398 die(STATE_UNKNOWN, "can not create new socket"); 398 die(STATE_UNKNOWN, "can not create new socket");
399 } 399 }
400 if(connect(socklist[i], ai_tmp->ai_addr, ai_tmp->ai_addrlen)){ 400 if(connect(socklist[i], ai_tmp->ai_addr, ai_tmp->ai_addrlen)){
401 die(STATE_UNKNOWN, "can't create socket connection"); 401 /* don't die here, because it is enough if there is one server
402 answering in time. This also would break for dual ipv4/6 stacked
403 ntp servers when the client only supports on of them.
404 */
405 DBG(printf("can't create socket connection on peer %i: %s\n", i, strerror(errno)));
402 } else { 406 } else {
403 ufds[i].fd=socklist[i]; 407 ufds[i].fd=socklist[i];
404 ufds[i].events=POLLIN; 408 ufds[i].events=POLLIN;
@@ -845,6 +849,7 @@ void print_help(void){
845 printf (UT_HELP_VRSN); 849 printf (UT_HELP_VRSN);
846 printf (UT_EXTRA_OPTS); 850 printf (UT_EXTRA_OPTS);
847 printf (UT_HOST_PORT, 'p', "123"); 851 printf (UT_HOST_PORT, 'p', "123");
852 printf (UT_IPv46);
848 printf (" %s\n", "-w, --warning=THRESHOLD"); 853 printf (" %s\n", "-w, --warning=THRESHOLD");
849 printf (" %s\n", _("Offset to result in warning status (seconds)")); 854 printf (" %s\n", _("Offset to result in warning status (seconds)"));
850 printf (" %s\n", "-c, --critical=THRESHOLD"); 855 printf (" %s\n", "-c, --critical=THRESHOLD");
@@ -881,5 +886,5 @@ print_usage(void)
881 printf ("%s\n", _("WARNING: check_ntp is deprecated. Please use check_ntp_peer or")); 886 printf ("%s\n", _("WARNING: check_ntp is deprecated. Please use check_ntp_peer or"));
882 printf ("%s\n\n", _("check_ntp_time instead.")); 887 printf ("%s\n\n", _("check_ntp_time instead."));
883 printf ("%s\n", _("Usage:")); 888 printf ("%s\n", _("Usage:"));
884 printf(" %s -H <host> [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-v verbose]\n", progname); 889 printf(" %s -H <host> [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-4|-6] [-v verbose]\n", progname);
885} 890}