diff options
Diffstat (limited to 'plugins/check_ntp.c')
| -rw-r--r-- | plugins/check_ntp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 85271267..0a7640a7 100644 --- a/plugins/check_ntp.c +++ b/plugins/check_ntp.c | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | /***************************************************************************** | 1 | /***************************************************************************** |
| 2 | * | 2 | * |
| 3 | * Nagios check_ntp plugin | 3 | * Monitoring check_ntp 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 | * |
| @@ -32,7 +32,7 @@ | |||
| 32 | 32 | ||
| 33 | const char *progname = "check_ntp"; | 33 | const char *progname = "check_ntp"; |
| 34 | const char *copyright = "2006-2008"; | 34 | const char *copyright = "2006-2008"; |
| 35 | const char *email = "devel@nagios-plugins.org"; | 35 | const char *email = "devel@monitoring-plugins.org"; |
| 36 | 36 | ||
| 37 | #include "common.h" | 37 | #include "common.h" |
| 38 | #include "netutils.h" | 38 | #include "netutils.h" |
| @@ -54,7 +54,9 @@ void print_help (void); | |||
| 54 | void print_usage (void); | 54 | void print_usage (void); |
| 55 | 55 | ||
| 56 | /* number of times to perform each request to get a good average. */ | 56 | /* number of times to perform each request to get a good average. */ |
| 57 | #ifndef AVG_NUM | ||
| 57 | #define AVG_NUM 4 | 58 | #define AVG_NUM 4 |
| 59 | #endif | ||
| 58 | 60 | ||
| 59 | /* max size of control message data */ | 61 | /* max size of control message data */ |
| 60 | #define MAX_CM_SIZE 468 | 62 | #define MAX_CM_SIZE 468 |
| @@ -480,7 +482,7 @@ double offset_request(const char *host, int *status){ | |||
| 480 | } else { | 482 | } else { |
| 481 | /* finally, calculate the average offset */ | 483 | /* finally, calculate the average offset */ |
| 482 | for(i=0; i<servers[best_index].num_responses;i++){ | 484 | for(i=0; i<servers[best_index].num_responses;i++){ |
| 483 | avg_offset+=servers[best_index].offset[j]; | 485 | avg_offset+=servers[best_index].offset[i]; |
| 484 | } | 486 | } |
| 485 | avg_offset/=servers[best_index].num_responses; | 487 | avg_offset/=servers[best_index].num_responses; |
| 486 | } | 488 | } |
| @@ -858,7 +860,7 @@ void print_help(void){ | |||
| 858 | printf (" %s\n", _("Warning threshold for jitter")); | 860 | printf (" %s\n", _("Warning threshold for jitter")); |
| 859 | printf (" %s\n", "-k, --jcrit=THRESHOLD"); | 861 | printf (" %s\n", "-k, --jcrit=THRESHOLD"); |
| 860 | printf (" %s\n", _("Critical threshold for jitter")); | 862 | printf (" %s\n", _("Critical threshold for jitter")); |
| 861 | printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); | 863 | printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); |
| 862 | printf (UT_VERBOSE); | 864 | printf (UT_VERBOSE); |
| 863 | 865 | ||
| 864 | printf("\n"); | 866 | printf("\n"); |
