xref: /freebsd/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi (revision a03411e84728e9b267056fd31c7d1d9d1dc1b01e)
1@node ntptrace Invocation
2@section Invoking ntptrace
3@pindex ntptrace
4@cindex Trace peers of an NTP server
5@ignore
6#
7# EDIT THIS FILE WITH CAUTION  (invoke-ntptrace.texi)
8#
9# It has been AutoGen-ed  June  6, 2023 at 04:39:27 AM by AutoGen 5.18.16
10# From the definitions    ntptrace-opts.def
11# and the template file   agtexi-cmd.tpl
12@end ignore
13
14@code{ntptrace} is a perl script that uses the ntpq utility program to follow
15the chain of NTP servers from a given host back to the primary time source. For
16ntptrace to work properly, each of these servers must implement the NTP Control
17and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
18
19If given no arguments, ntptrace starts with localhost. Here is an example of
20the output from ntptrace:
21
22@example
23% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
24server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
25stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
26@end example
27
28On each line, the fields are (left to right): the host name, the host stratum,
29the time offset between that host and the local host (as measured by
30@code{ntptrace}; this is why it is not always zero for "localhost"), the host
31synchronization distance, and (only for stratum-1 servers) the reference clock
32ID. All times are given in seconds. Note that the stratum is the server hop
33count to the primary source, while the synchronization distance is the
34estimated error relative to the primary source. These terms are precisely
35defined in RFC-1305.
36
37
38This section was generated by @strong{AutoGen},
39using the @code{agtexi-cmd} template and the option descriptions for the @code{ntptrace} program.
40
41@menu
42* ntptrace usage::                  ntptrace help/usage (@option{--help})
43* ntptrace numeric::                numeric option (-n)
44* ntptrace max-hosts::              max-hosts option (-m)
45* ntptrace host::                   host option (-r)
46* ntptrace exit status::            exit status
47@end menu
48
49@node ntptrace usage
50@subsection ntptrace help/usage (@option{--help})
51@cindex ntptrace help
52
53This is the automatically generated usage text for ntptrace.
54
55The text printed is the same whether selected with the @code{help} option
56(@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
57the usage text by passing it through a pager program.
58@code{more-help} is disabled on platforms without a working
59@code{fork(2)} function.  The @code{PAGER} environment variable is
60used to select the program, defaulting to @file{more}.  Both will exit
61with a status code of 0.
62
63@exampleindent 0
64@example
65ntptrace - Trace peers of an NTP server - Ver. 4.2.8p17
66USAGE: ntptrace [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [host]
67
68    -n, --numeric                Print IP addresses instead of hostnames
69    -m, --max-hosts=num          Maximum number of peers to trace
70    -r, --host=str               Single remote host
71    -?, --help                   Display usage information and exit
72        --more-help              Pass the extended usage text through a pager
73
74Options are specified by doubled hyphens and their name or by a single
75hyphen and the flag character.
76@end example
77@exampleindent 4
78
79@node ntptrace numeric
80@subsection numeric option (-n)
81@cindex ntptrace-numeric
82
83This is the ``print ip addresses instead of hostnames'' option.
84Output hosts as dotted-quad numeric format rather than converting to
85the canonical host names.
86@node ntptrace max-hosts
87@subsection max-hosts option (-m)
88@cindex ntptrace-max-hosts
89
90This is the ``maximum number of peers to trace'' option.
91This option takes a number argument.
92This option has no @samp{doc} documentation.
93@node ntptrace host
94@subsection host option (-r)
95@cindex ntptrace-host
96
97This is the ``single remote host'' option.
98This option takes a string argument.
99This option has no @samp{doc} documentation.
100@node ntptrace exit status
101@subsection ntptrace exit status
102
103One of the following exit values will be returned:
104@table @samp
105@item 0 (EXIT_SUCCESS)
106Successful program execution.
107@item 1 (EXIT_FAILURE)
108The operation failed or the command syntax was not valid.
109@end table
110