summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e6d1efc)
raw | patch | inline | side by side (parent: e6d1efc)
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Wed, 26 Sep 2007 04:16:21 +0000 (04:16 +0000) | ||
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Wed, 26 Sep 2007 04:16:21 +0000 (04:16 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1799 f882894a-f735-0410-b71e-b25c423dba1c
NEWS | patch | blob | history | |
THANKS.in | patch | blob | history | |
plugins/check_ntp.c | patch | blob | history |
index ffff548f0fc0b36747308f70d769fdda7b461769..5d950ba7948edf3077baa4f4bee2559cc5571e7c 100644 (file)
--- a/NEWS
+++ b/NEWS
Check_radius now supports radiusclient-ng
Check_by_ssh now supports multiline output
IPv6 support can now be disabled using ./configure --without-ipv6
+ Fix check_ntp now honor ntp flags
1.4.9 4th June 2006
Inclusion of contrib/check_cluster2 as check_cluster with some improvements
diff --git a/THANKS.in b/THANKS.in
index f6fe94175d22961f6d266c06a34ef7cf45635b0b..cef2a77aec9fdac32828bc3b5804bb715e3f6ffc 100644 (file)
--- a/THANKS.in
+++ b/THANKS.in
Andrew Elwell
Heiti Ernits
Sebastien Guay
+MAtteo HCE Valsasna
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index 28c23d84309895e7bdef7f30cd192e6e9a1f75c5..abd254c8670960fb0956efb6b5de081507c6429a 100644 (file)
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
double rtdelay; /* converted from the ntp_message */
double rtdisp; /* converted from the ntp_message */
double offset[AVG_NUM]; /* offsets from each response */
+ uint8_t flags; /* byte with leapindicator,vers,mode. see macros */
} ntp_server_results;
/* this structure holds everything in an ntp control message as per rfc1305 */
/* for each server */
for(cserver=0; cserver<nservers; cserver++){
+ /* sort out servers with error flags */
+ if ( LI(slist[cserver].flags) != LI_NOWARNING ){
+ if (verbose) printf("discarding peer id %d: flags=%d\n", cserver, LI(slist[cserver].flags));
+ break;
+ }
+
/* compare it to each of the servers already in the candidate list */
for(i=0; i<csize; i++){
/* does it have an equal or better stratum? */
servers[i].rtdisp=NTP32asDOUBLE(req[i].rtdisp);
servers[i].rtdelay=NTP32asDOUBLE(req[i].rtdelay);
servers[i].waiting=0;
+ servers[i].flags=req[i].flags;
servers_readable--;
one_read = 1;
if(servers[i].num_responses==AVG_NUM) servers_completed++;
}
if(offset_result==STATE_CRITICAL){
asprintf(&result_line, "%s %s", result_line, _("Offset unknown"));
+ asprintf(&perfdata_line, "");
} else {
if(offset_result==STATE_WARNING){
asprintf(&result_line, "%s %s", result_line, _("Unable to fully sample sync server"));