Package: monit
Version: 1:4.5-1
Severity: normal
Tags: patch
I use monit to monitor a pool of my real ntp servers in an lvs cluster.
>From time to time a server or two start answering with leap indicator set to
>+1.
Monit counts this as an error and, using my config file settings,
removes the server from the lvs pool.
I can check the server by other means (ntpdate, ntpdc) and see it is ok
and still can serve clients.
If my understanding of ntp leap indicator meaning and usage is correct,
fully functional ntp servers can set leap indicator bits to 01 or 10,
and more, this warning is propagated downstream, so every ntp server
synchronized to a pool.ntp.org, for example, can and will be affected
form time to time.
Included patch limits error condition to 11, that I believe means
"not synchronized".
-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-386
Locale: LANG=pl_PL, LC_CTYPE=pl_PL (charmap=ISO-8859-2)
Versions of packages monit depends on:
ii libc6 2.3.2.ds1-22 GNU C Library: Shared libraries an
ii libssl0.9.7 0.9.7e-3sarge1 SSL shared libraries
-- no debconf information
diff -u -r monit-4.5/protocols/ntp3.c monit-4.5-ntp3-patch/protocols/ntp3.c
--- monit-4.5/protocols/ntp3.c 2005-02-03 22:13:35.000000000 +0100
+++ monit-4.5-ntp3-patch/protocols/ntp3.c 2006-02-09 14:37:22.280934008
+0100
@@ -103,14 +103,14 @@
bits 2-4 ... Version Number
bits 5-7 ... Mode
*/
- if( ntpResponse[0] !=
+ if( ( ntpResponse[0] & 0x3f ) !=
(
- (NTP_LEAP_NOWARN << 6)
- |
(NTP_VERSION << 3)
|
(NTP_MODE_SERVER)
)
+ || ( ntpResponse[0] & 0xc0 ) ==
+ (NTP_LEAP_NOTSYNC << 6)
)
{
log("NTP: Server response error\n");