[ntp:questions] Synchronization and Non-Synchronization status

Jaiprabhu jaiprabhu at somewhere.in.this.world
Sat Feb 20 19:48:27 UTC 2010

E-Mail Sent to this address will be added to the BlackLists wrote:
> Jaiprabhu wrote:
>> Steve Kostecke wrote:
>>> 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.
> <http://www.cis.udel.edu/~mills/ntp/html/miscopt.html#trap>
>> 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.
> Write one in whatever language you want, for whatever platform you want?
> <http://www.cis.udel.edu/~mills/database/rfc/rfc1305/rfc1305c.pdf>
>  See 2.1. NTP Control Message Format, (Mode 6 packet)
>  Op Code 6 set trap address/port command/response & Op Code 7 trap response

Thanks for the pointer.

>> 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.
>  ... Trap Response (7): This message is sent when a system, peer or clock exception event occurs ...
>    If a system trap the association identifier field is set to zero
>     and the status field contains the system status word.
>    If a peer trap the association identifier field is set to that peer
>     and the status field contains the peer status word.
>    either System Status Word
>      Leap Indicator (LI): 11 alarm condition (clock not synchronized)
>             Clock Source: ...
>        System Event Code:
>                           1 system restart
>                           2 system or hardware fault
>                           3 system new status word (leap bits or synchronization change)
>                           4 system new synchronization source or stratum (sys.peer or sys.stratum change)
>                           5 system clock reset (offset correction exceeds CLOCK.MAX)
>                           6 system invalid time or date (see NTP specification)
>                           7 system clock exception (see system clock status word)
>    or Peer Status Word
>              Peer Status: 3 reachability okay (peer.reach not 0)
>     Peer Selection (Sel): 5 current synchronization source; max distance exceeded
>                           6 current synchronization source; max distance okay
>          Peer Event Code:
>                           1 peer IP error
>                           2 peer authentication failure (peer.authentic bit was one now zero)
>                           3 peer unreachable (peer.reach was nonzero now zero)
>                           4 peer reachable (peer.reach was zero now nonzero)
>                           5 peer clock exception (see peer clock status word)

This helps and I was probably wrong. I think what I am interested in is 
the "System Status Word" because I want the overall state of the system.

I think then even the following can also be added to the list of indicators?

Clock Source: This is a six-bit integer indicating the current 
synchronization source, with values
     coded as follows:

               0        unspecified or unknown

More information about the questions mailing list