[ntp:questions] Synchronization and Non-Synchronization status

Jaiprabhu jaiprabhu at somewhere.in.this.world
Sat Feb 20 00:36:20 UTC 2010

Steve Kostecke wrote:
> On 2010-02-19, Jaiprabhu <jaiprabhu at somewhere.in.this.world> wrote:
>> Jaiprabhu wrote:
>>> Many thanks.
>> Anyone?
> ???
>> The thing I am most interested in resolving is, in which part of NTPd,
>> and how, can I determine that there are no valid peers left (either
>> they are unreachable or are not reliable servers) and therefore
>> determine the current global synchronization status to be "not-sync".
>> One of ideas I am toying with is to edit ntp_proto.c and going through
>> the list of all configured servers at the end of clock_select() and
>> verifying that at least one of the servers is a sys.peer. If not,
>> then I send a signal out to tell whoever is listening that NTP is
>> "not-sync".
>> The option of looking at the billboard every poll interval (excecuting
>> 'ntpq -pe') and looking for the "*" tally code is always present but
>> I would want to avoid this polling mechanism. Instead, I would prefer
>> receiving of the "not-sync" status from withing NTPd itself.
> ntpd already provides a trap mechanism for sending out event
> information. There is an implementation of a trap client in the
> ./scripts directory of the distribution.
> I suggest you take a look at this before you go off and re-invent the
> wheel.

Thanks for the suggestion Steve.

The trap utility would not be very usable for me. For one thing we do 
not have perl on the systems we are working with. Secondly, and please 
correct me if I am wrong, I am not sure that it actually generates a 
trap for a sync lost kind of event. What I am looking for is a mechanism 
to detect the event where NTPd goes from a state where it was 
synchronized, to one where it is not-synchronized. To simplify the 
discussion, let's say that not-synchronized means that NTPd is not able 
to determine a sys.peer.


More information about the questions mailing list