@node ntptrace Invocation
@section Invoking ntptrace
@pindex ntptrace
@cindex Trace peers of an NTP server
@ignore
#
# EDIT THIS FILE WITH CAUTION (invoke-ntptrace.texi)
#
# It has been AutoGen-ed June 23, 2020 at 02:21:39 AM by AutoGen 5.18.5
# From the definitions ntptrace-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@code{ntptrace} is a perl script that uses the ntpq utility program to follow
the chain of NTP servers from a given host back to the primary time source. For
ntptrace to work properly, each of these servers must implement the NTP Control
and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
If given no arguments, ntptrace starts with localhost. Here is an example of
the output from ntptrace:
@example
% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
@end example
On each line, the fields are (left to right): the host name, the host stratum,
the time offset between that host and the local host (as measured by
@code{ntptrace}; this is why it is not always zero for "localhost"), the host
synchronization distance, and (only for stratum-1 servers) the reference clock
ID. All times are given in seconds. Note that the stratum is the server hop
count to the primary source, while the synchronization distance is the
estimated error relative to the primary source. These terms are precisely
defined in RFC-1305.
This section was generated by @strong{AutoGen},
using the @code{agtexi-cmd} template and the option descriptions for the @code{ntptrace} program.
@menu
* ntptrace usage:: ntptrace help/usage (@option{--help})
* ntptrace numeric:: numeric option (-n)
* ntptrace max-hosts:: max-hosts option (-m)
* ntptrace host:: host option (-r)
* ntptrace exit status:: exit status
@end menu
@node ntptrace usage
@subsection ntptrace help/usage (@option{--help})
@cindex ntptrace help
This is the automatically generated usage text for ntptrace.
The text printed is the same whether selected with the @code{help} option
(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
the usage text by passing it through a pager program.
@code{more-help} is disabled on platforms without a working
@code{fork(2)} function. The @code{PAGER} environment variable is
used to select the program, defaulting to @file{more}. Both will exit
with a status code of 0.
@exampleindent 0
@example
ntptrace - Trace peers of an NTP server - Ver. 4.2.8p15
USAGE: ntptrace [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [host]
-n, --numeric Print IP addresses instead of hostnames
-m, --max-hosts=num Maximum number of peers to trace
-r, --host=str Single remote host
-?, --help Display usage information and exit
--more-help Pass the extended usage text through a pager
Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.
@end example
@exampleindent 4
@node ntptrace numeric
@subsection numeric option (-n)
@cindex ntptrace-numeric
This is the ``print ip addresses instead of hostnames'' option.
Output hosts as dotted-quad numeric format rather than converting to
the canonical host names.
@node ntptrace max-hosts
@subsection max-hosts option (-m)
@cindex ntptrace-max-hosts
This is the ``maximum number of peers to trace'' option.
This option takes a number argument.
This option has no @samp{doc} documentation.
@node ntptrace host
@subsection host option (-r)
@cindex ntptrace-host
This is the ``single remote host'' option.
This option takes a string argument.
This option has no @samp{doc} documentation.
@node ntptrace exit status
@subsection ntptrace exit status
One of the following exit values will be returned:
@table @samp
@item 0 (EXIT_SUCCESS)
Successful program execution.
@item 1 (EXIT_FAILURE)
The operation failed or the command syntax was not valid.
@end table