1344884Scy<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2344884Scy<html>
3344884Scy<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
4275970Scy<head>
5344884Scy<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6344884Scy<title>ntpq: Network Time Protocol Query User&rsquo;s Manual</title>
7344884Scy
8344884Scy<meta name="description" content="ntpq: Network Time Protocol Query User&rsquo;s Manual">
9344884Scy<meta name="keywords" content="ntpq: Network Time Protocol Query User&rsquo;s Manual">
10344884Scy<meta name="resource-type" content="document">
11344884Scy<meta name="distribution" content="global">
12344884Scy<meta name="Generator" content="makeinfo">
13344884Scy<link href="#Top" rel="start" title="Top">
14344884Scy<link href="dir.html#Top" rel="up" title="(dir)">
15344884Scy<style type="text/css">
16344884Scy<!--
17344884Scya.summary-letter {text-decoration: none}
18344884Scyblockquote.indentedblock {margin-right: 0em}
19344884Scyblockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
20344884Scyblockquote.smallquotation {font-size: smaller}
21344884Scydiv.display {margin-left: 3.2em}
22344884Scydiv.example {margin-left: 3.2em}
23344884Scydiv.lisp {margin-left: 3.2em}
24344884Scydiv.smalldisplay {margin-left: 3.2em}
25344884Scydiv.smallexample {margin-left: 3.2em}
26344884Scydiv.smalllisp {margin-left: 3.2em}
27344884Scykbd {font-style: oblique}
28344884Scypre.display {font-family: inherit}
29344884Scypre.format {font-family: inherit}
30344884Scypre.menu-comment {font-family: serif}
31344884Scypre.menu-preformatted {font-family: serif}
32344884Scypre.smalldisplay {font-family: inherit; font-size: smaller}
33344884Scypre.smallexample {font-size: smaller}
34344884Scypre.smallformat {font-family: inherit; font-size: smaller}
35344884Scypre.smalllisp {font-size: smaller}
36344884Scyspan.nolinebreak {white-space: nowrap}
37344884Scyspan.roman {font-family: initial; font-weight: normal}
38344884Scyspan.sansserif {font-family: sans-serif; font-weight: normal}
39344884Scyul.no-bullet {list-style: none}
40344884Scy-->
41344884Scy</style>
42344884Scy
43344884Scy
44275970Scy</head>
45344884Scy
46344884Scy<body lang="en">
47344884Scy<h1 class="settitle" align="center">ntpq: Network Time Protocol Query User&rsquo;s Manual</h1>
48344884Scy
49344884Scy
50344884Scy
51344884Scy
52344884Scy
53344884Scy<a name="SEC_Overview"></a>
54344884Scy<h2 class="shortcontents-heading">Short Table of Contents</h2>
55344884Scy
56344884Scy<div class="shortcontents">
57344884Scy<ul class="no-bullet">
58344884Scy<li><a name="stoc-Description" href="#toc-Description">1 Description</a></li>
59275970Scy</ul>
60275970Scy</div>
61275970Scy
62275970Scy
63344884Scy<a name="Top"></a>
64344884Scy<div class="header">
65344884Scy<p>
66344884ScyNext: <a href="#ntpq-Description" accesskey="n" rel="next">ntpq Description</a>, Previous: <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>
67275970Scy</div>
68344884Scy<a name="ntpq_003a-Network-Time-Protocol-Query-User-Manual"></a>
69344884Scy<h1 class="top">ntpq: Network Time Protocol Query User Manual</h1>
70275970Scy
71275970Scy<p>The <code>ntpq</code> utility program is used to
72275970Scymonitor the operational status
73275970Scyand determine the performance of
74275970Scy<code>ntpd</code>, the NTP daemon.
75344884Scy</p>
76362716Scy<p>This document applies to version 4.2.8p15 of <code>ntpq</code>.
77344884Scy</p>
78344884Scy<table class="menu" border="0" cellspacing="0">
79344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-Description" accesskey="1">ntpq Description</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
80344884Scy</td></tr>
81344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-Invocation" accesskey="2">ntpq Invocation</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Invoking ntpq
82344884Scy</td></tr>
83344884Scy<tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="3">Usage</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
84344884Scy</td></tr>
85344884Scy<tr><td align="left" valign="top">&bull; <a href="#Internal-Commands" accesskey="4">Internal Commands</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
86344884Scy</td></tr>
87344884Scy<tr><td align="left" valign="top">&bull; <a href="#Control-Message-Commands" accesskey="5">Control Message Commands</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
88344884Scy</td></tr>
89344884Scy<tr><td align="left" valign="top">&bull; <a href="#Status-Words-and-Kiss-Codes" accesskey="6">Status Words and Kiss Codes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
90344884Scy</td></tr>
91344884Scy<tr><td align="left" valign="top">&bull; <a href="#System-Variables" accesskey="7">System Variables</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
92344884Scy</td></tr>
93344884Scy<tr><td align="left" valign="top">&bull; <a href="#Peer-Variables" accesskey="8">Peer Variables</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
94344884Scy</td></tr>
95344884Scy<tr><td align="left" valign="top">&bull; <a href="#Clock-Variables" accesskey="9">Clock Variables</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
96344884Scy</td></tr>
97344884Scy</table>
98275970Scy
99344884Scy<hr>
100344884Scy<a name="ntpq-Description"></a>
101344884Scy<div class="header">
102344884Scy<p>
103344884ScyNext: <a href="#Usage" accesskey="n" rel="next">Usage</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
104275970Scy</div>
105344884Scy<a name="Description"></a>
106344884Scy<h2 class="chapter">1 Description</h2>
107275970Scy
108344884Scy<p>The <code>ntpq</code> utility program is used to monitor NTP daemon <code>ntpd</code> operations and determine performance.
109275970ScyIt uses the standard NTP mode 6 control message formats defined in
110344884ScyAppendix B of the NTPv3 specification RFC1305.
111344884ScyThe same formats are used in NTPv4, although some of the variable names have changed and new ones added.
112275970ScyThe description on this page is for the NTPv4 variables.
113344884Scy</p>
114344884Scy<p>The program can be run either in interactive mode or controlled using command line arguments.  Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available.  The <code>ntpq</code> can also obtain and print a list of peers in a common format by sending multiple queries to the server.
115344884Scy</p>
116344884Scy<p>If one or more request options is included on the command line when <code>ntpq</code> is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default.  If no request options are given, <code>ntpq</code> will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified.  <code>ntpq</code> will prompt for commands if the standard input is a terminal device.
117344884Scy</p>
118344884Scy<p><code>ntpq</code> uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it.  Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology.  <code>ntpq</code> makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.
119344884Scy</p>
120344884Scy<p>Note that in contexts where a host name is expected, a <code>-4</code> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <code>-6</code> qualifier forces DNS resolution to the IPv6 namespace.
121344884Scy</p>
122344884Scy<p>For examples and usage, see the <a href="debug.html">NTP Debugging Techniques</a> page.
123344884Scy</p>
124344884Scy<table class="menu" border="0" cellspacing="0">
125344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-Invocation" accesskey="1">ntpq Invocation</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
126344884Scy</td></tr>
127344884Scy<tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="2">Usage</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
128344884Scy</td></tr>
129344884Scy<tr><td align="left" valign="top">&bull; <a href="#Internal-Commands" accesskey="3">Internal Commands</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
130344884Scy</td></tr>
131344884Scy<tr><td align="left" valign="top">&bull; <a href="#Control-Message-Commands" accesskey="4">Control Message Commands</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
132344884Scy</td></tr>
133344884Scy<tr><td align="left" valign="top">&bull; <a href="#Status-Words-and-Kiss-Codes" accesskey="5">Status Words and Kiss Codes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
134344884Scy</td></tr>
135344884Scy<tr><td align="left" valign="top">&bull; <a href="#System-Variables" accesskey="6">System Variables</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
136344884Scy</td></tr>
137344884Scy<tr><td align="left" valign="top">&bull; <a href="#Peer-Variables" accesskey="7">Peer Variables</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
138344884Scy</td></tr>
139344884Scy<tr><td align="left" valign="top">&bull; <a href="#Clock-Variables" accesskey="8">Clock Variables</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
140344884Scy</td></tr>
141344884Scy</table>
142275970Scy
143344884Scy<hr>
144275970Scy<a name="ntpq-Invocation"></a>
145344884Scy<div class="header">
146344884Scy<p>
147344884ScyNext: <a href="#Usage" accesskey="n" rel="next">Usage</a>, Previous: <a href="#ntpq-Description" accesskey="p" rel="prev">ntpq Description</a>, Up: <a href="#ntpq-Description" accesskey="u" rel="up">ntpq Description</a> &nbsp; </p>
148275970Scy</div>
149344884Scy<a name="Invoking-ntpq"></a>
150344884Scy<h3 class="section">1.1 Invoking ntpq</h3>
151344884Scy<a name="index-ntpq"></a>
152344884Scy<a name="index-standard-NTP-query-program"></a>
153275970Scy
154275970Scy
155344884Scy<p>The
156275970Scy<code>ntpq</code>
157330106Sdelphijutility program is used to query NTP servers to monitor NTP operations
158330106Sdelphijand performance, requesting
159344884Scyinformation about current state and/or changes in that state.
160275970ScyThe program may be run either in interactive mode or controlled using
161344884Scycommand line arguments.
162275970ScyRequests to read and write arbitrary
163275970Scyvariables can be assembled, with raw and pretty-printed output
164344884Scyoptions being available.
165275970ScyThe
166275970Scy<code>ntpq</code>
167275970Scyutility can also obtain and print a
168275970Scylist of peers in a common format by sending multiple queries to the
169275970Scyserver.
170344884Scy</p>
171344884Scy<p>If one or more request options is included on the command line
172275970Scywhen
173275970Scy<code>ntpq</code>
174275970Scyis executed, each of the requests will be sent
175275970Scyto the NTP servers running on each of the hosts given as command
176344884Scyline arguments, or on localhost by default.
177275970ScyIf no request options
178275970Scyare given,
179275970Scy<code>ntpq</code>
180275970Scywill attempt to read commands from the
181275970Scystandard input and execute these on the NTP server running on the
182275970Scyfirst host given on the command line, again defaulting to localhost
183344884Scywhen no other host is specified.
184275970ScyThe
185275970Scy<code>ntpq</code>
186275970Scyutility will prompt for
187275970Scycommands if the standard input is a terminal device.
188344884Scy</p>
189344884Scy<p><code>ntpq</code>
190275970Scyuses NTP mode 6 packets to communicate with the
191275970ScyNTP server, and hence can be used to query any compatible server on
192344884Scythe network which permits it.
193275970ScyNote that since NTP is a UDP protocol
194275970Scythis communication will be somewhat unreliable, especially over
195344884Scylarge distances in terms of network topology.
196275970ScyThe
197275970Scy<code>ntpq</code>
198275970Scyutility makes
199275970Scyone attempt to retransmit requests, and will time requests out if
200275970Scythe remote host is not heard from within a suitable timeout
201275970Scytime.
202344884Scy</p>
203344884Scy<p>Note that in contexts where a host name is expected, a
204330106Sdelphij<code>-4</code>
205330106Sdelphijqualifier preceding the host name forces resolution to the IPv4
206330106Sdelphijnamespace, while a
207330106Sdelphij<code>-6</code>
208344884Scyqualifier forces resolution to the IPv6 namespace.
209330106SdelphijFor examples and usage, see the
210344884Scy&ldquo;NTP Debugging Techniques&rdquo;
211330106Sdelphijpage.
212344884Scy</p>
213344884Scy<p>Specifying a
214275970Scycommand line option other than
215275970Scy<code>-i</code>
216275970Scyor
217275970Scy<code>-n</code>
218275970Scywill
219275970Scycause the specified query (queries) to be sent to the indicated
220344884Scyhost(s) immediately.
221275970ScyOtherwise,
222275970Scy<code>ntpq</code>
223275970Scywill attempt to read
224275970Scyinteractive format commands from the standard input.
225344884Scy</p>
226344884Scy<table class="menu" border="0" cellspacing="0">
227344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-usage" accesskey="1">ntpq usage</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
228344884Scy</td></tr>
229344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-ipv4" accesskey="2">ntpq ipv4</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
230344884Scy</td></tr>
231344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-ipv6" accesskey="3">ntpq ipv6</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
232344884Scy</td></tr>
233344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-command" accesskey="4">ntpq command</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
234344884Scy</td></tr>
235344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-interactive" accesskey="5">ntpq interactive</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
236344884Scy</td></tr>
237344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-numeric" accesskey="6">ntpq numeric</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
238344884Scy</td></tr>
239344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-old_002drv" accesskey="7">ntpq old-rv</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
240344884Scy</td></tr>
241344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-peers" accesskey="8">ntpq peers</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
242344884Scy</td></tr>
243344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-refid" accesskey="9">ntpq refid</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
244344884Scy</td></tr>
245344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-wide">ntpq wide</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
246344884Scy</td></tr>
247344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-config">ntpq config</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
248344884Scy</td></tr>
249344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-exit-status">ntpq exit status</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
250344884Scy</td></tr>
251344884Scy</table>
252275970Scy
253344884Scy<a name="Internal-Commands-1"></a>
254344884Scy<h4 class="subsection">1.1.1 Internal Commands</h4>
255275970Scy
256275970Scy<p>Interactive format commands consist of a keyword followed by zero
257344884Scyto four arguments.
258275970ScyOnly enough characters of the full keyword to
259275970Scyuniquely identify the command need be typed.
260344884Scy</p>
261344884Scy<p>A
262275970Scynumber of interactive format commands are executed entirely within
263275970Scythe
264275970Scy<code>ntpq</code>
265330106Sdelphijutility itself and do not result in NTP
266344884Scyrequests being sent to a server.
267275970ScyThese are described following.
268344884Scy</p><dl compact="compact">
269344884Scy<dt><code>?</code> <code>[<kbd>command</kbd>]</code></dt>
270344884Scy<dt><code>help</code> <code>[<kbd>command</kbd>]</code></dt>
271344884Scy<dd><p>A
272344884Scy&lsquo;?&rsquo;
273330106Sdelphijby itself will print a list of all the commands
274330106Sdelphijknown to
275275970Scy<code>ntpq</code>
276275970ScyA
277344884Scy&lsquo;?&rsquo;
278330106Sdelphijfollowed by a command name will print function and usage
279344884Scyinformation about the command.
280344884Scy</p></dd>
281344884Scy<dt><code>addvars</code> <kbd>name</kbd><code>[=<kbd>value</kbd>]</code><code>[,...]</code></dt>
282344884Scy<dt><code>rmvars</code> <kbd>name</kbd><code>[,...]</code></dt>
283344884Scy<dt><code>clearvars</code></dt>
284344884Scy<dt><code>showvars</code></dt>
285344884Scy<dd><p>The arguments to this command consist of a list of
286275970Scyitems of the form
287344884Scy<kbd>name</kbd><code>[=<kbd>value</kbd>]</code>,
288275970Scywhere the
289330106Sdelphij.No = Ns Ar value
290275970Scyis ignored, and can be omitted,
291344884Scyin requests to the server to read variables.
292275970ScyThe
293275970Scy<code>ntpq</code>
294330106Sdelphijutility maintains an internal list in which data to be included in
295330106Sdelphijmessages can be assembled, and displayed or set using the
296275970Scy<code>readlist</code>
297275970Scyand
298275970Scy<code>writelist</code>
299344884Scycommands described below.
300275970ScyThe
301275970Scy<code>addvars</code>
302275970Scycommand allows variables and their optional values to be added to
303344884Scythe list.
304275970ScyIf more than one variable is to be added, the list should
305344884Scybe comma-separated and not contain white space.
306275970ScyThe
307275970Scy<code>rmvars</code>
308275970Scycommand can be used to remove individual variables from the list,
309275970Scywhile the
310330106Sdelphij<code>clearvars</code>
311275970Scycommand removes all variables from the
312344884Scylist.
313275970ScyThe
314275970Scy<code>showvars</code>
315344884Scycommand displays the current list of optional variables.
316344884Scy</p></dd>
317344884Scy<dt><code>authenticate</code> <code>[<code>yes</code>|<code>no</code>]</code></dt>
318344884Scy<dd><p>Normally
319275970Scy<code>ntpq</code>
320275970Scydoes not authenticate requests unless
321344884Scythey are write requests.
322275970ScyThe command
323330106Sdelphij<code>authenticate</code> <code>yes</code>
324275970Scycauses
325275970Scy<code>ntpq</code>
326275970Scyto send authentication with all requests it
327344884Scymakes.
328275970ScyAuthenticated requests causes some servers to handle
329344884Scyrequests slightly differently.
330275970ScyThe command
331330106Sdelphij<code>authenticate</code>
332275970Scycauses
333275970Scy<code>ntpq</code>
334275970Scyto display whether or not
335344884Scyit is currently authenticating requests.
336344884Scy</p></dd>
337344884Scy<dt><code>cooked</code></dt>
338344884Scy<dd><p>Causes output from query commands to be &quot;cooked&quot;, so that
339275970Scyvariables which are recognized by
340275970Scy<code>ntpq</code>
341275970Scywill have their
342344884Scyvalues reformatted for human consumption.
343275970ScyVariables which
344275970Scy<code>ntpq</code>
345330106Sdelphijcould not decode completely are
346275970Scymarked with a trailing
347344884Scy&lsquo;?&rsquo;.
348344884Scy</p></dd>
349344884Scy<dt><code>debug</code> <code>[<code>more</code>|<code>less</code>|<code>off</code>]</code></dt>
350344884Scy<dd><p>With no argument, displays the current debug level.
351344884ScyOtherwise, the debugging level is changed as indicated.
352344884Scy</p></dd>
353344884Scy<dt><code>delay</code> <code>[<kbd>milliseconds</kbd>]</code></dt>
354344884Scy<dd><p>Specify a time interval to be added to timestamps included in
355344884Scyrequests which require authentication.
356275970ScyThis is used to enable
357275970Scy(unreliable) server reconfiguration over long delay network paths
358344884Scyor between machines whose clocks are unsynchronized.
359275970ScyActually the
360275970Scyserver does not now require timestamps in authenticated requests,
361344884Scyso this command may be obsolete.
362344884ScyWithout any arguments, displays the current delay.
363344884Scy</p></dd>
364344884Scy<dt><code>drefid</code> <code>[<code>hash</code>|<code>ipv4</code>]</code></dt>
365344884Scy<dd><p>Display refids as IPv4 or hash.
366330106SdelphijWithout any arguments, displays whether refids are shown as IPv4
367344884Scyaddresses or hashes.
368344884Scy</p></dd>
369344884Scy<dt><code>exit</code></dt>
370344884Scy<dd><p>Exit
371275970Scy<code>ntpq</code>
372344884Scy</p></dd>
373344884Scy<dt><code>host</code> <code>[<kbd>name</kbd>]</code></dt>
374344884Scy<dd><p>Set the host to which future queries will be sent.
375330106SdelphijThe
376330106Sdelphij<kbd>name</kbd>
377344884Scymay be either a host name or a numeric address.
378344884ScyWithout any arguments, displays the current host.
379344884Scy</p></dd>
380344884Scy<dt><code>hostnames</code> <code>[<code>yes</code>|<code>no</code>]</code></dt>
381344884Scy<dd><p>If
382275970Scy<code>yes</code>
383275970Scyis specified, host names are printed in
384344884Scyinformation displays.
385275970ScyIf
386275970Scy<code>no</code>
387275970Scyis specified, numeric
388344884Scyaddresses are printed instead.
389275970ScyThe default is
390275970Scy<code>yes</code>,
391275970Scyunless
392275970Scymodified using the command line
393275970Scy<code>-n</code>
394344884Scyswitch.
395330106SdelphijWithout any arguments, displays whether host names or numeric addresses
396344884Scyare shown.
397344884Scy</p></dd>
398344884Scy<dt><code>keyid</code> <code>[<kbd>keyid</kbd>]</code></dt>
399344884Scy<dd><p>This command allows the specification of a key number to be
400344884Scyused to authenticate configuration requests.
401275970ScyThis must correspond
402285169Scyto the
403285169Scy<code>controlkey</code>
404285169Scykey number the server has been configured to use for this
405344884Scypurpose.
406330106SdelphijWithout any arguments, displays the current
407344884Scy<kbd>keyid</kbd>.
408344884Scy</p></dd>
409344884Scy<dt><code>keytype</code> <code>[<kbd>digest</kbd>]</code></dt>
410344884Scy<dd><p>Specify the digest algorithm to use for authenticating requests, with default
411344884Scy<code>MD5</code>.
412275970ScyIf
413275970Scy<code>ntpq</code>
414330106Sdelphijwas built with OpenSSL support, and OpenSSL is installed,
415330106Sdelphij<kbd>digest</kbd>
416344884Scycan be any message digest algorithm supported by OpenSSL.
417275970ScyIf no argument is given, the current
418330106Sdelphij<code>keytype</code> <kbd>digest</kbd>
419344884Scyalgorithm used is displayed.
420344884Scy</p></dd>
421344884Scy<dt><code>ntpversion</code> <code>[<code>1</code>|<code>2</code>|<code>3</code>|<code>4</code>]</code></dt>
422344884Scy<dd><p>Sets the NTP version number which
423275970Scy<code>ntpq</code>
424275970Scyclaims in
425344884Scypackets.
426275970ScyDefaults to 3, and note that mode 6 control messages (and
427344884Scymodes, for that matter) didn&rsquo;t exist in NTP version 1.
428275970ScyThere appear
429344884Scyto be no servers left which demand version 1.
430275970ScyWith no argument, displays the current NTP version that will be used
431344884Scywhen communicating with servers.
432344884Scy</p></dd>
433344884Scy<dt><code>passwd</code></dt>
434344884Scy<dd><p>This command prompts you to type in a password (which will not
435275970Scybe echoed) which will be used to authenticate configuration
436344884Scyrequests.
437275970ScyThe password must correspond to the key configured for
438275970Scyuse by the NTP server for this purpose if such requests are to be
439344884Scysuccessful.
440344884Scy</p></dd>
441344884Scy<dt><code>poll</code> <code>[<kbd>n</kbd>]</code> <code>[<code>verbose</code>]</code></dt>
442344884Scy<dd><p>Poll an NTP server in client mode
443275970Scy<kbd>n</kbd>
444344884Scytimes.
445344884ScyPoll not implemented yet.
446344884Scy</p></dd>
447344884Scy<dt><code>quit</code></dt>
448344884Scy<dd><p>Exit
449275970Scy<code>ntpq</code>
450344884Scy</p></dd>
451344884Scy<dt><code>raw</code></dt>
452344884Scy<dd><p>Causes all output from query commands is printed as received
453344884Scyfrom the remote server.
454275970ScyThe only formating/interpretation done on
455275970Scythe data is to transform nonascii data into a printable (but barely
456344884Scyunderstandable) form.
457344884Scy</p></dd>
458344884Scy<dt><code>timeout</code> <code>[<kbd>milliseconds</kbd>]</code></dt>
459344884Scy<dd><p>Specify a timeout period for responses to server queries.
460275970ScyThe
461344884Scydefault is about 5000 milliseconds.
462344884ScyWithout any arguments, displays the current timeout period.
463275970ScyNote that since
464275970Scy<code>ntpq</code>
465275970Scyretries each query once after a timeout, the total waiting time for
466344884Scya timeout will be twice the timeout value set.
467344884Scy</p></dd>
468344884Scy<dt><code>version</code></dt>
469344884Scy<dd><p>Display the version of the
470275970Scy<code>ntpq</code>
471344884Scyprogram.
472344884Scy</p></dd>
473275970Scy</dl>
474275970Scy
475344884Scy<a name="Control-Message-Commands-1"></a>
476344884Scy<h4 class="subsubsection">1.1.1.1 Control Message Commands</h4>
477344884Scy<p>Association ids are used to identify system, peer and clock variables.
478330106SdelphijSystem variables are assigned an association id of zero and system name
479330106Sdelphijspace, while each association is assigned a nonzero association id and
480344884Scypeer namespace.
481330106SdelphijMost control commands send a single message to the server and expect a
482344884Scysingle response message.
483275970ScyThe exceptions are the
484275970Scy<code>peers</code>
485275970Scycommand, which sends a series of messages,
486275970Scyand the
487275970Scy<code>mreadlist</code>
488275970Scyand
489275970Scy<code>mreadvar</code>
490275970Scycommands, which iterate over a range of associations.
491344884Scy</p><dl compact="compact">
492344884Scy<dt><code>apeers</code></dt>
493344884Scy<dd><p>Display a list of peers in the form:
494344884Scy</p><div class="example">
495344884Scy<pre class="example">[tally]remote refid assid st t when pool reach delay offset jitter
496344884Scy</pre></div>
497344884Scy<p>where the output is just like the
498330106Sdelphij<code>peers</code>
499330106Sdelphijcommand except that the
500330106Sdelphij<code>refid</code>
501344884Scyis displayed in hex format and the association number is also displayed.
502344884Scy</p></dd>
503344884Scy<dt><code>associations</code></dt>
504344884Scy<dd><p>Display a list of mobilized associations in the form:
505344884Scy</p><div class="example">
506344884Scy<pre class="example">ind assid status conf reach auth condition last_event cnt
507344884Scy</pre></div>
508344884Scy<dl compact="compact">
509344884Scy<dt>Sy Variable Ta Sy Description</dt>
510344884Scy<dt><code>ind</code> <code>Ta</code> <code>index</code> <code>on</code> <code>this</code> <code>list</code></dt>
511344884Scy<dt><code>assid</code> <code>Ta</code> <code>association</code> <code>id</code></dt>
512344884Scy<dt><code>status</code> <code>Ta</code> <code>peer</code> <code>status</code> <code>word</code></dt>
513344884Scy<dt><code>conf</code> <code>Ta</code> <code>yes</code>: <code>No</code> <code>persistent,</code> <code>no</code>: <code>No</code> <code>ephemeral</code></dt>
514344884Scy<dt><code>reach</code> <code>Ta</code> <code>yes</code>: <code>No</code> <code>reachable,</code> <code>no</code>: <code>No</code> <code>unreachable</code></dt>
515344884Scy<dt><code>auth</code> <code>Ta</code> <code>ok</code>, <code>yes</code>, <code>bad</code> <code>No</code> <code>and</code> <code>none</code></dt>
516344884Scy<dt><code>condition</code> <code>Ta</code> <code>selection</code> <code>status</code> <code>(see</code> <code>the</code> <code>select</code> <code>No</code> <code>field</code> <code>of</code> <code>the</code> <code>peer</code> <code>status</code> <code>word)</code></dt>
517344884Scy<dt><code>last_event</code> <code>Ta</code> <code>event</code> <code>report</code> <code>(see</code> <code>the</code> <code>event</code> <code>No</code> <code>field</code> <code>of</code> <code>the</code> <code>peer</code> <code>status</code> <code>word)</code></dt>
518344884Scy<dt><code>cnt</code> <code>Ta</code> <code>event</code> <code>count</code> <code>(see</code> <code>the</code> <code>count</code> <code>No</code> <code>field</code> <code>of</code> <code>the</code> <code>peer</code> <code>status</code> <code>word)</code></dt>
519344884Scy</dl>
520344884Scy</dd>
521344884Scy<dt><code>authinfo</code></dt>
522344884Scy<dd><p>Display the authentication statistics counters:
523330106Sdelphijtime since reset, stored keys, free keys, key lookups, keys not found,
524344884Scyuncached keys, expired keys, encryptions, decryptions.
525344884Scy</p></dd>
526344884Scy<dt><code>clocklist</code> <code>[<kbd>associd</kbd>]</code></dt>
527344884Scy<dt><code>cl</code> <code>[<kbd>associd</kbd>]</code></dt>
528344884Scy<dd><p>Display all clock variables in the variable list for those associations
529344884Scysupporting a reference clock.
530344884Scy</p></dd>
531344884Scy<dt><code>clockvar</code> <code>[<kbd>associd</kbd>]</code> <code>[<kbd>name</kbd><code>[=<kbd>value</kbd>]</code>]</code><code>[,...]</code></dt>
532344884Scy<dt><code>cv</code> <code>[<kbd>associd</kbd>]</code> <code>[<kbd>name</kbd><code>[=<kbd>value</kbd>]</code>]</code><code>[,...]</code></dt>
533344884Scy<dd><p>Display a list of clock variables for those associations supporting a
534344884Scyreference clock.
535344884Scy</p></dd>
536344884Scy<dt><code>:config</code> <kbd>configuration command line</kbd></dt>
537344884Scy<dd><p>Send the remainder of the command line, including whitespace, to the
538330106Sdelphijserver as a run-time configuration command in the same format as a line
539344884Scyin the configuration file.
540344884ScyThis command is experimental until further notice and clarification.
541344884ScyAuthentication is of course required.
542344884Scy</p></dd>
543344884Scy<dt><code>config-from-file</code> <kbd>filename</kbd></dt>
544344884Scy<dd><p>Send each line of
545275970Scy<kbd>filename</kbd>
546330106Sdelphijto the server as run-time configuration commands in the same format as
547344884Scylines in the configuration file.
548344884ScyThis command is experimental until further notice and clarification.
549344884ScyAuthentication is required.
550344884Scy</p></dd>
551344884Scy<dt><code>ifstats</code></dt>
552344884Scy<dd><p>Display status and statistics counters for each local network interface address:
553330106Sdelphijinterface number, interface name and address or broadcast, drop, flag,
554344884Scyttl, mc, received, sent, send failed, peers, uptime.
555344884ScyAuthentication is required.
556344884Scy</p></dd>
557344884Scy<dt><code>iostats</code></dt>
558344884Scy<dd><p>Display network and reference clock I/O statistics:
559330106Sdelphijtime since reset, receive buffers, free receive buffers, used receive buffers,
560330106Sdelphijlow water refills, dropped packets, ignored packets, received packets,
561344884Scypackets sent, packet send failures, input wakeups, useful input wakeups.
562344884Scy</p></dd>
563344884Scy<dt><code>kerninfo</code></dt>
564344884Scy<dd><p>Display kernel loop and PPS statistics:
565330106Sdelphijassocid, status, pll offset, pll frequency, maximum error,
566330106Sdelphijestimated error, kernel status, pll time constant, precision,
567330106Sdelphijfrequency tolerance, pps frequency, pps stability, pps jitter,
568330106Sdelphijcalibration interval, calibration cycles, jitter exceeded,
569344884Scystability exceeded, calibration errors.
570330106SdelphijAs with other ntpq output, times are in milliseconds; very small values
571344884Scymay be shown as exponentials.
572330106SdelphijThe precision value displayed is in milliseconds as well, unlike the
573344884Scyprecision system variable.
574344884Scy</p></dd>
575344884Scy<dt><code>lassociations</code></dt>
576344884Scy<dd><p>Perform the same function as the associations command, except display
577344884Scymobilized and unmobilized associations, including all clients.
578344884Scy</p></dd>
579344884Scy<dt><code>lopeers</code> <code>[<code>-4</code>|<code>-6</code>]</code></dt>
580344884Scy<dd><p>Display a list of all peers and clients showing
581330106Sdelphij<code>dstadr</code>
582344884Scy(associated with the given IP version).
583344884Scy</p></dd>
584344884Scy<dt><code>lpassociations</code></dt>
585344884Scy<dd><p>Display the last obtained list of associations, including all clients.
586344884Scy</p></dd>
587344884Scy<dt><code>lpeers</code> <code>[<code>-4</code>|<code>-6</code>]</code></dt>
588344884Scy<dd><p>Display a list of all peers and clients (associated with the given IP version).
589344884Scy</p></dd>
590344884Scy<dt><code>monstats</code></dt>
591344884Scy<dd><p>Display monitor facility status, statistics, and limits:
592330106Sdelphijenabled, addresses, peak addresses, maximum addresses,
593344884Scyreclaim above count, reclaim older than, kilobytes, maximum kilobytes.
594344884Scy</p></dd>
595344884Scy<dt><code>mreadlist</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd></dt>
596344884Scy<dt><code>mrl</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd></dt>
597344884Scy<dd><p>Perform the same function as the
598330106Sdelphij<code>readlist</code>
599344884Scycommand for a range of association ids.
600344884Scy</p></dd>
601344884Scy<dt><code>mreadvar</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd> <code>[<kbd>name</kbd>]</code><code>[,...]</code></dt>
602344884Scy<dd><p>This range may be determined from the list displayed by any
603344884Scycommand showing associations.
604344884Scy</p></dd>
605344884Scy<dt><code>mrv</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd> <code>[<kbd>name</kbd>]</code><code>[,...]</code></dt>
606344884Scy<dd><p>Perform the same function as the
607330106Sdelphij<code>readvar</code>
608344884Scycommand for a range of association ids.
609330106SdelphijThis range may be determined from the list displayed by any
610344884Scycommand showing associations.
611344884Scy</p></dd>
612344884Scy<dt><code>mrulist</code> <code>[<code>limited</code> | <code>kod</code> | <code>mincount</code>=<kbd>count</kbd> | <code>laddr</code>=<kbd>localaddr</kbd> | <code>sort</code>=<code>[-]</code><kbd>sortorder</kbd> | <code>resany</code>=<kbd>hexmask</kbd> | <code>resall</code>=<kbd>hexmask</kbd>]</code></dt>
613344884Scy<dd><p>Display traffic counts of the most recently seen source addresses
614344884Scycollected and maintained by the monitor facility.
615275970ScyWith the exception of
616330106Sdelphij<code>sort</code>=<code>[-]</code><kbd>sortorder</kbd>,
617275970Scythe options filter the list returned by
618344884Scy<code>ntpd(8)</code>.
619275970ScyThe
620275970Scy<code>limited</code>
621275970Scyand
622275970Scy<code>kod</code>
623330106Sdelphijoptions return only entries representing client addresses from which the
624344884Scylast packet received triggered either discarding or a KoD response.
625275970ScyThe
626275970Scy<code>mincount</code>=<kbd>count</kbd>
627275970Scyoption filters entries representing less than
628275970Scy<kbd>count</kbd>
629344884Scypackets.
630275970ScyThe
631275970Scy<code>laddr</code>=<kbd>localaddr</kbd>
632275970Scyoption filters entries for packets received on any local address other than
633344884Scy<kbd>localaddr</kbd>.
634275970Scy<code>resany</code>=<kbd>hexmask</kbd>
635275970Scyand
636275970Scy<code>resall</code>=<kbd>hexmask</kbd>
637275970Scyfilter entries containing none or less than all, respectively, of the bits in
638275970Scy<kbd>hexmask</kbd>,
639275970Scywhich must begin with
640344884Scy<code>0x</code>.
641275970ScyThe
642275970Scy<kbd>sortorder</kbd>
643275970Scydefaults to
644275970Scy<code>lstint</code>
645344884Scyand may be 
646275970Scy<code>addr</code>,
647330106Sdelphij<code>avgint</code>,
648275970Scy<code>count</code>,
649275970Scy<code>lstint</code>,
650330106Sdelphijor any of those preceded by
651344884Scy&lsquo;-&rsquo;
652344884Scyto reverse the sort order.
653275970ScyThe output columns are:
654344884Scy</p><dl compact="compact">
655344884Scy<dt>Column</dt>
656344884Scy<dd><p>Description
657344884Scy</p></dd>
658344884Scy<dt><code>lstint</code></dt>
659344884Scy<dd><p>Interval in seconds between the receipt of the most recent packet from
660330106Sdelphijthis address and the completion of the retrieval of the MRU list by
661275970Scy<code>ntpq</code>
662344884Scy</p></dd>
663344884Scy<dt><code>avgint</code></dt>
664344884Scy<dd><p>Average interval in s between packets from this address.
665344884Scy</p></dd>
666344884Scy<dt><code>rstr</code></dt>
667344884Scy<dd><p>Restriction flags associated with this address.
668275970ScyMost are copied unchanged from the matching
669275970Scy<code>restrict</code>
670330106Sdelphijcommand, however 0x400 (kod) and 0x20 (limited) flags are cleared unless
671344884Scythe last packet from this address triggered a rate control response.
672344884Scy</p></dd>
673344884Scy<dt><code>r</code></dt>
674344884Scy<dd><p>Rate control indicator, either
675275970Scya period,
676275970Scy<code>L</code>
677275970Scyor
678275970Scy<code>K</code>
679275970Scyfor no rate control response,
680344884Scyrate limiting by discarding, or rate limiting with a KoD response, respectively.
681344884Scy</p></dd>
682344884Scy<dt><code>m</code></dt>
683344884Scy<dd><p>Packet mode.
684344884Scy</p></dd>
685344884Scy<dt><code>v</code></dt>
686344884Scy<dd><p>Packet version number.
687344884Scy</p></dd>
688344884Scy<dt><code>count</code></dt>
689344884Scy<dd><p>Packets received from this address.
690344884Scy</p></dd>
691344884Scy<dt><code>rport</code></dt>
692344884Scy<dd><p>Source port of last packet from this address.
693344884Scy</p></dd>
694344884Scy<dt><code>remote</code> <code>address</code></dt>
695344884Scy<dd><p>host or DNS name, numeric address, or address followed by
696344884Scyclaimed DNS name which could not be verified in parentheses.
697344884Scy</p></dd>
698275970Scy</dl>
699344884Scy</dd>
700344884Scy<dt><code>opeers</code> <code>[<code>-4</code> | <code>-6</code>]</code></dt>
701344884Scy<dd><p>Obtain and print the old-style list of all peers and clients showing
702330106Sdelphij<code>dstadr</code>
703330106Sdelphij(associated with the given IP version),
704275970Scyrather than the
705344884Scy<code>refid</code>.
706344884Scy</p></dd>
707344884Scy<dt><code>passociations</code></dt>
708344884Scy<dd><p>Perform the same function as the
709275970Scy<code>associations</code>
710275970Scycommand,
711344884Scyexcept that it uses previously stored data rather than making a new query.
712344884Scy</p></dd>
713344884Scy<dt><code>peers</code></dt>
714344884Scy<dd><p>Display a list of peers in the form:
715344884Scy</p><div class="example">
716344884Scy<pre class="example">[tally]remote refid st t when pool reach delay offset jitter
717344884Scy</pre></div>
718344884Scy<dl compact="compact">
719344884Scy<dt>Variable</dt>
720344884Scy<dd><p>Description
721344884Scy</p></dd>
722344884Scy<dt><code>[tally]</code></dt>
723344884Scy<dd><p>single-character code indicating current value of the
724275970Scy<code>select</code>
725275970Scyfield of the
726344884Scy.Lk decode.html#peer &quot;peer status word&quot;
727344884Scy</p></dd>
728344884Scy<dt><code>remote</code></dt>
729344884Scy<dd><p>host name (or IP number) of peer.
730330106SdelphijThe value displayed will be truncated to 15 characters unless the
731330106Sdelphij<code>ntpq</code>
732275970Scy<code>-w</code>
733330106Sdelphijoption is given, in which case the full value will be displayed
734330106Sdelphijon the first line, and if too long,
735344884Scythe remaining data will be displayed on the next line.
736344884Scy</p></dd>
737344884Scy<dt><code>refid</code></dt>
738344884Scy<dd><p>source IP address or
739344884Scy.Lk decode.html#kiss &quot;&rsquo;kiss code&quot;
740344884Scy</p></dd>
741344884Scy<dt><code>st</code></dt>
742344884Scy<dd><p>stratum: 0 for local reference clocks, 1 for servers with local
743330106Sdelphijreference clocks, ..., 16 for unsynchronized server clocks
744344884Scy</p></dd>
745344884Scy<dt><code>t</code></dt>
746344884Scy<dd><p><code>u</code>:
747275970Scyunicast or manycast client,
748275970Scy<code>b</code>:
749275970Scybroadcast or multicast client,
750330106Sdelphij<code>p</code>:
751330106Sdelphijpool source,
752275970Scy<code>l</code>:
753275970Scylocal (reference clock),
754275970Scy<code>s</code>:
755275970Scysymmetric (peer),
756275970Scy<code>A</code>:
757275970Scymanycast server,
758275970Scy<code>B</code>:
759275970Scybroadcast server,
760275970Scy<code>M</code>:
761275970Scymulticast server
762344884Scy</p></dd>
763344884Scy<dt><code>when</code></dt>
764344884Scy<dd><p>time in seconds, minutes, hours, or days since the last packet
765330106Sdelphijwas received, or
766344884Scy&lsquo;-&rsquo;
767330106Sdelphijif a packet has never been received
768344884Scy</p></dd>
769344884Scy<dt><code>poll</code></dt>
770344884Scy<dd><p>poll interval (s)
771344884Scy</p></dd>
772344884Scy<dt><code>reach</code></dt>
773344884Scy<dd><p>reach shift register (octal)
774344884Scy</p></dd>
775344884Scy<dt><code>delay</code></dt>
776344884Scy<dd><p>roundtrip delay
777344884Scy</p></dd>
778344884Scy<dt><code>offset</code></dt>
779344884Scy<dd><p>offset of server relative to this host
780344884Scy</p></dd>
781344884Scy<dt><code>jitter</code></dt>
782344884Scy<dd><p>offset RMS error estimate.
783344884Scy</p></dd>
784275970Scy</dl>
785344884Scy</dd>
786344884Scy<dt><code>pstats</code> <kbd>associd</kbd></dt>
787344884Scy<dd><p>Display the statistics for the peer with the given
788330106Sdelphij<kbd>associd</kbd>:
789330106Sdelphijassocid, status, remote host, local address, time last received,
790330106Sdelphijtime until next send, reachability change, packets sent,
791330106Sdelphijpackets received, bad authentication, bogus origin, duplicate,
792344884Scybad dispersion, bad reference time, candidate order.
793344884Scy</p></dd>
794344884Scy<dt><code>readlist</code> <code>[<kbd>associd</kbd>]</code></dt>
795344884Scy<dt><code>rl</code> <code>[<kbd>associd</kbd>]</code></dt>
796344884Scy<dd><p>Display all system or peer variables.
797330106SdelphijIf the
798330106Sdelphij<kbd>associd</kbd>
799344884Scyis omitted, it is assumed to be zero.
800344884Scy</p></dd>
801344884Scy<dt><code>readvar</code> <code>[<kbd>associd</kbd> <kbd>name</kbd><code>[=<kbd>value</kbd>]</code> <code>[, ...]</code>]</code></dt>
802344884Scy<dt><code>rv</code> <code>[<kbd>associd</kbd> <kbd>name</kbd><code>[=<kbd>value</kbd>]</code> <code>[, ...]</code>]</code></dt>
803344884Scy<dd><p>Display the specified system or peer variables.
804275970ScyIf
805330106Sdelphij<kbd>associd</kbd>
806275970Scyis zero, the variables are from the
807275970Scy<a href="#System-Variables">System Variables</a>
808275970Scyname space, otherwise they are from the
809275970Scy<a href="#Peer-Variables">Peer Variables</a>
810344884Scyname space.
811275970ScyThe
812330106Sdelphij<kbd>associd</kbd>
813344884Scyis required, as the same name can occur in both spaces.
814275970ScyIf no
815275970Scy<kbd>name</kbd>
816344884Scyis included, all operative variables in the name space are displayed.
817330106SdelphijIn this case only, if the
818330106Sdelphij<kbd>associd</kbd>
819344884Scyis omitted, it is assumed to be zero.
820344884ScyMultiple names are specified with comma separators and without whitespace.
821275970ScyNote that time values are represented in milliseconds
822344884Scyand frequency values in parts-per-million (PPM).
823275970ScySome NTP timestamps are represented in the format
824330106Sdelphij<kbd>YYYY</kbd><kbd>MM</kbd> <kbd>DD</kbd> <kbd>TTTT</kbd>,
825330106Sdelphijwhere
826330106Sdelphij<kbd>YYYY</kbd>
827330106Sdelphijis the year,
828330106Sdelphij<kbd>MM</kbd>
829330106Sdelphijthe month of year,
830330106Sdelphij<kbd>DD</kbd>
831330106Sdelphijthe day of month and
832330106Sdelphij<kbd>TTTT</kbd>
833344884Scythe time of day.
834344884Scy</p></dd>
835344884Scy<dt><code>reslist</code></dt>
836344884Scy<dd><p>Display the access control (restrict) list for
837275970Scy<code>ntpq</code>
838344884ScyAuthentication is required.
839344884Scy</p></dd>
840344884Scy<dt><code>saveconfig</code> <kbd>filename</kbd></dt>
841344884Scy<dd><p>Save the current configuration,
842330106Sdelphijincluding any runtime modifications made by
843275970Scy<code>:config</code>
844275970Scyor
845275970Scy<code>config-from-file</code>,
846330106Sdelphijto the NTP server host file
847344884Scy<kbd>filename</kbd>.
848275970ScyThis command will be rejected by the server unless
849344884Scy.Lk miscopt.html#saveconfigdir &quot;saveconfigdir&quot;
850275970Scyappears in the
851330106Sdelphij<code>ntpd(8)</code>
852344884Scyconfiguration file.
853275970Scy<kbd>filename</kbd>
854275970Scycan use
855330106Sdelphij<code>date(1)</code>
856330106Sdelphijformat specifiers to substitute the current date and time, for
857330106Sdelphijexample,
858344884Scy</p><div class="example">
859344884Scy<pre class="example"><code>saveconfig</code> <samp>ntp-%Y%m%d-%H%M%S.conf</samp>. 
860344884Scy</pre></div>
861344884Scy<p>The filename used is stored in system variable
862344884Scy<code>savedconfig</code>.
863344884ScyAuthentication is required.
864344884Scy</p></dd>
865344884Scy<dt><code>sysinfo</code></dt>
866344884Scy<dd><p>Display system operational summary:
867330106Sdelphijassocid, status, system peer, system peer mode, leap indicator,
868330106Sdelphijstratum, log2 precision, root delay, root dispersion,
869330106Sdelphijreference id, reference time, system jitter, clock jitter,
870344884Scyclock wander, broadcast delay, symm. auth. delay.
871344884Scy</p></dd>
872344884Scy<dt><code>sysstats</code></dt>
873344884Scy<dd><p>Display system uptime and packet counts maintained in the
874330106Sdelphijprotocol module:
875330106Sdelphijuptime, sysstats reset, packets received, current version,
876330106Sdelphijolder version, bad length or format, authentication failed,
877330106Sdelphijdeclined, restricted, rate limited, KoD responses,
878344884Scyprocessed for time.
879344884Scy</p></dd>
880344884Scy<dt><code>timerstats</code></dt>
881344884Scy<dd><p>Display interval timer counters:
882344884Scytime since reset, timer overruns, calls to transmit.
883344884Scy</p></dd>
884344884Scy<dt><code>writelist</code> <kbd>associd</kbd></dt>
885344884Scy<dd><p>Set all system or peer variables included in the variable list.
886344884Scy</p></dd>
887344884Scy<dt><code>writevar</code> <kbd>associd</kbd> <kbd>name</kbd>=<kbd>value</kbd> <code>[, ...]</code></dt>
888344884Scy<dd><p>Set the specified variables in the variable list.
889275970ScyIf the
890330106Sdelphij<kbd>associd</kbd>
891275970Scyis zero, the variables are from the
892275970Scy<a href="#System-Variables">System Variables</a>
893275970Scyname space, otherwise they are from the
894275970Scy<a href="#Peer-Variables">Peer Variables</a>
895344884Scyname space.
896275970ScyThe
897330106Sdelphij<kbd>associd</kbd>
898344884Scyis required, as the same name can occur in both spaces.
899344884ScyAuthentication is required.
900344884Scy</p></dd>
901275970Scy</dl>
902275970Scy
903344884Scy<a name="Status-Words-and-Kiss-Codes-1"></a>
904344884Scy<h4 class="subsubsection">1.1.1.2 Status Words and Kiss Codes</h4>
905275970Scy<p>The current state of the operating program is shown
906275970Scyin a set of status words
907344884Scymaintained by the system.
908344884ScyStatus information is also available on a per-association basis.
909330106SdelphijThese words are displayed by the
910330106Sdelphij<code>readlist</code>
911275970Scyand
912330106Sdelphij<code>associations</code>
913344884Scycommands both in hexadecimal and in decoded short tip strings.
914275970ScyThe codes, tips and short explanations are documented on the
915344884Scy.Lk decode.html &quot;Event Messages and Status Words&quot;
916344884Scypage.
917275970ScyThe page also includes a list of system and peer messages,
918275970Scythe code for the latest of which is included in the status word.
919344884Scy</p>
920344884Scy<p>Information resulting from protocol machine state transitions
921275970Scyis displayed using an informal set of ASCII strings called
922344884Scy.Lk decode.html#kiss &quot;kiss codes&quot; .
923344884ScyThe original purpose was for kiss-o&rsquo;-death (KoD) packets
924344884Scysent by the server to advise the client of an unusual condition.
925275970ScyThey are now displayed, when appropriate,
926275970Scyin the reference identifier field in various billboards.
927344884Scy</p>
928344884Scy<a name="System-Variables-1"></a>
929344884Scy<h4 class="subsubsection">1.1.1.3 System Variables</h4>
930275970Scy<p>The following system variables appear in the
931330106Sdelphij<code>readlist</code>
932344884Scybillboard.
933275970ScyNot all variables are displayed in some configurations.
934344884Scy</p>
935344884Scy<dl compact="compact">
936344884Scy<dt>Variable</dt>
937344884Scy<dd><p>Description
938344884Scy</p></dd>
939344884Scy<dt><code>status</code></dt>
940344884Scy<dd><p>.Lk decode.html#sys &quot;system status word&quot;
941344884Scy</p></dd>
942344884Scy<dt><code>version</code></dt>
943344884Scy<dd><p>NTP software version and build time
944344884Scy</p></dd>
945344884Scy<dt><code>processor</code></dt>
946344884Scy<dd><p>hardware platform and version
947344884Scy</p></dd>
948344884Scy<dt><code>system</code></dt>
949344884Scy<dd><p>operating system and version
950344884Scy</p></dd>
951344884Scy<dt><code>leap</code></dt>
952344884Scy<dd><p>leap warning indicator (0-3)
953344884Scy</p></dd>
954344884Scy<dt><code>stratum</code></dt>
955344884Scy<dd><p>stratum (1-15)
956344884Scy</p></dd>
957344884Scy<dt><code>precision</code></dt>
958344884Scy<dd><p>precision (log2 s)
959344884Scy</p></dd>
960344884Scy<dt><code>rootdelay</code></dt>
961344884Scy<dd><p>total roundtrip delay to the primary reference clock
962344884Scy</p></dd>
963344884Scy<dt><code>rootdisp</code></dt>
964344884Scy<dd><p>total dispersion to the primary reference clock
965344884Scy</p></dd>
966344884Scy<dt><code>refid</code></dt>
967344884Scy<dd><p>reference id or
968344884Scy.Lk decode.html#kiss &quot;kiss code&quot;
969344884Scy</p></dd>
970344884Scy<dt><code>reftime</code></dt>
971344884Scy<dd><p>reference time
972344884Scy</p></dd>
973344884Scy<dt><code>clock</code></dt>
974344884Scy<dd><p>date and time of day
975344884Scy</p></dd>
976344884Scy<dt><code>peer</code></dt>
977344884Scy<dd><p>system peer association id
978344884Scy</p></dd>
979344884Scy<dt><code>tc</code></dt>
980344884Scy<dd><p>time constant and poll exponent (log2 s) (3-17)
981344884Scy</p></dd>
982344884Scy<dt><code>mintc</code></dt>
983344884Scy<dd><p>minimum time constant (log2 s) (3-10)
984344884Scy</p></dd>
985344884Scy<dt><code>offset</code></dt>
986344884Scy<dd><p>combined offset of server relative to this host
987344884Scy</p></dd>
988344884Scy<dt><code>frequency</code></dt>
989344884Scy<dd><p>frequency drift (PPM) relative to hardware clock
990344884Scy</p></dd>
991344884Scy<dt><code>sys_jitter</code></dt>
992344884Scy<dd><p>combined system jitter
993344884Scy</p></dd>
994344884Scy<dt><code>clk_wander</code></dt>
995344884Scy<dd><p>clock frequency wander (PPM)
996344884Scy</p></dd>
997344884Scy<dt><code>clk_jitter</code></dt>
998344884Scy<dd><p>clock jitter
999344884Scy</p></dd>
1000344884Scy<dt><code>tai</code></dt>
1001344884Scy<dd><p>TAI-UTC offset (s)
1002344884Scy</p></dd>
1003344884Scy<dt><code>leapsec</code></dt>
1004344884Scy<dd><p>NTP seconds when the next leap second is/was inserted
1005344884Scy</p></dd>
1006344884Scy<dt><code>expire</code></dt>
1007344884Scy<dd><p>NTP seconds when the NIST leapseconds file expires
1008344884Scy</p></dd>
1009275970Scy</dl>
1010344884Scy<p>The jitter and wander statistics are exponentially-weighted RMS averages.
1011275970ScyThe system jitter is defined in the NTPv4 specification;
1012275970Scythe clock jitter statistic is computed by the clock discipline module.
1013344884Scy</p>
1014344884Scy<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
1015275970Scyadditional system variables are displayed,
1016275970Scyincluding some or all of the following,
1017275970Scydepending on the particular Autokey dance:
1018344884Scy</p><dl compact="compact">
1019344884Scy<dt>Variable</dt>
1020344884Scy<dd><p>Description
1021344884Scy</p></dd>
1022344884Scy<dt><code>host</code></dt>
1023344884Scy<dd><p>Autokey host name for this host
1024344884Scy</p></dd>
1025344884Scy<dt><code>ident</code></dt>
1026344884Scy<dd><p>Autokey group name for this host
1027344884Scy</p></dd>
1028344884Scy<dt><code>flags</code></dt>
1029344884Scy<dd><p>host flags  (see Autokey specification)
1030344884Scy</p></dd>
1031344884Scy<dt><code>digest</code></dt>
1032344884Scy<dd><p>OpenSSL message digest algorithm
1033344884Scy</p></dd>
1034344884Scy<dt><code>signature</code></dt>
1035344884Scy<dd><p>OpenSSL digest/signature scheme
1036344884Scy</p></dd>
1037344884Scy<dt><code>update</code></dt>
1038344884Scy<dd><p>NTP seconds at last signature update
1039344884Scy</p></dd>
1040344884Scy<dt><code>cert</code></dt>
1041344884Scy<dd><p>certificate subject, issuer and certificate flags
1042344884Scy</p></dd>
1043344884Scy<dt><code>until</code></dt>
1044344884Scy<dd><p>NTP seconds when the certificate expires
1045344884Scy</p></dd>
1046275970Scy</dl>
1047344884Scy<a name="Peer-Variables-1"></a>
1048344884Scy<h4 class="subsubsection">1.1.1.4 Peer Variables</h4>
1049275970Scy<p>The following peer variables appear in the
1050330106Sdelphij<code>readlist</code>
1051344884Scybillboard for each association.
1052275970ScyNot all variables are displayed in some configurations.
1053344884Scy</p>
1054344884Scy<dl compact="compact">
1055344884Scy<dt>Variable</dt>
1056344884Scy<dd><p>Description
1057344884Scy</p></dd>
1058344884Scy<dt><code>associd</code></dt>
1059344884Scy<dd><p>association id
1060344884Scy</p></dd>
1061344884Scy<dt><code>status</code></dt>
1062344884Scy<dd><p>.Lk decode.html#peer &quot;peer status word&quot;
1063344884Scy</p></dd>
1064344884Scy<dt><code>srcadr</code></dt>
1065344884Scy<dd><p>source (remote) IP address
1066344884Scy</p></dd>
1067344884Scy<dt><code>srcport</code></dt>
1068344884Scy<dd><p>source (remote) port
1069344884Scy</p></dd>
1070344884Scy<dt><code>dstadr</code></dt>
1071344884Scy<dd><p>destination (local) IP address
1072344884Scy</p></dd>
1073344884Scy<dt><code>dstport</code></dt>
1074344884Scy<dd><p>destination (local) port
1075344884Scy</p></dd>
1076344884Scy<dt><code>leap</code></dt>
1077344884Scy<dd><p>leap indicator (0-3)
1078344884Scy</p></dd>
1079344884Scy<dt><code>stratum</code></dt>
1080344884Scy<dd><p>stratum (0-15)
1081344884Scy</p></dd>
1082344884Scy<dt><code>precision</code></dt>
1083344884Scy<dd><p>precision (log2 s)
1084344884Scy</p></dd>
1085344884Scy<dt><code>rootdelay</code></dt>
1086344884Scy<dd><p>total roundtrip delay to the primary reference clock
1087344884Scy</p></dd>
1088344884Scy<dt><code>rootdisp</code></dt>
1089344884Scy<dd><p>total root dispersion to the primary reference clock
1090344884Scy</p></dd>
1091344884Scy<dt><code>refid</code></dt>
1092344884Scy<dd><p>reference id or
1093344884Scy.Lk decode.html#kiss &quot;kiss code&quot;
1094344884Scy</p></dd>
1095344884Scy<dt><code>reftime</code></dt>
1096344884Scy<dd><p>reference time
1097344884Scy</p></dd>
1098344884Scy<dt><code>rec</code></dt>
1099344884Scy<dd><p>last packet received time
1100344884Scy</p></dd>
1101344884Scy<dt><code>reach</code></dt>
1102344884Scy<dd><p>reach register (octal)
1103344884Scy</p></dd>
1104344884Scy<dt><code>unreach</code></dt>
1105344884Scy<dd><p>unreach counter
1106344884Scy</p></dd>
1107344884Scy<dt><code>hmode</code></dt>
1108344884Scy<dd><p>host mode (1-6)
1109344884Scy</p></dd>
1110344884Scy<dt><code>pmode</code></dt>
1111344884Scy<dd><p>peer mode (1-5)
1112344884Scy</p></dd>
1113344884Scy<dt><code>hpoll</code></dt>
1114344884Scy<dd><p>host poll exponent (log2 s) (3-17)
1115344884Scy</p></dd>
1116344884Scy<dt><code>ppoll</code></dt>
1117344884Scy<dd><p>peer poll exponent (log2 s) (3-17)
1118344884Scy</p></dd>
1119344884Scy<dt><code>headway</code></dt>
1120344884Scy<dd><p>headway (see
1121344884Scy.Lk rate.html &quot;Rate Management and the Kiss-o&rsquo;-Death Packet&quot; )
1122344884Scy</p></dd>
1123344884Scy<dt><code>flash</code></dt>
1124344884Scy<dd><p>.Lk decode.html#flash &quot;flash status word&quot;
1125344884Scy</p></dd>
1126344884Scy<dt><code>keyid</code></dt>
1127344884Scy<dd><p>symmetric key id
1128344884Scy</p></dd>
1129344884Scy<dt><code>offset</code></dt>
1130344884Scy<dd><p>filter offset
1131344884Scy</p></dd>
1132344884Scy<dt><code>delay</code></dt>
1133344884Scy<dd><p>filter delay
1134344884Scy</p></dd>
1135344884Scy<dt><code>dispersion</code></dt>
1136344884Scy<dd><p>filter dispersion
1137344884Scy</p></dd>
1138344884Scy<dt><code>jitter</code></dt>
1139344884Scy<dd><p>filter jitter
1140344884Scy</p></dd>
1141344884Scy<dt><code>bias</code></dt>
1142344884Scy<dd><p>unicast/broadcast bias
1143344884Scy</p></dd>
1144344884Scy<dt><code>xleave</code></dt>
1145344884Scy<dd><p>interleave delay (see
1146344884Scy.Lk xleave.html &quot;NTP Interleaved Modes&quot; )
1147344884Scy</p></dd>
1148275970Scy</dl>
1149344884Scy<p>The
1150275970Scy<code>bias</code>
1151275970Scyvariable is calculated when the first broadcast packet is received
1152344884Scyafter the calibration volley.
1153330106SdelphijIt represents the offset of the broadcast subgraph relative to the
1154344884Scyunicast subgraph.
1155275970ScyThe
1156275970Scy<code>xleave</code>
1157344884Scyvariable appears only for the interleaved symmetric and interleaved modes.
1158275970ScyIt represents the internal queuing, buffering and transmission delays
1159275970Scyfor the preceding packet.
1160344884Scy</p>
1161344884Scy<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
1162275970Scyadditional peer variables are displayed, including the following:
1163344884Scy</p><dl compact="compact">
1164344884Scy<dt>Variable</dt>
1165344884Scy<dd><p>Description
1166344884Scy</p></dd>
1167344884Scy<dt><code>flags</code></dt>
1168344884Scy<dd><p>peer flags (see Autokey specification)
1169344884Scy</p></dd>
1170344884Scy<dt><code>host</code></dt>
1171344884Scy<dd><p>Autokey server name
1172344884Scy</p></dd>
1173344884Scy<dt><code>flags</code></dt>
1174344884Scy<dd><p>peer flags (see Autokey specification)
1175344884Scy</p></dd>
1176344884Scy<dt><code>signature</code></dt>
1177344884Scy<dd><p>OpenSSL digest/signature scheme
1178344884Scy</p></dd>
1179344884Scy<dt><code>initsequence</code></dt>
1180344884Scy<dd><p>initial key id
1181344884Scy</p></dd>
1182344884Scy<dt><code>initkey</code></dt>
1183344884Scy<dd><p>initial key index
1184344884Scy</p></dd>
1185344884Scy<dt><code>timestamp</code></dt>
1186344884Scy<dd><p>Autokey signature timestamp
1187344884Scy</p></dd>
1188344884Scy<dt><code>ident</code></dt>
1189344884Scy<dd><p>Autokey group name for this association
1190344884Scy</p></dd>
1191275970Scy</dl>
1192275970Scy
1193344884Scy<a name="Clock-Variables-1"></a>
1194344884Scy<h4 class="subsubsection">1.1.1.5 Clock Variables</h4>
1195275970Scy<p>The following clock variables appear in the
1196330106Sdelphij<code>clocklist</code>
1197344884Scybillboard for each association with a reference clock.
1198275970ScyNot all variables are displayed in some configurations.
1199344884Scy</p><dl compact="compact">
1200344884Scy<dt>Variable</dt>
1201344884Scy<dd><p>Description
1202344884Scy</p></dd>
1203344884Scy<dt><code>associd</code></dt>
1204344884Scy<dd><p>association id
1205344884Scy</p></dd>
1206344884Scy<dt><code>status</code></dt>
1207344884Scy<dd><p>.Lk decode.html#clock &quot;clock status word&quot;
1208344884Scy</p></dd>
1209344884Scy<dt><code>device</code></dt>
1210344884Scy<dd><p>device description
1211344884Scy</p></dd>
1212344884Scy<dt><code>timecode</code></dt>
1213344884Scy<dd><p>ASCII time code string (specific to device)
1214344884Scy</p></dd>
1215344884Scy<dt><code>poll</code></dt>
1216344884Scy<dd><p>poll messages sent
1217344884Scy</p></dd>
1218344884Scy<dt><code>noreply</code></dt>
1219344884Scy<dd><p>no reply
1220344884Scy</p></dd>
1221344884Scy<dt><code>badformat</code></dt>
1222344884Scy<dd><p>bad format
1223344884Scy</p></dd>
1224344884Scy<dt><code>baddata</code></dt>
1225344884Scy<dd><p>bad date or time
1226344884Scy</p></dd>
1227344884Scy<dt><code>fudgetime1</code></dt>
1228344884Scy<dd><p>fudge time 1
1229344884Scy</p></dd>
1230344884Scy<dt><code>fudgetime2</code></dt>
1231344884Scy<dd><p>fudge time 2
1232344884Scy</p></dd>
1233344884Scy<dt><code>stratum</code></dt>
1234344884Scy<dd><p>driver stratum
1235344884Scy</p></dd>
1236344884Scy<dt><code>refid</code></dt>
1237344884Scy<dd><p>driver reference id
1238344884Scy</p></dd>
1239344884Scy<dt><code>flags</code></dt>
1240344884Scy<dd><p>driver flags
1241344884Scy</p></dd>
1242275970Scy</dl>
1243275970Scy
1244344884Scy<p>This section was generated by <strong>AutoGen</strong>,
1245344884Scyusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpq</code> program.
1246275970ScyThis software is released under the NTP license, &lt;http://ntp.org/license>;.
1247344884Scy</p>
1248344884Scy<table class="menu" border="0" cellspacing="0">
1249344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-usage" accesskey="1">ntpq usage</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ntpq help/usage (<samp>--help</samp>)
1250344884Scy</td></tr>
1251344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-ipv4" accesskey="2">ntpq ipv4</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ipv4 option (-4)
1252344884Scy</td></tr>
1253344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-ipv6" accesskey="3">ntpq ipv6</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ipv6 option (-6)
1254344884Scy</td></tr>
1255344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-command" accesskey="4">ntpq command</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">command option (-c)
1256344884Scy</td></tr>
1257344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-interactive" accesskey="5">ntpq interactive</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">interactive option (-i)
1258344884Scy</td></tr>
1259344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-numeric" accesskey="6">ntpq numeric</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">numeric option (-n)
1260344884Scy</td></tr>
1261344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-old_002drv" accesskey="7">ntpq old-rv</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">old-rv option
1262344884Scy</td></tr>
1263344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-peers" accesskey="8">ntpq peers</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">peers option (-p)
1264344884Scy</td></tr>
1265344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-refid" accesskey="9">ntpq refid</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">refid option (-r)
1266344884Scy</td></tr>
1267344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-wide">ntpq wide</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">wide option (-w)
1268344884Scy</td></tr>
1269344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-config">ntpq config</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">presetting/configuring ntpq
1270344884Scy</td></tr>
1271344884Scy<tr><td align="left" valign="top">&bull; <a href="#ntpq-exit-status">ntpq exit status</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">exit status
1272344884Scy</td></tr>
1273344884Scy</table>
1274275970Scy
1275344884Scy<hr>
1276344884Scy<a name="ntpq-usage"></a>
1277344884Scy<div class="header">
1278344884Scy<p>
1279344884ScyNext: <a href="#ntpq-ipv4" accesskey="n" rel="next">ntpq ipv4</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1280275970Scy</div>
1281344884Scy<a name="ntpq-help_002fusage-_0028_002d_002dhelp_0029"></a>
1282344884Scy<h4 class="subsection">1.1.2 ntpq help/usage (<samp>--help</samp>)</h4>
1283344884Scy<a name="index-ntpq-help"></a>
1284275970Scy
1285344884Scy<p>This is the automatically generated usage text for ntpq.
1286344884Scy</p>
1287344884Scy<p>The text printed is the same whether selected with the <code>help</code> option
1288344884Scy(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
1289344884Scythe usage text by passing it through a pager program.
1290275970Scy<code>more-help</code> is disabled on platforms without a working
1291275970Scy<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
1292344884Scyused to select the program, defaulting to <samp>more</samp>.  Both will exit
1293275970Scywith a status code of 0.
1294344884Scy</p>
1295344884Scy<div class="example">
1296362716Scy<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p14
1297275970ScyUsage:  ntpq [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
1298275970Scy  Flg Arg Option-Name    Description
1299330106Sdelphij   -4 no  ipv4           Force IPv4 name resolution
1300275970Scy                                - prohibits the option 'ipv6'
1301330106Sdelphij   -6 no  ipv6           Force IPv6 name resolution
1302275970Scy                                - prohibits the option 'ipv4'
1303275970Scy   -c Str command        run a command and exit
1304275970Scy                                - may appear multiple times
1305275970Scy   -d no  debug-level    Increase debug verbosity level
1306275970Scy                                - may appear multiple times
1307275970Scy   -D Num set-debug-level Set the debug verbosity level
1308275970Scy                                - may appear multiple times
1309275970Scy   -i no  interactive    Force ntpq to operate in interactive mode
1310275970Scy                                - prohibits these options:
1311275970Scy                                command
1312275970Scy                                peers
1313275970Scy   -n no  numeric        numeric host addresses
1314275970Scy      no  old-rv         Always output status line with readvar
1315275970Scy   -p no  peers          Print a list of the peers
1316275970Scy                                - prohibits the option 'interactive'
1317298695Sdelphij   -r KWd refid          Set default display type for S2+ refids
1318275970Scy   -w no  wide           Display the full 'remote' value
1319275970Scy      opt version        output version information and exit
1320275970Scy   -? no  help           display extended usage information and exit
1321275970Scy   -! no  more-help      extended usage information passed thru pager
1322275970Scy   -&gt; opt save-opts      save the option state to a config file
1323275970Scy   -&lt; Str load-opts      load options from a config file
1324275970Scy                                - disabled as '--no-load-opts'
1325275970Scy                                - may appear multiple times
1326275970Scy
1327275970ScyOptions are specified by doubled hyphens and their name or by a single
1328275970Scyhyphen and the flag character.
1329275970Scy
1330275970ScyThe following option preset mechanisms are supported:
1331275970Scy - reading file $HOME/.ntprc
1332275970Scy - reading file ./.ntprc
1333275970Scy - examining environment variables named NTPQ_*
1334275970Scy
1335344884ScyThe valid &quot;refid&quot; option keywords are:
1336298695Sdelphij  hash ipv4
1337298695Sdelphij  or an integer from 0 through 1
1338298695Sdelphij
1339275970ScyPlease send bug reports to:  &lt;http://bugs.ntp.org, bugs@ntp.org&gt;
1340344884Scy</pre></div>
1341344884Scy
1342344884Scy<hr>
1343344884Scy<a name="ntpq-ipv4"></a>
1344344884Scy<div class="header">
1345344884Scy<p>
1346344884ScyNext: <a href="#ntpq-ipv6" accesskey="n" rel="next">ntpq ipv6</a>, Previous: <a href="#ntpq-usage" accesskey="p" rel="prev">ntpq usage</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1347275970Scy</div>
1348344884Scy<a name="ipv4-option-_0028_002d4_0029"></a>
1349344884Scy<h4 class="subsection">1.1.3 ipv4 option (-4)</h4>
1350344884Scy<a name="index-ntpq_002dipv4"></a>
1351275970Scy
1352344884Scy<p>This is the &ldquo;force ipv4 name resolution&rdquo; option.
1353344884Scy</p>
1354344884Scy<p>This option has some usage constraints.  It:
1355344884Scy</p><ul>
1356344884Scy<li> must not appear in combination with any of the following options:
1357344884Scyipv6.
1358344884Scy</li></ul>
1359275970Scy
1360344884Scy<p>Force resolution of following host names on the command line
1361344884Scyto the IPv4 namespace.
1362344884Scy</p><hr>
1363344884Scy<a name="ntpq-ipv6"></a>
1364344884Scy<div class="header">
1365344884Scy<p>
1366344884ScyNext: <a href="#ntpq-command" accesskey="n" rel="next">ntpq command</a>, Previous: <a href="#ntpq-ipv4" accesskey="p" rel="prev">ntpq ipv4</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1367275970Scy</div>
1368344884Scy<a name="ipv6-option-_0028_002d6_0029"></a>
1369344884Scy<h4 class="subsection">1.1.4 ipv6 option (-6)</h4>
1370344884Scy<a name="index-ntpq_002dipv6"></a>
1371275970Scy
1372344884Scy<p>This is the &ldquo;force ipv6 name resolution&rdquo; option.
1373344884Scy</p>
1374344884Scy<p>This option has some usage constraints.  It:
1375344884Scy</p><ul>
1376344884Scy<li> must not appear in combination with any of the following options:
1377344884Scyipv4.
1378344884Scy</li></ul>
1379275970Scy
1380344884Scy<p>Force resolution of following host names on the command line
1381344884Scyto the IPv6 namespace.
1382344884Scy</p><hr>
1383344884Scy<a name="ntpq-command"></a>
1384344884Scy<div class="header">
1385344884Scy<p>
1386344884ScyNext: <a href="#ntpq-interactive" accesskey="n" rel="next">ntpq interactive</a>, Previous: <a href="#ntpq-ipv6" accesskey="p" rel="prev">ntpq ipv6</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1387275970Scy</div>
1388344884Scy<a name="command-option-_0028_002dc_0029"></a>
1389344884Scy<h4 class="subsection">1.1.5 command option (-c)</h4>
1390344884Scy<a name="index-ntpq_002dcommand"></a>
1391275970Scy
1392344884Scy<p>This is the &ldquo;run a command and exit&rdquo; option.
1393344884ScyThis option takes a string argument <samp>cmd</samp>.
1394344884Scy</p>
1395344884Scy<p>This option has some usage constraints.  It:
1396344884Scy</p><ul>
1397344884Scy<li> may appear an unlimited number of times.
1398344884Scy</li></ul>
1399275970Scy
1400344884Scy<p>The following argument is interpreted as an interactive format command
1401275970Scyand is added to the list of commands to be executed on the specified
1402344884Scyhost(s).
1403344884Scy</p><hr>
1404344884Scy<a name="ntpq-interactive"></a>
1405344884Scy<div class="header">
1406344884Scy<p>
1407344884ScyNext: <a href="#ntpq-numeric" accesskey="n" rel="next">ntpq numeric</a>, Previous: <a href="#ntpq-command" accesskey="p" rel="prev">ntpq command</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1408275970Scy</div>
1409344884Scy<a name="interactive-option-_0028_002di_0029"></a>
1410344884Scy<h4 class="subsection">1.1.6 interactive option (-i)</h4>
1411344884Scy<a name="index-ntpq_002dinteractive"></a>
1412275970Scy
1413344884Scy<p>This is the &ldquo;force ntpq to operate in interactive mode&rdquo; option.
1414344884Scy</p>
1415344884Scy<p>This option has some usage constraints.  It:
1416344884Scy</p><ul>
1417344884Scy<li> must not appear in combination with any of the following options:
1418344884Scycommand, peers.
1419344884Scy</li></ul>
1420275970Scy
1421344884Scy<p>Force <code>ntpq</code> to operate in interactive mode.
1422275970ScyPrompts will be written to the standard output and
1423344884Scycommands read from the standard input.
1424344884Scy</p><hr>
1425344884Scy<a name="ntpq-numeric"></a>
1426344884Scy<div class="header">
1427344884Scy<p>
1428344884ScyNext: <a href="#ntpq-old_002drv" accesskey="n" rel="next">ntpq old-rv</a>, Previous: <a href="#ntpq-interactive" accesskey="p" rel="prev">ntpq interactive</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1429275970Scy</div>
1430344884Scy<a name="numeric-option-_0028_002dn_0029"></a>
1431344884Scy<h4 class="subsection">1.1.7 numeric option (-n)</h4>
1432344884Scy<a name="index-ntpq_002dnumeric"></a>
1433275970Scy
1434344884Scy<p>This is the &ldquo;numeric host addresses&rdquo; option.
1435275970ScyOutput all host addresses in dotted-quad numeric format rather than
1436344884Scyconverting to the canonical host names.
1437344884Scy</p><hr>
1438344884Scy<a name="ntpq-old_002drv"></a>
1439344884Scy<div class="header">
1440344884Scy<p>
1441344884ScyNext: <a href="#ntpq-peers" accesskey="n" rel="next">ntpq peers</a>, Previous: <a href="#ntpq-numeric" accesskey="p" rel="prev">ntpq numeric</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1442275970Scy</div>
1443344884Scy<a name="old_002drv-option"></a>
1444344884Scy<h4 class="subsection">1.1.8 old-rv option</h4>
1445344884Scy<a name="index-ntpq_002dold_002drv"></a>
1446275970Scy
1447344884Scy<p>This is the &ldquo;always output status line with readvar&rdquo; option.
1448275970ScyBy default, <code>ntpq</code> now suppresses the <code>associd=...</code>
1449275970Scyline that precedes the output of <code>readvar</code>
1450275970Scy(alias <code>rv</code>) when a single variable is requested, such as
1451344884Scy<code>ntpq -c &quot;rv 0 offset&quot;</code>.
1452275970ScyThis option causes <code>ntpq</code> to include both lines of output
1453344884Scyfor a single-variable <code>readvar</code>.
1454275970ScyUsing an environment variable to
1455275970Scypreset this option in a script will enable both older and
1456344884Scynewer <code>ntpq</code> to behave identically in this regard.
1457344884Scy</p><hr>
1458344884Scy<a name="ntpq-peers"></a>
1459344884Scy<div class="header">
1460344884Scy<p>
1461344884ScyNext: <a href="#ntpq-refid" accesskey="n" rel="next">ntpq refid</a>, Previous: <a href="#ntpq-old_002drv" accesskey="p" rel="prev">ntpq old-rv</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1462275970Scy</div>
1463344884Scy<a name="peers-option-_0028_002dp_0029"></a>
1464344884Scy<h4 class="subsection">1.1.9 peers option (-p)</h4>
1465344884Scy<a name="index-ntpq_002dpeers"></a>
1466275970Scy
1467344884Scy<p>This is the &ldquo;print a list of the peers&rdquo; option.
1468344884Scy</p>
1469344884Scy<p>This option has some usage constraints.  It:
1470344884Scy</p><ul>
1471344884Scy<li> must not appear in combination with any of the following options:
1472344884Scyinteractive.
1473344884Scy</li></ul>
1474275970Scy
1475344884Scy<p>Print a list of the peers known to the server as well as a summary
1476344884Scyof their state. This is equivalent to the &rsquo;peers&rsquo; interactive command.
1477344884Scy</p><hr>
1478344884Scy<a name="ntpq-refid"></a>
1479344884Scy<div class="header">
1480344884Scy<p>
1481344884ScyNext: <a href="#ntpq-wide" accesskey="n" rel="next">ntpq wide</a>, Previous: <a href="#ntpq-peers" accesskey="p" rel="prev">ntpq peers</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1482275970Scy</div>
1483344884Scy<a name="refid-option-_0028_002dr_0029"></a>
1484344884Scy<h4 class="subsection">1.1.10 refid option (-r)</h4>
1485344884Scy<a name="index-ntpq_002drefid"></a>
1486275970Scy
1487344884Scy<p>This is the &ldquo;set default display type for s2+ refids&rdquo; option.
1488298695SdelphijThis option takes a keyword argument.
1489344884Scy</p>
1490344884Scy<p>This option has some usage constraints.  It:
1491344884Scy</p><ul>
1492344884Scy<li> This option takes a keyword as its argument.
1493344884ScyThe argument sets an enumeration value that can be tested by comparing the option value macro (OPT_VALUE_REFID).
1494298695SdelphijThe available keywords are:
1495344884Scy<div class="example">
1496344884Scy<pre class="example">    hash ipv4
1497344884Scy</pre></div>
1498298695Sdelphij
1499344884Scy<p>or their numeric equivalent.</p></li></ul>
1500344884Scy
1501344884Scy<p>Set the default display format for S2+ refids.
1502344884Scy</p><hr>
1503344884Scy<a name="ntpq-wide"></a>
1504344884Scy<div class="header">
1505344884Scy<p>
1506344884ScyNext: <a href="#ntpq-config" accesskey="n" rel="next">ntpq config</a>, Previous: <a href="#ntpq-refid" accesskey="p" rel="prev">ntpq refid</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1507298695Sdelphij</div>
1508344884Scy<a name="wide-option-_0028_002dw_0029"></a>
1509344884Scy<h4 class="subsection">1.1.11 wide option (-w)</h4>
1510344884Scy<a name="index-ntpq_002dwide"></a>
1511298695Sdelphij
1512344884Scy<p>This is the &ldquo;display the full &rsquo;remote&rsquo; value&rdquo; option.
1513344884ScyDisplay the full value of the &rsquo;remote&rsquo; value.  If this requires
1514275970Scymore than 15 characters, display the full value, emit a newline,
1515275970Scyand continue the data display properly indented on the next line.
1516344884Scy</p>
1517275970Scy
1518344884Scy<hr>
1519344884Scy<a name="ntpq-config"></a>
1520344884Scy<div class="header">
1521344884Scy<p>
1522344884ScyNext: <a href="#ntpq-exit-status" accesskey="n" rel="next">ntpq exit status</a>, Previous: <a href="#ntpq-wide" accesskey="p" rel="prev">ntpq wide</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1523275970Scy</div>
1524344884Scy<a name="presetting_002fconfiguring-ntpq"></a>
1525344884Scy<h4 class="subsection">1.1.12 presetting/configuring ntpq</h4>
1526275970Scy
1527275970Scy<p>Any option that is not marked as <i>not presettable</i> may be preset by
1528344884Scyloading values from configuration (&quot;rc&quot; or &quot;ini&quot;) files, and values from environment variables named <code>NTPQ</code> and <code>NTPQ_&lt;OPTION_NAME&gt;</code>.  <code>&lt;OPTION_NAME&gt;</code> must be one of
1529344884Scythe options listed above in upper case and segmented with underscores.
1530275970ScyThe <code>NTPQ</code> variable will be tokenized and parsed like
1531275970Scythe command line.  The remaining variables are tested for existence and their
1532275970Scyvalues are treated like option arguments.
1533344884Scy</p>
1534275970Scy
1535344884Scy<p><code>libopts</code> will search in 2 places for configuration files:
1536344884Scy</p><ul>
1537344884Scy<li> $HOME
1538344884Scy</li><li> $PWD
1539344884Scy</li></ul>
1540344884Scy<p>The environment variables <code>HOME</code>, and <code>PWD</code>
1541344884Scyare expanded and replaced when <samp>ntpq</samp> runs.
1542344884ScyFor any of these that are plain files, they are simply processed.
1543344884ScyFor any that are directories, then a file named <samp>.ntprc</samp> is searched for
1544275970Scywithin that directory and processed.
1545344884Scy</p>
1546344884Scy<p>Configuration files may be in a wide variety of formats.
1547275970ScyThe basic format is an option name followed by a value (argument) on the
1548275970Scysame line.  Values may be separated from the option name with a colon,
1549275970Scyequal sign or simply white space.  Values may be continued across multiple
1550275970Scylines by escaping the newline with a backslash.
1551344884Scy</p>
1552344884Scy<p>Multiple programs may also share the same initialization file.
1553275970ScyCommon options are collected at the top, followed by program specific
1554275970Scysegments.  The segments are separated by lines like:
1555344884Scy</p><div class="example">
1556344884Scy<pre class="example">[NTPQ]
1557344884Scy</pre></div>
1558344884Scy<p>or by
1559344884Scy</p><div class="example">
1560344884Scy<pre class="example">&lt;?program ntpq&gt;
1561344884Scy</pre></div>
1562344884Scy<p>Do not mix these styles within one configuration file.
1563344884Scy</p>
1564344884Scy<p>Compound values and carefully constructed string values may also be
1565275970Scyspecified using XML syntax:
1566344884Scy</p><div class="example">
1567344884Scy<pre class="example">&lt;option-name&gt;
1568344884Scy   &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
1569344884Scy&lt;/option-name&gt;
1570344884Scy</pre></div>
1571344884Scy<p>yielding an <code>option-name.sub-opt</code> string value of
1572344884Scy</p><div class="example">
1573344884Scy<pre class="example">&quot;...&lt;...&gt;...&quot;
1574344884Scy</pre></div>
1575344884Scy<p><code>AutoOpts</code> does not track suboptions.  You simply note that it is a
1576275970Scyhierarchicly valued option.  <code>AutoOpts</code> does provide a means for searching
1577275970Scythe associated name/value pair list (see: optionFindValue).
1578344884Scy</p>
1579344884Scy<p>The command line options relating to configuration and/or usage help are:
1580344884Scy</p>
1581344884Scy<a name="version-_0028_002d_0029"></a>
1582344884Scy<h4 class="subsubheading">version (-)</h4>
1583275970Scy
1584275970Scy<p>Print the program version to standard out, optionally with licensing
1585275970Scyinformation, then exit 0.  The optional argument specifies how much licensing
1586344884Scydetail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument.
1587275970ScyOnly the first letter of the argument is examined:
1588344884Scy</p>
1589344884Scy<dl compact="compact">
1590344884Scy<dt>&lsquo;<samp>version</samp>&rsquo;</dt>
1591344884Scy<dd><p>Only print the version.  This is the default.
1592344884Scy</p></dd>
1593344884Scy<dt>&lsquo;<samp>copyright</samp>&rsquo;</dt>
1594344884Scy<dd><p>Name the copyright usage licensing terms.
1595344884Scy</p></dd>
1596344884Scy<dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
1597344884Scy<dd><p>Print the full copyright usage licensing terms.
1598344884Scy</p></dd>
1599275970Scy</dl>
1600275970Scy
1601344884Scy<hr>
1602344884Scy<a name="ntpq-exit-status"></a>
1603344884Scy<div class="header">
1604344884Scy<p>
1605344884ScyPrevious: <a href="#ntpq-config" accesskey="p" rel="prev">ntpq config</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1606275970Scy</div>
1607344884Scy<a name="ntpq-exit-status-1"></a>
1608344884Scy<h4 class="subsection">1.1.13 ntpq exit status</h4>
1609275970Scy
1610275970Scy<p>One of the following exit values will be returned:
1611344884Scy</p><dl compact="compact">
1612344884Scy<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
1613344884Scy<dd><p>Successful program execution.
1614344884Scy</p></dd>
1615344884Scy<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
1616344884Scy<dd><p>The operation failed or the command syntax was not valid.
1617344884Scy</p></dd>
1618344884Scy<dt>&lsquo;<samp>66 (EX_NOINPUT)</samp>&rsquo;</dt>
1619344884Scy<dd><p>A specified configuration file could not be loaded.
1620344884Scy</p></dd>
1621344884Scy<dt>&lsquo;<samp>70 (EX_SOFTWARE)</samp>&rsquo;</dt>
1622344884Scy<dd><p>libopts had an internal operational error.  Please report
1623344884Scyit to autogen-users@lists.sourceforge.net.  Thank you.
1624344884Scy</p></dd>
1625275970Scy</dl>
1626275970Scy
1627344884Scy<hr>
1628344884Scy<a name="Usage"></a>
1629344884Scy<div class="header">
1630344884Scy<p>
1631344884ScyNext: <a href="#Internal-Commands" accesskey="n" rel="next">Internal Commands</a>, Previous: <a href="#ntpq-Description" accesskey="p" rel="prev">ntpq Description</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
1632275970Scy</div>
1633344884Scy<a name="Usage-1"></a>
1634344884Scy<h3 class="section">1.2 Usage</h3>
1635275970Scy
1636344884Scy<table>
1637344884Scy<thead><tr><th width="23%">What</th><th width="23%">Default</th><th width="5%">Flag</th><th width="15%">Option</th></tr></thead>
1638344884Scy<tr><td width="23%">configuration file</td><td width="23%"><code>/etc/ntp.conf</code></td><td width="5%"><code>-c</code></td><td width="15%"><code>conffile</code></td></tr>
1639344884Scy<tr><td width="23%">frequency file</td><td width="23%">none</td><td width="5%"><code>-f</code></td><td width="15%"><code>driftfile</code></td></tr>
1640344884Scy<tr><td width="23%">leapseconds file</td><td width="23%">none</td><td width="5%"></td><td width="15%"><code>leapfile</code></td></tr>
1641344884Scy<tr><td width="23%">process ID file</td><td width="23%">none</td><td width="5%"><code>-p</code></td><td width="15%"><code>pidfile</code></td></tr>
1642344884Scy<tr><td width="23%">log file</td><td width="23%">system log</td><td width="5%"><code>-l</code></td><td width="15%"><code>logfile</code></td></tr>
1643344884Scy<tr><td width="23%">include file</td><td width="23%">none</td><td width="5%">none</td><td width="15%"><code>includefile</code></td></tr>
1644344884Scy<tr><td width="23%">statistics path</td><td width="23%"><code>/var/NTP</code></td><td width="5%"><code>-s</code></td><td width="15%"><code>statsdir</code></td></tr>
1645344884Scy<tr><td width="23%">keys path</td><td width="23%"><code>/usr/local/etc</code></td><td width="5%"><code>-k</code></td><td width="15%"><code>keysdir</code></td></tr>
1646344884Scy</table>
1647275970Scy
1648344884Scy<hr>
1649344884Scy<a name="Internal-Commands"></a>
1650344884Scy<div class="header">
1651344884Scy<p>
1652344884ScyNext: <a href="#Control-Message-Commands" accesskey="n" rel="next">Control Message Commands</a>, Previous: <a href="#Usage" accesskey="p" rel="prev">Usage</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
1653275970Scy</div>
1654344884Scy<a name="Internal-Commands-2"></a>
1655344884Scy<h3 class="section">1.3 Internal Commands</h3>
1656275970Scy
1657275970Scy<p>Interactive format commands consist of a keyword followed by zero to four arguments.  Only enough characters of the full keyword to uniquely identify the command need be typed.  The output of a command is normally sent to the standard output, but optionally the output of individual commands may be sent to a file by appending a <code>&gt;</code>, followed by a file name, to the command line.  A number of interactive format commands are executed entirely within the <code>ntpq</code> program itself and do not result in NTP mode-6 requests being sent to a server.  These are described following.
1658344884Scy</p>
1659344884Scy<dl compact="compact">
1660344884Scy<dt><code><a name="help"></a><code>? [</code><kbd>command_keyword</kbd><code>]</code></code></dt>
1661344884Scy<dt><code><code>help [</code><kbd>command_keyword</kbd><code>]</code></code></dt>
1662344884Scy<dd><p>A <code>?</code> by itself will print a list of all the command keywords known to <code>ntpq</code>.  A <code>?</code> followed by a command keyword will print function and usage information about the command.
1663344884Scy</p>
1664344884Scy</dd>
1665344884Scy<dt><code><a name="addvars"></a>&gt;<code>addvars <kbd>name</kbd> [ = <kbd>value</kbd>] [...]</code></code></dt>
1666344884Scy<dt><code><code>rmvars <kbd>name</kbd> [...]</code></code></dt>
1667344884Scy<dt><code><code>clearvars</code>&lt;/dt&gt;</code></dt>
1668344884Scy<dd><p>The arguments to these commands consist of a list of items of the form
1669344884Scy<code><kbd>name</kbd> = <kbd>value</kbd></code>, where the <code>= <kbd>value</kbd></code> is ignored,
1670344884Scyand can be omitted in read requests.
1671275970Scy<code>ntpq</code> maintains an internal list in which data to be included
1672275970Scyin control messages can be assembled, and sent using the <code>readlist</code>
1673344884Scyand <code>writelist</code> commands described below.
1674275970ScyThe <code>addvars</code> command allows variables and optional values
1675344884Scyto be added to the list.
1676275970ScyIf more than one variable is to be added
1677344884Scythe list should be comma-separated and not contain white space.
1678275970ScyThe <code>rmvars</code> command can be used to remove individual variables
1679275970Scyfrom the list,
1680275970Scywhile the <code>clearlist</code> command removes all variables from the list.
1681344884Scy</p>
1682344884Scy</dd>
1683344884Scy<dt><code><a name="cooked"></a><code>cooked</code></code></dt>
1684344884Scy<dd><p>Display server messages in prettyprint format.
1685344884Scy</p>
1686344884Scy</dd>
1687344884Scy<dt><code><a name="debug"></a><code>debug more | less | off</code></code></dt>
1688344884Scy<dd><p>Turns internal query program debugging on and off.
1689344884Scy</p>
1690344884Scy</dd>
1691344884Scy<dt><code><a name="delay"></a><code>delay <kbd>milliseconds</kbd></code></code></dt>
1692344884Scy<dd><p>Specify a time interval to be added to timestamps included in requests which require authentication.  This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized.  Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete.
1693344884Scy</p>
1694344884Scy</dd>
1695344884Scy<dt><code><a name="host"></a><code>host <kbd>name</kbd></code></code></dt>
1696344884Scy<dd><p>Set the host to which future queries will be sent.
1697275970ScyThe name may be either a DNS name or a numeric address.
1698344884Scy</p>
1699344884Scy</dd>
1700344884Scy<dt><code><a name="hostnames"></a><code>hostnames [yes | no]</code></code></dt>
1701344884Scy<dd><p>If <code>yes</code> is specified, host names are printed in information displays.
1702344884ScyIf <code>no</code> is specified, numeric addresses are printed instead.
1703275970ScyThe default is <code>yes</code>,
1704275970Scyunless modified using the command line <code>-n</code> switch.
1705344884Scy</p>
1706344884Scy</dd>
1707344884Scy<dt><code><a name="keyid"></a><code>keyid <kbd>keyid</kbd></code></code></dt>
1708344884Scy<dd><p>This command specifies the key number to be used
1709344884Scyto authenticate configuration requests.
1710275970ScyThis must correspond to a key ID configured in <code>ntp.conf</code> for this purpose.
1711344884Scy</p>
1712344884Scy</dd>
1713344884Scy<dt><code><a name="keytype"></a><code>keytype</code></code></dt>
1714344884Scy<dd><p>Specify the digest algorithm to use for authenticated requests,
1715344884Scywith default <code>MD5</code>.
1716275970ScyIf the OpenSSL library is installed,
1717344884Scydigest can be be any message digest algorithm supported by the library.
1718330106SdelphijThe current selections are: <code>AES128CMAC</code>, <code>MD2</code>, <code>MD4</code>, <code>MD5</code>, <code>MDC2</code>, <code>RIPEMD160</code>, <code>SHA</code> and <code>SHA1</code>.
1719344884Scy</p>
1720344884Scy</dd>
1721344884Scy<dt><code><a name="ntpversion"></a><code>ntpversion 1 | 2 | 3 | 4</code></code></dt>
1722344884Scy<dd><p>Sets the NTP version number which <code>ntpq</code> claims in packets.
1723344884ScyDefaults to 2.
1724275970ScyNote that mode-6 control messages (and modes, for that matter)
1725344884Scydidn&rsquo;t exist in NTP version 1.
1726344884Scy</p>
1727344884Scy</dd>
1728344884Scy<dt><code><a name="passwd"></a><code>passwd</code></code></dt>
1729344884Scy<dd><p>This command prompts for a password to authenticate requests.
1730275970ScyThe password must correspond to the key ID configured in <code>ntp.conf</code> for this purpose.
1731344884Scy</p>
1732344884Scy</dd>
1733344884Scy<dt><code><a name="quit"></a><code>quit</code></code></dt>
1734344884Scy<dd><p>Exit <code>ntpq</code>.
1735344884Scy</p>
1736344884Scy</dd>
1737344884Scy<dt><code><a name="raw"></a><code>raw</code></code></dt>
1738344884Scy<dd><p>Display server messages as received and without reformatting.
1739344884Scy</p>
1740344884Scy</dd>
1741344884Scy<dt><code><a name="timeout"></a><code>timeout <kbd>milliseconds</kbd></code></code></dt>
1742344884Scy<dd><p>Specify a timeout period for responses to server queries.
1743344884ScyThe default is about 5000 milliseconds.
1744275970ScyNote that since <code>ntpq</code> retries each query once after a timeout
1745275970Scythe total waiting time for a timeout will be twice the timeout value set.
1746344884Scy</p>
1747344884Scy</dd>
1748344884Scy</dl>
1749275970Scy
1750344884Scy<hr>
1751344884Scy<a name="Control-Message-Commands"></a>
1752344884Scy<div class="header">
1753344884Scy<p>
1754344884ScyNext: <a href="#Status-Words-and-Kiss-Codes" accesskey="n" rel="next">Status Words and Kiss Codes</a>, Previous: <a href="#Internal-Commands" accesskey="p" rel="prev">Internal Commands</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
1755275970Scy</div>
1756344884Scy<a name="Control-Message-Commands-2"></a>
1757344884Scy<h3 class="section">1.4 Control Message Commands</h3>
1758275970Scy
1759344884Scy<p>Association IDs are used to identify system, peer and clock variables.
1760275970ScySystem variables are assigned an association ID of zero and system name space,
1761344884Scywhile each association is assigned a nonzero association ID and peer namespace.
1762275970ScyMost control commands send a single mode-6 message to the server
1763344884Scyand expect a single response message.
1764275970ScyThe exceptions are the <code>peers</code> command,
1765275970Scywhich sends a series of messages,
1766275970Scyand the <code>mreadlist</code> and <code>mreadvar</code> commands,
1767275970Scywhich iterate over a range of associations.
1768344884Scy</p>
1769344884Scy<a name="as"></a><dl compact="compact">
1770344884Scy<dt><code><code>associations</code></code></dt>
1771344884Scy<dd><p>Display a list of mobilized associations in the form:
1772275970Scy<br>
1773275970Scy<code>ind assid status conf reach auth condition last_event cnt</code>
1774344884Scy</p>
1775344884Scy<table>
1776344884Scy<thead><tr><th width="10%">Variable</th><th width="40%">Description</th></tr></thead>
1777344884Scy<tr><td width="10%"><code>ind</code></td><td width="40%">index on this list</td></tr>
1778344884Scy<tr><td width="10%"><code>assid</code></td><td width="40%">association ID</td></tr>
1779344884Scy<tr><td width="10%"><code>status</code></td><td width="40%"><a href="decode.html#peer">peer status word</a></td></tr>
1780344884Scy<tr><td width="10%"><code>conf</code></td><td width="40%"><code>yes</code>: persistent, <code>no</code>: ephemeral</td></tr>
1781344884Scy<tr><td width="10%"><code>reach</code></td><td width="40%"><code>yes</code>: reachable, <code>no</code>: unreachable</td></tr>
1782344884Scy<tr><td width="10%"><code>auth</code></td><td width="40%"><code>ok</code>, <code>yes</code>, <code>bad</code> and <code>none</code></td></tr>
1783344884Scy<tr><td width="10%"><code>condition</code></td><td width="40%">selection status (see the <code>select</code> field of the <a href="decode.html#peer">peer status word</a>)</td></tr>
1784344884Scy<tr><td width="10%"><code>last_event</code></td><td width="40%">event report (see the <code>event</code> field of the <a href="decode.html#peer">peer status word</a>)</td></tr>
1785344884Scy<tr><td width="10%"><code>cnt</code>
1786344884Scyevent count (see the <code>count</code> field of the <a href="decode.html#peer">peer status word</a>)</td></tr>
1787344884Scy</table>
1788275970Scy
1789344884Scy</dd>
1790344884Scy<dt><code><a name="cv"></a>clockvar <kbd>assocID</kbd> [<kbd>name</kbd> [ = <kbd>value</kbd> [...]] [...]]</code></dt>
1791344884Scy<dt><code>cv <kbd>assocID</kbd> [<kbd>name</kbd> [ = <kbd>value</kbd> [...] ][...]]</code></dt>
1792344884Scy<dd><p>Display a list of &lsquo;clock variables&rsquo; for those associations supporting a reference clock.
1793344884Scy</p>
1794344884Scy</dd>
1795344884Scy<dt><code><a name="g_t_003aconfig"></a>:config [...]</code></dt>
1796344884Scy<dd><p>Send the remainder of the command line, including whitespace, to the server
1797275970Scyas a run-time configuration command in the same format
1798344884Scyas the configuration file.
1799344884ScyThis command is experimental until further notice and clarification.
1800275970ScyAuthentication is of course required.
1801344884Scy</p>
1802344884Scy</dd>
1803344884Scy<dt><code><a name="config_002dfrom_002dfile"></a>config-from-file <kbd>filename</kbd></code></dt>
1804344884Scy<dd><p>Send the each line of <kbd>filename</kbd> to the server as
1805344884Scyrun-time configuration commands in the same format as the configuration file.
1806344884ScyThis command is experimental until further notice and clarification.
1807275970ScyAuthentication is required.
1808344884Scy</p>
1809344884Scy</dd>
1810344884Scy<dt><code><a name="ifstats"></a>ifstats</code></dt>
1811344884Scy<dd><p>Display statistics for each local network address.
1812275970ScyAuthentication is required.
1813344884Scy</p>
1814344884Scy</dd>
1815344884Scy<dt><code><a name="iostats"></a>iostats</code></dt>
1816344884Scy<dd><p>Display network and reference clock I/O statistics.
1817344884Scy</p>
1818344884Scy</dd>
1819344884Scy<dt><code><a name="kerninfo"></a>kerninfo</code></dt>
1820344884Scy<dd><p>Display kernel loop and PPS statistics.
1821344884ScyAs with other ntpq output, times are in milliseconds.
1822275970ScyThe precision value displayed is in milliseconds as well,
1823275970Scyunlike the precision system variable.
1824344884Scy</p>
1825344884Scy</dd>
1826344884Scy<dt><code><a name="lassoc"></a>lassociations</code></dt>
1827344884Scy<dd><p>Perform the same function as the associations command,
1828275970Scyexcept display mobilized and unmobilized associations.
1829344884Scy</p>
1830344884Scy</dd>
1831344884Scy<dt><code><a name="monstats"></a>monstats</code></dt>
1832344884Scy<dd><p>Display monitor facility statistics.
1833344884Scy</p>
1834344884Scy</dd>
1835344884Scy<dt><code><a name="mrulist"></a>mrulist [limited | kod | mincount=<kbd>count</kbd> | laddr=<kbd>localaddr</kbd> | sort=<kbd>sortorder</kbd> | resany=<kbd>hexmask</kbd> | resall=<kbd>hexmask</kbd>]</code></dt>
1836344884Scy<dd><p>Obtain and print traffic counts collected and maintained by
1837344884Scythe monitor facility.
1838344884ScyWith the exception of <code>sort=<kbd>sortorder</kbd></code>,
1839344884Scythe options filter the list returned by <code>ntpd</code>.
1840275970ScyThe <code>limited</code> and <code>kod</code> options return only entries
1841275970Scyrepresenting client addresses from which the last packet received
1842344884Scytriggered either discarding or a KoD response.
1843344884ScyThe <code>mincount=<kbd>count</kbd></code> option filters entries representing
1844344884Scyless than <code><kbd>count</kbd></code> packets.
1845344884ScyThe <code>laddr=<kbd>localaddr</kbd></code> option filters entries for packets
1846344884Scyreceived on any local address other than <code><kbd>localaddr</kbd></code>.
1847344884Scy<code>resany=<kbd>hexmask</kbd></code> and <code>resall=<kbd>hexmask</kbd></code>
1848275970Scyfilter entries containing none or less than all, respectively,
1849344884Scyof the bits in <code><kbd>hexmask</kbd></code>, which must begin with <code>0x</code>.
1850275970Scy<br>
1851344884ScyThe <code><kbd>sortorder</kbd></code> defaults to <code>lstint</code> and may be any of
1852275970Scy<code>addr</code>, <code>count</code>, <code>avgint</code>, <code>lstint</code>, or
1853344884Scyany of those preceded by a minus sign (hyphen) to reverse the sort order.
1854275970ScyThe output columns are:
1855344884Scy</p>
1856344884Scy<table>
1857344884Scy<thead><tr><th width="10%">Column</th><th width="40%">Description</th></tr></thead>
1858344884Scy<tr><td width="10%"><code>lstint</code></td><td width="40%">Interval in s between the receipt of the most recent packet from this
1859344884Scyaddress and the completion of the retrieval of the MRU list by <code>ntpq</code></td></tr>
1860344884Scy<tr><td width="10%"><code>avgint</code></td><td width="40%">Average interval in s between packets from this address.</td></tr>
1861344884Scy<tr><td width="10%"><code>rstr</code></td><td width="40%">Restriction flags associated with this address.
1862275970ScyMost are copied unchanged from the matching <code>restrict</code> command,
1863275970Scyhowever 0x400 (kod) and 0x20 (limited) flags are cleared unless
1864344884Scythe last packet from this address triggered a rate control response.</td></tr>
1865344884Scy<tr><td width="10%"><code>r</code></td><td width="40%">Rate control indicator, either a period, <code>L</code> or <code>K</code> for
1866275970Scyno rate control response, rate limiting by discarding, or
1867344884Scyrate limiting with a KoD response, respectively.</td></tr>
1868344884Scy<tr><td width="10%"><code>m</code></td><td width="40%">Packet mode.</td></tr>
1869344884Scy<tr><td width="10%"><code>v</code></td><td width="40%">Packet version number.</td></tr>
1870344884Scy<tr><td width="10%"><code>count</code></td><td width="40%">Packets received from this address.</td></tr>
1871344884Scy<tr><td width="10%"><code>rport</code></td><td width="40%">Source port of last packet from this address.</td></tr>
1872344884Scy<tr><td width="10%"><code>remote address</code></td><td width="40%">DNS name, numeric address, or address followed by claimed DNS name which
1873344884Scycould not be verified in parentheses.</td></tr>
1874344884Scy</table>
1875275970Scy
1876344884Scy</dd>
1877344884Scy<dt><code><a name="mreadvar"></a><code>mreadvar <kbd>assocID</kbd> <kbd>assocID</kbd> [ <kbd>variable_name</kbd> [ = <kbd>value</kbd>[ ... ]</code></code></dt>
1878344884Scy<dt><code><a name="mrv"></a><code>mrv <kbd>assocID</kbd> <kbd>assocID</kbd> [ <kbd>variable_name</kbd> [ = <kbd>value</kbd>[ ... ]</code></code></dt>
1879344884Scy<dd><p>Perform the same function as the <code>readvar</code> command,
1880344884Scyexcept for a range of association IDs.
1881275970ScyThis range is determined from the association list cached by
1882275970Scythe most recent <code>associations</code> command.
1883344884Scy</p>
1884344884Scy</dd>
1885344884Scy<dt><code><a name="passoc"></a><code>passociations</code></code></dt>
1886344884Scy<dd><p>Perform the same function as the <code>associations command</code>, except that
1887275970Scyit uses previously stored data rather than making a new query.
1888344884Scy</p>
1889344884Scy</dd>
1890344884Scy<dt><code><a name="pe"></a><code>peers</code></code></dt>
1891344884Scy<dd><p>Display a list of peers in the form:
1892275970Scy<br>
1893275970Scy<code>[tally]remote refid st t when pool reach delay offset jitter</code>
1894344884Scy</p>
1895344884Scy<table>
1896344884Scy<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
1897344884Scy<tr><td width="10%"><code>[tally]</code></td><td width="20%">single-character code indicating current value of the <code>select</code> field
1898344884Scyof the <a href="decode.html#peer">peer status word</a>.</td></tr>
1899344884Scy<tr><td width="10%"><code>remote</code></td><td width="20%">host name (or IP number) of peer</td></tr>
1900344884Scy<tr><td width="10%"><code>refid</code></td><td width="20%">association ID or <a href="decode.html#kiss">kiss code</a>.</td></tr>
1901344884Scy<tr><td width="10%"><code>st</code></td><td width="20%">stratum</td></tr>
1902344884Scy<tr><td width="10%"><code>t</code></td><td width="20%"><code>u</code>: unicast or manycast client,
1903275970Scy<code>b</code>: broadcast or multicast client,
1904275970Scy<code>l</code>: local (reference clock),
1905275970Scy<code>s</code>: symmetric (peer),
1906275970Scy<code>A</code>: manycast server,
1907275970Scy<code>B</code>: broadcast server,
1908344884Scy<code>M</code>: multicast server.</td></tr>
1909344884Scy<tr><td width="10%"><code>when</code></td><td width="20%">sec/min/hr since last received packet</td></tr>
1910344884Scy<tr><td width="10%"><code>poll</code></td><td width="20%">poll interval (log(2) s)</td></tr>
1911344884Scy<tr><td width="10%"><code>reach</code></td><td width="20%">reach shift register (octal)</td></tr>
1912344884Scy<tr><td width="10%"><code>delay</code></td><td width="20%">roundtrip delay</td></tr>
1913344884Scy<tr><td width="10%"><code>offset</code></td><td width="20%">offset of server relative to this host</td></tr>
1914344884Scy<tr><td width="10%"><code>jitter</code></td><td width="20%">jitter</td></tr>
1915344884Scy</table>
1916275970Scy
1917344884Scy</dd>
1918344884Scy<dt><code><a name="rv"></a>readvar <kbd>assocID</kbd> <kbd>name</kbd> [ = <kbd>value</kbd> ] [,...]</code></dt>
1919344884Scy<dt><code>rv <kbd>assocID</kbd> [ <kbd>name</kbd> ] [,...]</code></dt>
1920344884Scy<dd><p>Display the specified variables.
1921344884ScyIf <code><kbd>assocID</kbd></code> is zero,
1922344884Scythe variables are from the &lsquo;system variables&rsquo; name space,
1923344884Scyotherwise they are from the &lsquo;peer variables&rsquo; name space.
1924344884ScyThe <kbd>assocID</kbd> is required, as the same name can occur in both spaces.
1925275970ScyIf no <kbd>name</kbd> is included,
1926344884Scyall operative variables in the name space are displayed.
1927344884ScyIn this case only, if the <code><kbd>assocID</kbd></code> is omitted, it is assumed zero.
1928344884ScyMultiple names are specified with comma separators and without whitespace.
1929275970ScyNote that time values are represented in milliseconds and
1930344884Scyfrequency values in parts-per-million (PPM).
1931275970ScySome NTP timestamps are represented in the format YYYYMMDDTTTT,
1932275970Scywhere YYYY is the year, MM the month of year, DD the day of month and
1933275970ScyTTTT the time of day.
1934344884Scy</p>
1935344884Scy</dd>
1936344884Scy<dt><code><a name="saveconfig"></a><code>saveconfig <kbd>filename</kbd></code></code></dt>
1937344884Scy<dd><p>Write the current configuration, including any runtime modifications
1938275970Scygiven with <code>:config</code> or <code>config-from-file</code>,
1939344884Scyto the ntpd host&rsquo;s file <kbd>filename</kbd>.
1940275970ScyThis command will be rejected by the server unless
1941275970Scy<a href="miscopt.html#saveconfigdir">saveconfigdir</a>
1942344884Scyappears in the <code>ntpd</code> configuration file.
1943275970Scy<kbd>filename</kbd> can use <code>strftime()</code> format specifiers
1944275970Scyto substitute the current date and time, for example,
1945344884Scy<code>saveconfig ntp-%Y%m%d-%H%M%S.conf</code>.
1946344884ScyThe filename used is stored in system variable <code>savedconfig</code>.
1947275970ScyAuthentication is required.
1948344884Scy</p>
1949344884Scy</dd>
1950344884Scy<dt><code><a name="writevar"></a>writevar <kbd>assocID</kbd> <kbd>name</kbd> = <kbd>value</kbd> [,...]</code></dt>
1951344884Scy<dd><p>Write the specified variables.
1952344884ScyIf the <code><kbd>assocID</kbd></code> is zero, the variables are from the
1953344884Scy&lsquo;system variables&rsquo; name space, otherwise they are from the
1954344884Scy&lsquo;peer variables&rsquo; name	space.
1955344884ScyThe <code><kbd>assocID</kbd></code> is required,
1956275970Scyas the same name can occur in both spaces.
1957344884Scy</p>
1958344884Scy</dd>
1959344884Scy<dt><code><a name="sysinfo"></a><code>sysinfo</code></code></dt>
1960344884Scy<dd><p>Display operational summary.
1961344884Scy</p>
1962344884Scy</dd>
1963344884Scy<dt><code><a name="sysstats"></a><code>sysstats</code></code></dt>
1964344884Scy<dd><p>Print statistics counters maintained in the protocol module.
1965344884Scy</p>
1966344884Scy</dd>
1967344884Scy</dl>
1968275970Scy
1969344884Scy<hr>
1970344884Scy<a name="Status-Words-and-Kiss-Codes"></a>
1971344884Scy<div class="header">
1972344884Scy<p>
1973344884ScyNext: <a href="#System-Variables" accesskey="n" rel="next">System Variables</a>, Previous: <a href="#Control-Message-Commands" accesskey="p" rel="prev">Control Message Commands</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
1974275970Scy</div>
1975344884Scy<a name="Status-Words-and-Kiss-Codes-2"></a>
1976344884Scy<h3 class="section">1.5 Status Words and Kiss Codes</h3>
1977275970Scy
1978275970Scy<p>The current state of the operating program is shown
1979275970Scyin a set of status words maintained by the system
1980344884Scyand each association separately.
1981275970ScyThese words are displayed in the <code>rv</code> and <code>as</code> commands
1982344884Scyboth in hexadecimal and decoded short tip strings.
1983275970ScyThe codes, tips and short explanations are on the
1984344884Scy<a href="decode.html">Event Messages and Status Words</a> page.
1985275970ScyThe page also includes a list of system and peer messages,
1986275970Scythe code for the latest of which is included in the status word.
1987344884Scy</p>
1988344884Scy<p>Information resulting from protocol machine state transitions
1989275970Scyis displayed using an informal set of ASCII strings called
1990344884Scy<a href="decode.html#kiss">kiss codes</a>.
1991344884ScyThe original purpose was for kiss-o&rsquo;-death (KoD) packets sent
1992344884Scyby the server to advise the client of an unusual condition.
1993275970ScyThey are now displayed, when appropriate,
1994275970Scyin the reference identifier field in various billboards.
1995344884Scy</p>
1996344884Scy<hr>
1997344884Scy<a name="System-Variables"></a>
1998344884Scy<div class="header">
1999344884Scy<p>
2000344884ScyNext: <a href="#Peer-Variables" accesskey="n" rel="next">Peer Variables</a>, Previous: <a href="#Status-Words-and-Kiss-Codes" accesskey="p" rel="prev">Status Words and Kiss Codes</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
2001275970Scy</div>
2002344884Scy<a name="System-Variables-2"></a>
2003344884Scy<h3 class="section">1.6 System Variables</h3>
2004275970Scy
2005344884Scy<p>The following system variables appear in the <code>rv</code> billboard.
2006275970ScyNot all variables are displayed in some configurations.
2007344884Scy</p>
2008344884Scy<table>
2009344884Scy<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2010344884Scy<tr><td width="10%"><code>status</code></td><td width="20%"><a href="decode.html#sys">system status word</a></td></tr>
2011344884Scy<tr><td width="10%"><code>version</code></td><td width="20%">NTP software version and build time</td></tr>
2012344884Scy<tr><td width="10%"><code>processor</code></td><td width="20%">hardware platform and version</td></tr>
2013344884Scy<tr><td width="10%"><code>system</code></td><td width="20%">operating system and version</td></tr>
2014344884Scy<tr><td width="10%"><code>leap</code></td><td width="20%">leap warning indicator (0-3)</td></tr>
2015344884Scy<tr><td width="10%"><code>stratum</code></td><td width="20%">stratum (1-15)</td></tr>
2016344884Scy<tr><td width="10%"><code>precision</code></td><td width="20%">precision (log(2) s)</td></tr>
2017344884Scy<tr><td width="10%"><code>rootdelay</code></td><td width="20%">total roundtrip delay to the primary reference clock</td></tr>
2018344884Scy<tr><td width="10%"><code>rootdisp</code></td><td width="20%">total dispersion to the primary reference clock</td></tr>
2019344884Scy<tr><td width="10%"><code>peer</code></td><td width="20%">system peer association ID</td></tr>
2020344884Scy<tr><td width="10%"><code>tc</code>
2021344884Scytime constant and poll exponent (log(2) s) (3-17)</td></tr>
2022344884Scy<tr><td width="10%"><code>mintc</code>
2023344884Scyminimum time constant (log(2) s) (3-10)</td></tr>
2024344884Scy<tr><td width="10%"><code>clock</code></td><td width="20%">date and time of day</td></tr>
2025344884Scy<tr><td width="10%"><code>refid</code>
2026344884Scyreference ID or <a href="decode.html#kiss">kiss code</a></td></tr>
2027344884Scy<tr><td width="10%"><code>reftime</code></td><td width="20%">reference time</td></tr>
2028344884Scy<tr><td width="10%"><code>offset</code></td><td width="20%">combined offset of server relative to this host</td></tr>
2029344884Scy<tr><td width="10%"><code>sys_jitter</code></td><td width="20%">combined system jitter</td></tr>
2030344884Scy<tr><td width="10%"><code>frequency</code></td><td width="20%">frequency offset (PPM) relative to hardware clock</td></tr>
2031344884Scy<tr><td width="10%"><code>clk_wander</code></td><td width="20%">clock frequency wander (PPM)</td></tr>
2032344884Scy<tr><td width="10%"><code>clk_jitter</code></td><td width="20%">clock jitter</td></tr>
2033344884Scy<tr><td width="10%"><code>tai</code></td><td width="20%">TAI-UTC offset (s)</td></tr>
2034344884Scy<tr><td width="10%"><code>leapsec</code></td><td width="20%">NTP seconds when the next leap second is/was inserted</td></tr>
2035344884Scy<tr><td width="10%"><code>expire</code></td><td width="20%">NTP seconds when the NIST leapseconds file expires</td></tr>
2036344884Scy</table>
2037275970Scy
2038344884Scy<p>The jitter and wander statistics are exponentially-weighted RMS averages.
2039275970ScyThe system jitter is defined in the NTPv4 specification;
2040275970Scythe clock jitter statistic is computed by the clock discipline module.
2041344884Scy</p>
2042344884Scy<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
2043275970Scyadditional system variables are displayed, including some or all of the
2044275970Scyfollowing, depending on the particular Autokey dance:
2045344884Scy</p>
2046344884Scy<table>
2047344884Scy<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2048344884Scy<tr><td width="10%"><code>host</code></td><td width="20%">Autokey host name for this host</td></tr>
2049344884Scy<tr><td width="10%"><code>ident</code></td><td width="20%">Autokey group name for this host</td></tr>
2050344884Scy<tr><td width="10%"><code>flags</code></td><td width="20%">host flags  (see Autokey specification)</td></tr>
2051344884Scy<tr><td width="10%"><code>digest</code></td><td width="20%">OpenSSL message digest algorithm</td></tr>
2052344884Scy<tr><td width="10%"><code>signature</code></td><td width="20%">OpenSSL digest/signature scheme</td></tr>
2053344884Scy<tr><td width="10%"><code>update</code></td><td width="20%">NTP seconds at last signature update</td></tr>
2054344884Scy<tr><td width="10%"><code>cert</code></td><td width="20%">certificate subject, issuer and certificate flags</td></tr>
2055344884Scy<tr><td width="10%"><code>until</code></td><td width="20%">NTP seconds when the certificate expires</td></tr>
2056344884Scy</table>
2057275970Scy
2058344884Scy<hr>
2059344884Scy<a name="Peer-Variables"></a>
2060344884Scy<div class="header">
2061344884Scy<p>
2062344884ScyNext: <a href="#Clock-Variables" accesskey="n" rel="next">Clock Variables</a>, Previous: <a href="#System-Variables" accesskey="p" rel="prev">System Variables</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
2063275970Scy</div>
2064344884Scy<a name="Peer-Variables-2"></a>
2065344884Scy<h3 class="section">1.7 Peer Variables</h3>
2066275970Scy
2067275970Scy<p>The following peer variables appear in the <code>rv</code> billboard
2068344884Scyfor each association.
2069275970ScyNot all variables are displayed in some configurations.
2070344884Scy</p>
2071344884Scy<table>
2072344884Scy<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2073344884Scy<tr><td width="10%"><code>associd</code></td><td width="20%">association ID</td></tr>
2074344884Scy<tr><td width="10%"><code>status</code></td><td width="20%"><a href="decode.html#peer">peer status word</a></td></tr>
2075344884Scy<tr><td width="10%"><code>srcadr</code>
2076344884Scy<p><code>srcport</code>
2077344884Scy</p></td><td width="20%">source (remote) IP address and port</td></tr>
2078344884Scy<tr><td width="10%"><code>dstadr</code>
2079344884Scy<p><code>dstport</code>
2080344884Scy</p></td><td width="20%">destination (local) IP address and port</td></tr>
2081344884Scy<tr><td width="10%"><code>leap</code></td><td width="20%">leap indicator (0-3)</td></tr>
2082344884Scy<tr><td width="10%"><code>stratum</code></td><td width="20%">stratum (0-15)</td></tr>
2083344884Scy<tr><td width="10%"><code>precision</code></td><td width="20%">precision (log(2) s)</td></tr>
2084344884Scy<tr><td width="10%"><code>rootdelay</code></td><td width="20%">total roundtrip delay to the primary reference clock</td></tr>
2085344884Scy<tr><td width="10%"><code>rootdisp</code></td><td width="20%">total root dispersion to the primary reference clock</td></tr>
2086344884Scy<tr><td width="10%"><code>refid</code></td><td width="20%">reference ID or <a href="decode.html#kiss">kiss code</a></td></tr>
2087344884Scy<tr><td width="10%"><code>reftime</code></td><td width="20%">reference time</td></tr>
2088344884Scy<tr><td width="10%"><code>reach</code></td><td width="20%">reach register (octal)</td></tr>
2089344884Scy<tr><td width="10%"><code>unreach</code></td><td width="20%">unreach counter</td></tr>
2090344884Scy<tr><td width="10%"><code>hmode</code></td><td width="20%">host mode (1-6)</td></tr>
2091344884Scy<tr><td width="10%"><code>pmode</code></td><td width="20%">peer mode (1-5)</td></tr>
2092344884Scy<tr><td width="10%"><code>hpoll</code></td><td width="20%">host poll exponent (log(2) s) (3-17)</td></tr>
2093344884Scy<tr><td width="10%"><code>ppoll</code></td><td width="20%">peer poll exponent (log(2) s) (3-17)</td></tr>
2094344884Scy<tr><td width="10%"><code>headway</code></td><td width="20%">headway (see <a href="rate.html">Rate Management and the Kiss-o&rsquo;-Death Packet</a>)</td></tr>
2095344884Scy<tr><td width="10%"><code>flash</code></td><td width="20%"><a href="decode.html#flash">flash status word</a></td></tr>
2096344884Scy<tr><td width="10%"><code>offset</code></td><td width="20%">filter offset</td></tr>
2097344884Scy<tr><td width="10%"><code>delay</code></td><td width="20%">filter delay</td></tr>
2098344884Scy<tr><td width="10%"><code>dispersion</code></td><td width="20%">filter dispersion</td></tr>
2099344884Scy<tr><td width="10%"><code>jitter</code></td><td width="20%">filter jitter</td></tr>
2100344884Scy<tr><td width="10%"><code>ident</code></td><td width="20%">Autokey group name for this association</td></tr>
2101344884Scy<tr><td width="10%"><code>bias</code></td><td width="20%">unicast/broadcast bias</td></tr>
2102344884Scy<tr><td width="10%"><code>xleave</code></td><td width="20%">interleave delay (see <a href="xleave.html">NTP Interleaved Modes</a>)</td></tr>
2103344884Scy</table>
2104275970Scy
2105344884Scy<p>The bias variable is calculated when the first broadcast packet is received
2106275970Scyafter the calibration volley.  It represents the offset of the broadcast
2107275970Scysubgraph relative to the unicast subgraph.  The xleave variable appears
2108275970Scyonly the interleaved symmetric and interleaved modes.  It represents
2109275970Scythe internal queuing, buffering and transmission delays for the preceding
2110275970Scypacket.
2111344884Scy</p>
2112344884Scy<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
2113275970Scyadditional peer variables are displayed, including the following:
2114344884Scy</p>
2115344884Scy<table>
2116344884Scy<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2117344884Scy<tr><td width="10%"><code>flags</code></td><td width="20%">peer flags (see Autokey specification)</td></tr>
2118344884Scy<tr><td width="10%"><code>host</code></td><td width="20%">Autokey server name</td></tr>
2119344884Scy<tr><td width="10%"><code>flags</code></td><td width="20%">peer flags (see Autokey specification)</td></tr>
2120344884Scy<tr><td width="10%"><code>signature</code></td><td width="20%">OpenSSL digest/signature scheme</td></tr>
2121344884Scy<tr><td width="10%"><code>initsequence</code></td><td width="20%">initial key ID</td></tr>
2122344884Scy<tr><td width="10%"><code>initkey</code></td><td width="20%">initial key index</td></tr>
2123344884Scy<tr><td width="10%"><code>timestamp</code></td><td width="20%">Autokey signature timestamp</td></tr>
2124344884Scy</table>
2125275970Scy
2126344884Scy<hr>
2127344884Scy<a name="Clock-Variables"></a>
2128344884Scy<div class="header">
2129344884Scy<p>
2130344884ScyPrevious: <a href="#Peer-Variables" accesskey="p" rel="prev">Peer Variables</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
2131275970Scy</div>
2132344884Scy<a name="Clock-Variables-2"></a>
2133344884Scy<h3 class="section">1.8 Clock Variables</h3>
2134275970Scy
2135275970Scy<p>The following clock variables appear in the <code>cv</code> billboard for each association with a reference clock.  Not all variables are displayed in some configurations.
2136344884Scy</p>
2137344884Scy<table>
2138344884Scy<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2139344884Scy<tr><td width="10%"><code>associd</code></td><td width="20%">association ID</td></tr>
2140344884Scy<tr><td width="10%"><code>status</code></td><td width="20%"><a href="decode.html#clock">clock status word</a></td></tr>
2141344884Scy<tr><td width="10%"><code>device</code></td><td width="20%">device description</td></tr>
2142344884Scy<tr><td width="10%"><code>timecode</code></td><td width="20%">ASCII time code string (specific to device)</td></tr>
2143344884Scy<tr><td width="10%"><code>poll</code></td><td width="20%">poll messages sent</td></tr>
2144344884Scy<tr><td width="10%"><code>noreply</code></td><td width="20%">no reply</td></tr>
2145344884Scy<tr><td width="10%"><code>badformat</code></td><td width="20%">bad format</td></tr>
2146344884Scy<tr><td width="10%"><code>baddata</code></td><td width="20%">bad date or time</td></tr>
2147344884Scy<tr><td width="10%"><code>fudgetime1</code></td><td width="20%">fudge time 1</td></tr>
2148344884Scy<tr><td width="10%"><code>fudgetime2</code></td><td width="20%">fudge time 2</td></tr>
2149344884Scy<tr><td width="10%"><code>stratum</code></td><td width="20%">driver stratum</td></tr>
2150344884Scy<tr><td width="10%"><code>refid</code></td><td width="20%">driver reference ID</td></tr>
2151344884Scy<tr><td width="10%"><code>flags</code></td><td width="20%">driver flags</td></tr>
2152344884Scy</table>
2153344884Scy<hr>
2154275970Scy
2155275970Scy
2156275970Scy
2157344884Scy</body>
2158344884Scy</html>
2159