1275970Scy/* -*- Mode: Text -*- */ 2275970ScyAutoGen Definitions perlopt; 3275970Scy 4275970Scy//#include copyright.def 5275970Scy#include autogen-version.def 6275970Scy 7275970Scyprog-name = 'ntptrace'; 8275970Scyprog-title = 'Trace peers of an NTP server'; 9275970Scypackage = ntp; 10275970Scy#include version.def 11275970Scyargument = '[host]'; 12275970Scy 13275970Scylong-opts; 14275970Scygnu-usage; 15275970Scy 16275970Scyflag = { 17275970Scy name = numeric; 18275970Scy value = n; 19275970Scy descrip = 'Print IP addresses instead of hostnames'; 20275970Scy doc = <<- _EndOfDoc_ 21275970Scy Output hosts as dotted-quad numeric format rather than converting to 22275970Scy the canonical host names. 23275970Scy _EndOfDoc_; 24275970Scy}; 25275970Scy 26275970Scyflag = { 27275970Scy name = max-hosts; 28275970Scy value = m; 29275970Scy arg-type = number; 30275970Scy arg-default = 99; 31275970Scy descrip = 'Maximum number of peers to trace'; 32275970Scy}; 33275970Scy 34275970Scyflag = { 35275970Scy name = host; 36275970Scy value = r; 37275970Scy arg-type = string; 38275970Scy arg-default = '127.0.0.1'; 39275970Scy descrip = 'Single remote host'; 40275970Scy}; 41275970Scy 42275970Scydoc-section = { 43275970Scy ds-type = 'DESCRIPTION'; 44275970Scy ds-format = 'texi'; 45275970Scy ds-text = <<- _END_PROG_MDOC_DESCRIP 46275970Scy@code{ntptrace} is a perl script that uses the ntpq utility program to follow 47275970Scythe chain of NTP servers from a given host back to the primary time source. For 48275970Scyntptrace to work properly, each of these servers must implement the NTP Control 49275970Scyand Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets. 50275970Scy 51275970ScyIf given no arguments, ntptrace starts with localhost. Here is an example of 52275970Scythe output from ntptrace: 53275970Scy 54275970Scy@example 55275970Scy% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135 56275970Scyserver2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu: 57275970Scystratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB' 58275970Scy@end example 59275970Scy 60275970ScyOn each line, the fields are (left to right): the host name, the host stratum, 61275970Scythe time offset between that host and the local host (as measured by 62275970Scy@code{ntptrace}; this is why it is not always zero for "localhost"), the host 63275970Scysynchronization distance, and (only for stratum-1 servers) the reference clock 64275970ScyID. All times are given in seconds. Note that the stratum is the server hop 65275970Scycount to the primary source, while the synchronization distance is the 66275970Scyestimated error relative to the primary source. These terms are precisely 67275970Scydefined in RFC-1305. 68275970Scy _END_PROG_MDOC_DESCRIP; 69275970Scy}; 70