[ntp:questions] Re: Are there any interface for me to use in my project to monitor the NTP status

Ulrich Windl Ulrich.Windl at RZ.Uni-Regensburg.DE
Thu Sep 18 08:10:05 UTC 2003


glin at teknotelecom.com (Gary) writes:

> Hi,
> 
> In our project we use the NTP to sync our machines' clock. Does NTP
> have any API we can use to easily get NTP's status and GPS's reach
> number(377)?

ntpq is the name of the program that uses the API, and the network
protocol is described in the RFC. See the NTP FAQ for sources of
information:

9.4. Where can I find more Information?
                                                                                
There are various sources of information about NTP. The following list is
definitely not complete, but probably a good starting point:
                                                                                
  * Although intended for Solaris, the material mentioned in footnote [8] for
    Q: 8.3.7.1. is a good introduction for system administrators.
                                                                                
  * The traditional NTP home page is located at http://www.eecis.udel.edu/~ntp.
    There you can find a lot of information about NTP and related topics. You
    will also find a collection of news articles that are indexed. That
    collection is also known as pseudo FAQ.
                                                                                
  * There is also a newer link http://www.ntp.org/ that currently is redirected
    to the one mentioned before.
                                                                                
  * One of the oldest sources of useful information is the newsgroup news://
    comp.protocols.time.ntp. That newsgroup is visited by many beginners as
    well as a few experts, and occasionally even the father of NTP will post a
    note there.
                                                                                
  * The page http://www.ijs.si/time/ (Time, with focus on NTP and Slovenia)
    contains a good summary of time synchronization using NTP as well as
    valuable references.[1]
                                                                                
  * Several technical papers by Professor David L. Mills are available at http:
    //www.eecis.udel.edu/~mills/papers.htm.
                                                                                
  * Various RFCs deal with NTP. While newer RFCs obsolete older ones, it might
    still be interesting to read the older ones. Specifically there are
    PostScript versions with figures available.
                                                                                
    Table 4. RFCs related to NTP
                                                                                
    +-------------------------------------------------------------------------+
    |RFC   |Date     |Title or Description                                    |
    |Number|         |                                                        |
    |------+---------+--------------------------------------------------------|
    |956   |September|Algorithms for synchronizing network clocks             |
    |      |1985     |                                                        |
    |------+---------+--------------------------------------------------------|
    |957   |September|Experiments in network clock synchronization            |
    |      |1985     |                                                        |
    |------+---------+--------------------------------------------------------|
    |958   |September|Network Time Protocol (NTP)                             |
    |      |1985     |                                                        |
    |------+---------+--------------------------------------------------------|
    |1059  |July 1988|Network Time Protocol (version 1) - specification and   |
    |      |         |implementation                                          |
    |------+---------+--------------------------------------------------------|
    |1119  |September|Network Time Protocol (version 2) - specification and   |
    |      |1989     |implementation                                          |
    |------+---------+--------------------------------------------------------|
    |1305  |March    |Network Time Protocol (Version 3) - Specification,      |
    |      |1992     |Implementation and Analysis                             |
    |------+---------+--------------------------------------------------------|
    |1589  |March    |A Kernel Model for Precision Timekeeping                |
    |      |1994     |                                                        |
    |------+---------+--------------------------------------------------------|
    |2030  |October  |Simple Network Time Protocol (SNTP) version 4 for IPv4, |
    |      |1996     |IPv6 and OSI. Obsoletes [RFC 1361] and [RFC 1769])      |
    |------+---------+--------------------------------------------------------|
    |2783  |March    |Pulse-Per-Second API for UNIX-like Operating Systems,   |
    |      |2000     |Version 1.0                                             |
    +-------------------------------------------------------------------------+
                                                                               
(w3m -no-mouse -no-graph \
 http://www.ntp.org/ntpfaq/NTP-s-related.htm#Q-RELATED-MORE-INFO)

Regards,
Ulrich

> 
> We do not want to generate the loopfile to do that. We want to have
> something like windows does:
> void GetSystemTime(LPSYSTEMTIME lpSystemTime); (windows API)
>  
> so that we are able to call some functions to get the NTP status.
> 
> Thanks for your help
> 
> Gary



More information about the questions mailing list