aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi
blob: e7c2a2ca391c92566bf5cbd2e102a45f865cacd0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
@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  2, 2016 at 07:25:03 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.8p8
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