xref: /freebsd/contrib/ntp/scripts/ntptrace/ntptrace.html (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
1052d159aSCy Schubert<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2052d159aSCy Schubert<html>
3a466cc55SCy Schubert<!-- Created by GNU Texinfo 6.6, http://www.gnu.org/software/texinfo/ -->
42b15cb3dSCy Schubert<head>
5052d159aSCy Schubert<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6052d159aSCy Schubert<title>Ntptrace User&rsquo;s Manual</title>
7052d159aSCy Schubert
8052d159aSCy Schubert<meta name="description" content="Ntptrace User&rsquo;s Manual">
9052d159aSCy Schubert<meta name="keywords" content="Ntptrace User&rsquo;s Manual">
10052d159aSCy Schubert<meta name="resource-type" content="document">
11052d159aSCy Schubert<meta name="distribution" content="global">
12052d159aSCy Schubert<meta name="Generator" content="makeinfo">
13052d159aSCy Schubert<link href="#Top" rel="start" title="Top">
14052d159aSCy Schubert<link href="dir.html#Top" rel="up" title="(dir)">
15052d159aSCy Schubert<style type="text/css">
16052d159aSCy Schubert<!--
17052d159aSCy Schuberta.summary-letter {text-decoration: none}
18052d159aSCy Schubertblockquote.indentedblock {margin-right: 0em}
19052d159aSCy Schubertdiv.display {margin-left: 3.2em}
20052d159aSCy Schubertdiv.example {margin-left: 3.2em}
21052d159aSCy Schubertdiv.lisp {margin-left: 3.2em}
22052d159aSCy Schubertkbd {font-style: oblique}
232b15cb3dSCy Schubertpre.display {font-family: inherit}
242b15cb3dSCy Schubertpre.format {font-family: inherit}
25052d159aSCy Schubertpre.menu-comment {font-family: serif}
26052d159aSCy Schubertpre.menu-preformatted {font-family: serif}
27052d159aSCy Schubertspan.nolinebreak {white-space: nowrap}
28052d159aSCy Schubertspan.roman {font-family: initial; font-weight: normal}
29052d159aSCy Schubertspan.sansserif {font-family: sans-serif; font-weight: normal}
30052d159aSCy Schubertul.no-bullet {list-style: none}
31052d159aSCy Schubert-->
32052d159aSCy Schubert</style>
33052d159aSCy Schubert
34052d159aSCy Schubert
352b15cb3dSCy Schubert</head>
36052d159aSCy Schubert
37052d159aSCy Schubert<body lang="en">
38052d159aSCy Schubert<h1 class="settitle" align="center">Ntptrace User&rsquo;s Manual</h1>
39052d159aSCy Schubert
40052d159aSCy Schubert
41052d159aSCy Schubert
42052d159aSCy Schubert
43052d159aSCy Schubert
44a466cc55SCy Schubert<span id="Top"></span><div class="header">
45052d159aSCy Schubert<p>
46052d159aSCy SchubertPrevious: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; </p>
472b15cb3dSCy Schubert</div>
48a466cc55SCy Schubert<span id="Simple-Network-Time-Protocol-User-Manual"></span><h1 class="top">Simple Network Time Protocol User Manual</h1>
492b15cb3dSCy Schubert
50052d159aSCy Schubert<p>This document describes the use of the NTP Project&rsquo;s <code>ntptrace</code> program.
51*f5f40dd6SCy SchubertThis document applies to version 4.2.8p18 of <code>ntptrace</code>.
52052d159aSCy Schubert</p>
53a466cc55SCy Schubert<span id="SEC_Overview"></span>
54052d159aSCy Schubert<h2 class="shortcontents-heading">Short Table of Contents</h2>
552b15cb3dSCy Schubert
562b15cb3dSCy Schubert<div class="shortcontents">
57052d159aSCy Schubert<ul class="no-bullet">
58a466cc55SCy Schubert<li><a id="stoc-Invoking-ntptrace" href="#toc-Invoking-ntptrace">1 Invoking ntptrace</a></li>
592b15cb3dSCy Schubert</ul>
602b15cb3dSCy Schubert</div>
612b15cb3dSCy Schubert
622b15cb3dSCy Schubert
63052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
64a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; ntptrace Description</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description
65052d159aSCy Schubert</td></tr>
66a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntptrace-Invocation" accesskey="2">ntptrace Invocation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Invoking ntptrace
67052d159aSCy Schubert</td></tr>
68052d159aSCy Schubert</table>
69052d159aSCy Schubert
70052d159aSCy Schubert<hr>
71a466cc55SCy Schubert<span id="ntptrace-Invocation"></span><div class="header">
72052d159aSCy Schubert<p>
73052d159aSCy SchubertUp: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
742b15cb3dSCy Schubert</div>
75a466cc55SCy Schubert<span id="Invoking-ntptrace"></span><h2 class="chapter">1 Invoking ntptrace</h2>
76a466cc55SCy Schubert<span id="index-ntptrace"></span>
77a466cc55SCy Schubert<span id="index-Trace-peers-of-an-NTP-server"></span>
782b15cb3dSCy Schubert
79052d159aSCy Schubert<p><code>ntptrace</code> is a perl script that uses the ntpq utility program to follow
802b15cb3dSCy Schubertthe chain of NTP servers from a given host back to the primary time source. For
812b15cb3dSCy Schubertntptrace to work properly, each of these servers must implement the NTP Control
822b15cb3dSCy Schubertand Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
83052d159aSCy Schubert</p>
842b15cb3dSCy Schubert<p>If given no arguments, ntptrace starts with localhost. Here is an example of
852b15cb3dSCy Schubertthe output from ntptrace:
86052d159aSCy Schubert</p>
87052d159aSCy Schubert<div class="example">
882b15cb3dSCy Schubert<pre class="example">% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
892b15cb3dSCy Schubertserver2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
902b15cb3dSCy Schubertstratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
91052d159aSCy Schubert</pre></div>
92052d159aSCy Schubert
932b15cb3dSCy Schubert<p>On each line, the fields are (left to right): the host name, the host stratum,
942b15cb3dSCy Schubertthe time offset between that host and the local host (as measured by
95052d159aSCy Schubert<code>ntptrace</code>; this is why it is not always zero for &quot;localhost&quot;), the host
962b15cb3dSCy Schubertsynchronization distance, and (only for stratum-1 servers) the reference clock
972b15cb3dSCy SchubertID. All times are given in seconds. Note that the stratum is the server hop
982b15cb3dSCy Schubertcount to the primary source, while the synchronization distance is the
992b15cb3dSCy Schubertestimated error relative to the primary source. These terms are precisely
1002b15cb3dSCy Schubertdefined in RFC-1305.
101052d159aSCy Schubert</p>
1022b15cb3dSCy Schubert
1032b15cb3dSCy Schubert<p>This section was generated by <strong>AutoGen</strong>,
1042b15cb3dSCy Schubertusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntptrace</code> program.
105052d159aSCy Schubert</p>
106052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
107a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntptrace-usage" accesskey="1">ntptrace usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ntptrace help/usage (<samp>--help</samp>)
108052d159aSCy Schubert</td></tr>
109a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntptrace-numeric" accesskey="2">ntptrace numeric</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">numeric option (-n)
110052d159aSCy Schubert</td></tr>
111a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntptrace-max_002dhosts" accesskey="3">ntptrace max-hosts</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">max-hosts option (-m)
112052d159aSCy Schubert</td></tr>
113a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntptrace-host" accesskey="4">ntptrace host</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">host option (-r)
114052d159aSCy Schubert</td></tr>
115a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntptrace-exit-status" accesskey="5">ntptrace exit status</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">exit status
116052d159aSCy Schubert</td></tr>
117052d159aSCy Schubert</table>
1182b15cb3dSCy Schubert
119052d159aSCy Schubert<hr>
120a466cc55SCy Schubert<span id="ntptrace-usage"></span><div class="header">
121052d159aSCy Schubert<p>
122052d159aSCy SchubertNext: <a href="#ntptrace-numeric" accesskey="n" rel="next">ntptrace numeric</a>, Up: <a href="#ntptrace-Invocation" accesskey="u" rel="up">ntptrace Invocation</a> &nbsp; </p>
1232b15cb3dSCy Schubert</div>
124a466cc55SCy Schubert<span id="ntptrace-help_002fusage-_0028_002d_002dhelp_0029"></span><h3 class="section">1.1 ntptrace help/usage (<samp>--help</samp>)</h3>
125a466cc55SCy Schubert<span id="index-ntptrace-help"></span>
1262b15cb3dSCy Schubert
127052d159aSCy Schubert<p>This is the automatically generated usage text for ntptrace.
128052d159aSCy Schubert</p>
1292b15cb3dSCy Schubert<p>The text printed is the same whether selected with the <code>help</code> option
130052d159aSCy Schubert(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
1312b15cb3dSCy Schubertthe usage text by passing it through a pager program.
1322b15cb3dSCy Schubert<code>more-help</code> is disabled on platforms without a working
1332b15cb3dSCy Schubert<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
134052d159aSCy Schubertused to select the program, defaulting to <samp>more</samp>.  Both will exit
1352b15cb3dSCy Schubertwith a status code of 0.
136052d159aSCy Schubert</p>
137052d159aSCy Schubert<div class="example">
138*f5f40dd6SCy Schubert<pre class="example">ntptrace - Trace peers of an NTP server - Ver. 4.2.8p18
1392b15cb3dSCy SchubertUSAGE: ntptrace [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [host]
1402b15cb3dSCy Schubert
1412b15cb3dSCy Schubert    -n, --numeric                Print IP addresses instead of hostnames
1422b15cb3dSCy Schubert    -m, --max-hosts=num          Maximum number of peers to trace
1432b15cb3dSCy Schubert    -r, --host=str               Single remote host
1442b15cb3dSCy Schubert    -?, --help                   Display usage information and exit
1452b15cb3dSCy Schubert        --more-help              Pass the extended usage text through a pager
1462b15cb3dSCy Schubert
1472b15cb3dSCy SchubertOptions are specified by doubled hyphens and their name or by a single
1482b15cb3dSCy Schuberthyphen and the flag character.
149052d159aSCy Schubert</pre></div>
150052d159aSCy Schubert
151052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
152a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntptrace-numeric" accesskey="1">numeric option (-n)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
153052d159aSCy Schubert</td></tr>
154a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntptrace-max_002dhosts" accesskey="2">max-hosts option (-m)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
155052d159aSCy Schubert</td></tr>
156a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntptrace-host" accesskey="3">host option (-r)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
157052d159aSCy Schubert</td></tr>
158a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntptrace-exit-status" accesskey="4">ntptrace exit status</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
159052d159aSCy Schubert</td></tr>
160052d159aSCy Schubert</table>
161052d159aSCy Schubert
162052d159aSCy Schubert<hr>
163a466cc55SCy Schubert<span id="ntptrace-numeric"></span><div class="header">
164052d159aSCy Schubert<p>
165052d159aSCy SchubertNext: <a href="#ntptrace-max_002dhosts" accesskey="n" rel="next">ntptrace max-hosts</a>, Previous: <a href="#ntptrace-usage" accesskey="p" rel="prev">ntptrace usage</a>, Up: <a href="#ntptrace-usage" accesskey="u" rel="up">ntptrace usage</a> &nbsp; </p>
1662b15cb3dSCy Schubert</div>
167a466cc55SCy Schubert<span id="numeric-option-_0028_002dn_0029"></span><h4 class="subsection">1.1.1 numeric option (-n)</h4>
168a466cc55SCy Schubert<span id="index-ntptrace_002dnumeric"></span>
1692b15cb3dSCy Schubert
170052d159aSCy Schubert<p>This is the &ldquo;print ip addresses instead of hostnames&rdquo; option.
1712b15cb3dSCy SchubertOutput hosts as dotted-quad numeric format rather than converting to
1722b15cb3dSCy Schubertthe canonical host names.
173052d159aSCy Schubert</p><hr>
174a466cc55SCy Schubert<span id="ntptrace-max_002dhosts"></span><div class="header">
175052d159aSCy Schubert<p>
176052d159aSCy SchubertNext: <a href="#ntptrace-host" accesskey="n" rel="next">ntptrace host</a>, Previous: <a href="#ntptrace-numeric" accesskey="p" rel="prev">ntptrace numeric</a>, Up: <a href="#ntptrace-usage" accesskey="u" rel="up">ntptrace usage</a> &nbsp; </p>
1772b15cb3dSCy Schubert</div>
178a466cc55SCy Schubert<span id="max_002dhosts-option-_0028_002dm_0029"></span><h4 class="subsection">1.1.2 max-hosts option (-m)</h4>
179a466cc55SCy Schubert<span id="index-ntptrace_002dmax_002dhosts"></span>
1802b15cb3dSCy Schubert
181052d159aSCy Schubert<p>This is the &ldquo;maximum number of peers to trace&rdquo; option.
1822b15cb3dSCy SchubertThis option takes a number argument.
183052d159aSCy SchubertThis option has no &lsquo;<samp>doc</samp>&rsquo; documentation.
184052d159aSCy Schubert</p><hr>
185a466cc55SCy Schubert<span id="ntptrace-host"></span><div class="header">
186052d159aSCy Schubert<p>
187052d159aSCy SchubertNext: <a href="#ntptrace-exit-status" accesskey="n" rel="next">ntptrace exit status</a>, Previous: <a href="#ntptrace-max_002dhosts" accesskey="p" rel="prev">ntptrace max-hosts</a>, Up: <a href="#ntptrace-usage" accesskey="u" rel="up">ntptrace usage</a> &nbsp; </p>
1882b15cb3dSCy Schubert</div>
189a466cc55SCy Schubert<span id="host-option-_0028_002dr_0029"></span><h4 class="subsection">1.1.3 host option (-r)</h4>
190a466cc55SCy Schubert<span id="index-ntptrace_002dhost"></span>
1912b15cb3dSCy Schubert
192052d159aSCy Schubert<p>This is the &ldquo;single remote host&rdquo; option.
1932b15cb3dSCy SchubertThis option takes a string argument.
194052d159aSCy SchubertThis option has no &lsquo;<samp>doc</samp>&rsquo; documentation.
195052d159aSCy Schubert</p><hr>
196a466cc55SCy Schubert<span id="ntptrace-exit-status"></span><div class="header">
197052d159aSCy Schubert<p>
198052d159aSCy SchubertPrevious: <a href="#ntptrace-host" accesskey="p" rel="prev">ntptrace host</a>, Up: <a href="#ntptrace-usage" accesskey="u" rel="up">ntptrace usage</a> &nbsp; </p>
1992b15cb3dSCy Schubert</div>
200a466cc55SCy Schubert<span id="ntptrace-exit-status-1"></span><h4 class="subsection">1.1.4 ntptrace exit status</h4>
2012b15cb3dSCy Schubert
2022b15cb3dSCy Schubert<p>One of the following exit values will be returned:
203052d159aSCy Schubert</p><dl compact="compact">
204052d159aSCy Schubert<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
205052d159aSCy Schubert<dd><p>Successful program execution.
206052d159aSCy Schubert</p></dd>
207052d159aSCy Schubert<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
208052d159aSCy Schubert<dd><p>The operation failed or the command syntax was not valid.
209052d159aSCy Schubert</p></dd>
2102b15cb3dSCy Schubert</dl>
211052d159aSCy Schubert<hr>
2122b15cb3dSCy Schubert
2132b15cb3dSCy Schubert
214052d159aSCy Schubert
215052d159aSCy Schubert</body>
216052d159aSCy Schubert</html>
217