Cleanups only

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/branches/dermoth_ntp_rework@1842 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
Thomas Guyot-Sionnest 2007-12-04 12:24:48 +00:00
parent 79cc962eb8
commit 084a9b444f
3 changed files with 30 additions and 30 deletions

10
NEWS
View file

@ -9,7 +9,7 @@ This file documents the major additions and syntax changes between releases.
and the offset is unavailable, will return UNKNOWN as well.
NOTE: If jitter thresholds are specified as integers it will return CRITICAL if jitter
is "-1" as the default range starts at 0. See Examples in --help output.
Merge two new checks that deprecates check_ntp: check_ntp_peer and check_ntp_time.
Merge two new checks that deprecates check_ntp: check_ntp_peer and check_ntp_time.
You should read the --help output so see which one is suitable for you. check_ntp_peer
implement stratum thresholds support (feature request #1703823).
@ -17,9 +17,9 @@ This file documents the major additions and syntax changes between releases.
Fix check_http buffer overflow vulnerability when following HTTP redirects
check_http now explicitly asks HTTP/1.1 servers to close the connection
after completion of the response
Check_ldaps' guessing which secure method to use (starttls vs. ssl on connect)
Check_ldaps' guessing which secure method to use (starttls vs. ssl on connect)
is now deprecated. See --help for further information.
Check_disk now calls stat() on all filesystems to check. (Old: only the ones selected using -p)
Check_disk now calls stat() on all filesystems to check. (Old: only the ones selected using -p)
A meaningful error message (eg "Stale NFS Handle") is printed if stat fails.
New check_disk option -L: Only check local filesystems, but call stat() on remote ones, too.
Thus accessibility of remote filesystems can be checked without any threshold comparison.
@ -38,7 +38,7 @@ This file documents the major additions and syntax changes between releases.
Fix possible check_icmp bus errors on some (non-x86/AMD64) platforms
Fix check_smtp's handling of multiple-packet server responses
WARNING: Fix for negate which may break existing commands:
- stop evaluating command line options through shell twice
- stop evaluating command line options through shell twice
- enforce a full path for the command to run
The "negate" utility can now remap custom states
Check_radius now supports radiusclient-ng
@ -113,7 +113,7 @@ This file documents the major additions and syntax changes between releases.
SSL plugins work with gnutls as well as OpenSSL
check_mysql_query added to run arbitrary SQL commands, with threshold checking
libtool now required for development systems
Notice: check_udp (compiled from check_udp.c) will be deprecated in the next release.
Notice: check_udp (compiled from check_udp.c) will be deprecated in the next release.
check_udp2 should be used instead and will be renamed to check_udp
1.4.2

View file

@ -181,7 +181,7 @@ char *extract_value(const char *varlist, const char *name){
char *tmpvarlist=NULL, *tmpkey=NULL, *value=NULL;
int last=0;
/* The following code require a non-empty varlist */
/* The following code require a non-empty varlist */
if(strlen(varlist) == 0)
return NULL;
@ -279,7 +279,7 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji
} while(req.op&REM_MORE);
/* first, let's find out if we have a sync source, or if there are
* at least some candidates. in the case of the latter we'll issue
* at least some candidates. In the latter case we'll issue
* a warning but go ahead with the check on them. */
for (i = 0; i < npeers; i++){
if (PEER_SEL(peers[i].status) >= PEER_INCLUDED){
@ -302,7 +302,7 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji
/* Only query this server if it is the current sync source */
/* If there's no sync.peer, query all candidates and use the best one */
if (PEER_SEL(peers[i].status) >= min_peer_sel){
if(verbose) printf("Getting offset, jitter and stratum for peer %.2x\n", ntohs(peers[i].assoc));
if(verbose) printf("Getting offset, jitter and stratum for peer %.2x\n", ntohs(peers[i].assoc));
asprintf(&data, "");
do{
setup_control_request(&req, OP_READVAR, 2);
@ -335,7 +335,7 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji
getvar = "stratum,offset,dispersion";
i--;
continue;
} else if(strlen(getvar)) {
} else if(strlen(getvar)) {
if(verbose) printf("Server didn't like dispersion either; will retrieve everything\n");
getvar = "";
i--;
@ -541,7 +541,7 @@ char *perfd_stratum (int stratum)
int main(int argc, char *argv[]){
int result, offset_result, stratum;
double offset=0, jitter=0;
double offset=0, jitter=0;
char *result_line, *perfdata_line;
if (process_arguments (argc, argv) == ERROR)
@ -557,11 +557,11 @@ int main(int argc, char *argv[]){
/* set socket timeout */
alarm (socket_timeout);
/* This returns either OK or WARNING (See comment preceeding ntp_request) */
/* This returns either OK or WARNING (See comment preceeding ntp_request) */
result = ntp_request(server_address, &offset, &offset_result, &jitter, &stratum);
if(offset_result == STATE_UNKNOWN) {
/* if there's no sync peer (this overrides ntp_request output): */
/* if there's no sync peer (this overrides ntp_request output): */
result = (quiet == 1 ? STATE_UNKNOWN : STATE_CRITICAL);
} else {
/* Be quiet if there's no candidates either */
@ -602,11 +602,11 @@ int main(int argc, char *argv[]){
}
if (do_jitter) {
asprintf(&result_line, "%s, jitter=%f", result_line, jitter);
asprintf(&perfdata_line, "%s %s", perfdata_line, perfd_jitter(jitter));
asprintf(&perfdata_line, "%s %s", perfdata_line, perfd_jitter(jitter));
}
if (do_stratum) {
asprintf(&result_line, "%s, stratum=%i", result_line, stratum);
asprintf(&perfdata_line, "%s %s", perfdata_line, perfd_stratum(stratum));
asprintf(&perfdata_line, "%s %s", perfdata_line, perfd_stratum(stratum));
}
printf("%s|%s\n", result_line, perfdata_line);
@ -621,11 +621,11 @@ void print_help(void){
printf ("Copyright (c) 2006 Sean Finney\n");
printf (COPYRIGHT, copyright, email);
printf ("%s\n", _("This plugin checks the selected ntp server"));
printf ("\n\n");
printf ("%s\n", _("This plugin checks the selected ntp server"));
printf ("\n\n");
print_usage();
printf (_(UT_HELP_VRSN));
printf (_(UT_HOST_PORT), 'p', "123");
@ -675,7 +675,7 @@ void print_help(void){
void
print_usage(void)
{
printf (_("Usage:"));
printf(" %s -H <host> [-w <warn>] [-c <crit>] [-W <warn>] [-C <crit>]\n", progname);
printf(" [-j <warn>] [-k <crit>] [-v verbose]\n");
printf (_("Usage:"));
printf(" %s -H <host> [-w <warn>] [-c <crit>] [-W <warn>] [-C <crit>]\n", progname);
printf(" [-j <warn>] [-k <crit>] [-v verbose]\n");
}

View file

@ -356,13 +356,13 @@ double offset_request(const char *host, int *status){
ai_tmp = ai_tmp->ai_next;
}
/* now do AVG_NUM checks to each host. we stop before timeout/2 seconds
/* now do AVG_NUM checks to each host. We stop before timeout/2 seconds
* have passed in order to ensure post-processing and jitter time. */
now_time=start_ts=time(NULL);
while(servers_completed<num_hosts && now_time-start_ts <= socket_timeout/2){
/* loop through each server and find each one which hasn't
* been touched in the past second or so and is still lacking
* some responses. for each of these servers, send a new request,
* some responses. For each of these servers, send a new request,
* and update the "waiting" timestamp with the current time. */
one_written=0;
now_time=time(NULL);
@ -586,11 +586,11 @@ void print_help(void){
printf ("Copyright (c) 2006 Sean Finney\n");
printf (COPYRIGHT, copyright, email);
printf ("%s\n", _("This plugin checks the clock offset with the ntp server"));
printf ("\n\n");
printf ("%s\n", _("This plugin checks the clock offset with the ntp server"));
printf ("\n\n");
print_usage();
printf (_(UT_HELP_VRSN));
printf (_(UT_HOST_PORT), 'p', "123");
@ -625,8 +625,8 @@ void print_help(void){
void
print_usage(void)
{
printf (_("Usage:"));
printf(" %s -H <host> [-w <warn>] [-c <crit>] [-W <warn>] [-C <crit>]\n", progname);
printf(" [-j <warn>] [-k <crit>] [-v verbose]\n");
printf (_("Usage:"));
printf(" %s -H <host> [-w <warn>] [-c <crit>] [-W <warn>] [-C <crit>]\n", progname);
printf(" [-j <warn>] [-k <crit>] [-v verbose]\n");
}