1275970Scy@node ntptrace Invocation
2275970Scy@section Invoking ntptrace
3275970Scy@pindex ntptrace
4275970Scy@cindex Trace peers of an NTP server
5275970Scy@ignore
6275970Scy#
7275970Scy# EDIT THIS FILE WITH CAUTION  (invoke-ntptrace.texi)
8275970Scy#
9362716Scy# It has been AutoGen-ed  June 23, 2020 at 02:21:39 AM by AutoGen 5.18.5
10275970Scy# From the definitions    ntptrace-opts.def
11275970Scy# and the template file   agtexi-cmd.tpl
12275970Scy@end ignore
13275970Scy
14275970Scy@code{ntptrace} is a perl script that uses the ntpq utility program to follow
15275970Scythe chain of NTP servers from a given host back to the primary time source. For
16275970Scyntptrace to work properly, each of these servers must implement the NTP Control
17275970Scyand Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
18275970Scy
19275970ScyIf given no arguments, ntptrace starts with localhost. Here is an example of
20275970Scythe output from ntptrace:
21275970Scy
22275970Scy@example
23275970Scy% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
24275970Scyserver2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
25275970Scystratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
26275970Scy@end example
27275970Scy
28275970ScyOn each line, the fields are (left to right): the host name, the host stratum,
29275970Scythe time offset between that host and the local host (as measured by
30275970Scy@code{ntptrace}; this is why it is not always zero for "localhost"), the host
31275970Scysynchronization distance, and (only for stratum-1 servers) the reference clock
32275970ScyID. All times are given in seconds. Note that the stratum is the server hop
33275970Scycount to the primary source, while the synchronization distance is the
34275970Scyestimated error relative to the primary source. These terms are precisely
35275970Scydefined in RFC-1305.
36275970Scy
37275970Scy
38275970ScyThis section was generated by @strong{AutoGen},
39275970Scyusing the @code{agtexi-cmd} template and the option descriptions for the @code{ntptrace} program.
40275970Scy
41275970Scy@menu
42275970Scy* ntptrace usage::                  ntptrace help/usage (@option{--help})
43275970Scy* ntptrace numeric::                numeric option (-n)
44275970Scy* ntptrace max-hosts::              max-hosts option (-m)
45275970Scy* ntptrace host::                   host option (-r)
46275970Scy* ntptrace exit status::            exit status
47275970Scy@end menu
48275970Scy
49275970Scy@node ntptrace usage
50275970Scy@subsection ntptrace help/usage (@option{--help})
51275970Scy@cindex ntptrace help
52275970Scy
53275970ScyThis is the automatically generated usage text for ntptrace.
54275970Scy
55275970ScyThe text printed is the same whether selected with the @code{help} option
56275970Scy(@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
57275970Scythe usage text by passing it through a pager program.
58275970Scy@code{more-help} is disabled on platforms without a working
59275970Scy@code{fork(2)} function.  The @code{PAGER} environment variable is
60275970Scyused to select the program, defaulting to @file{more}.  Both will exit
61275970Scywith a status code of 0.
62275970Scy
63275970Scy@exampleindent 0
64275970Scy@example
65362716Scyntptrace - Trace peers of an NTP server - Ver. 4.2.8p15
66275970ScyUSAGE: ntptrace [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [host]
67275970Scy
68275970Scy    -n, --numeric                Print IP addresses instead of hostnames
69275970Scy    -m, --max-hosts=num          Maximum number of peers to trace
70275970Scy    -r, --host=str               Single remote host
71275970Scy    -?, --help                   Display usage information and exit
72275970Scy        --more-help              Pass the extended usage text through a pager
73275970Scy
74275970ScyOptions are specified by doubled hyphens and their name or by a single
75275970Scyhyphen and the flag character.
76275970Scy@end example
77275970Scy@exampleindent 4
78275970Scy
79275970Scy@node ntptrace numeric
80275970Scy@subsection numeric option (-n)
81275970Scy@cindex ntptrace-numeric
82275970Scy
83275970ScyThis is the ``print ip addresses instead of hostnames'' option.
84275970ScyOutput hosts as dotted-quad numeric format rather than converting to
85275970Scythe canonical host names.
86275970Scy@node ntptrace max-hosts
87275970Scy@subsection max-hosts option (-m)
88275970Scy@cindex ntptrace-max-hosts
89275970Scy
90275970ScyThis is the ``maximum number of peers to trace'' option.
91275970ScyThis option takes a number argument.
92275970ScyThis option has no @samp{doc} documentation.
93275970Scy@node ntptrace host
94275970Scy@subsection host option (-r)
95275970Scy@cindex ntptrace-host
96275970Scy
97275970ScyThis is the ``single remote host'' option.
98275970ScyThis option takes a string argument.
99275970ScyThis option has no @samp{doc} documentation.
100275970Scy@node ntptrace exit status
101275970Scy@subsection ntptrace exit status
102275970Scy
103275970ScyOne of the following exit values will be returned:
104275970Scy@table @samp
105275970Scy@item 0 (EXIT_SUCCESS)
106275970ScySuccessful program execution.
107275970Scy@item 1 (EXIT_FAILURE)
108275970ScyThe operation failed or the command syntax was not valid.
109275970Scy@end table
110