diff options
Diffstat (limited to 'plugins/check_ntp_time.c')
| -rw-r--r-- | plugins/check_ntp_time.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c index bbcaa0ba..72dffbd8 100644 --- a/plugins/check_ntp_time.c +++ b/plugins/check_ntp_time.c | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | /***************************************************************************** | 1 | /***************************************************************************** |
| 2 | * | 2 | * |
| 3 | * Nagios check_ntp_time plugin | 3 | * Monitoring check_ntp_time plugin |
| 4 | * | 4 | * |
| 5 | * License: GPL | 5 | * License: GPL |
| 6 | * Copyright (c) 2006 Sean Finney <seanius@seanius.net> | 6 | * Copyright (c) 2006 Sean Finney <seanius@seanius.net> |
| 7 | * Copyright (c) 2006-2008 Nagios Plugins Development Team | 7 | * Copyright (c) 2006-2008 Monitoring Plugins Development Team |
| 8 | * | 8 | * |
| 9 | * Description: | 9 | * Description: |
| 10 | * | 10 | * |
| @@ -36,7 +36,7 @@ | |||
| 36 | 36 | ||
| 37 | const char *progname = "check_ntp_time"; | 37 | const char *progname = "check_ntp_time"; |
| 38 | const char *copyright = "2006-2008"; | 38 | const char *copyright = "2006-2008"; |
| 39 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 39 | const char *email = "devel@monitoring-plugins.org"; |
| 40 | 40 | ||
| 41 | #include "common.h" | 41 | #include "common.h" |
| 42 | #include "netutils.h" | 42 | #include "netutils.h" |
| @@ -55,7 +55,9 @@ void print_help (void); | |||
| 55 | void print_usage (void); | 55 | void print_usage (void); |
| 56 | 56 | ||
| 57 | /* number of times to perform each request to get a good average. */ | 57 | /* number of times to perform each request to get a good average. */ |
| 58 | #ifndef AVG_NUM | ||
| 58 | #define AVG_NUM 4 | 59 | #define AVG_NUM 4 |
| 60 | #endif | ||
| 59 | 61 | ||
| 60 | /* max size of control message data */ | 62 | /* max size of control message data */ |
| 61 | #define MAX_CM_SIZE 468 | 63 | #define MAX_CM_SIZE 468 |
| @@ -426,7 +428,7 @@ double offset_request(const char *host, int *status){ | |||
| 426 | } else { | 428 | } else { |
| 427 | /* finally, calculate the average offset */ | 429 | /* finally, calculate the average offset */ |
| 428 | for(i=0; i<servers[best_index].num_responses;i++){ | 430 | for(i=0; i<servers[best_index].num_responses;i++){ |
| 429 | avg_offset+=servers[best_index].offset[j]; | 431 | avg_offset+=servers[best_index].offset[i]; |
| 430 | } | 432 | } |
| 431 | avg_offset/=servers[best_index].num_responses; | 433 | avg_offset/=servers[best_index].num_responses; |
| 432 | } | 434 | } |
| @@ -614,7 +616,7 @@ void print_help(void){ | |||
| 614 | printf (" %s\n", _("Offset to result in warning status (seconds)")); | 616 | printf (" %s\n", _("Offset to result in warning status (seconds)")); |
| 615 | printf (" %s\n", "-c, --critical=THRESHOLD"); | 617 | printf (" %s\n", "-c, --critical=THRESHOLD"); |
| 616 | printf (" %s\n", _("Offset to result in critical status (seconds)")); | 618 | printf (" %s\n", _("Offset to result in critical status (seconds)")); |
| 617 | printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); | 619 | printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); |
| 618 | printf (UT_VERBOSE); | 620 | printf (UT_VERBOSE); |
| 619 | 621 | ||
| 620 | printf("\n"); | 622 | printf("\n"); |
