xref: /freebsd/contrib/ntp/ntpq/ntpq.html (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
1052d159aSCy Schubert<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2052d159aSCy Schubert<html>
3a466cc55SCy Schubert<!-- Created by GNU Texinfo 6.6, http://www.gnu.org/software/texinfo/ -->
42b15cb3dSCy Schubert<head>
5052d159aSCy Schubert<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6052d159aSCy Schubert<title>ntpq: Network Time Protocol Query User&rsquo;s Manual</title>
7052d159aSCy Schubert
8052d159aSCy Schubert<meta name="description" content="ntpq: Network Time Protocol Query User&rsquo;s Manual">
9052d159aSCy Schubert<meta name="keywords" content="ntpq: Network Time Protocol Query User&rsquo;s Manual">
10052d159aSCy Schubert<meta name="resource-type" content="document">
11052d159aSCy Schubert<meta name="distribution" content="global">
12052d159aSCy Schubert<meta name="Generator" content="makeinfo">
13052d159aSCy Schubert<link href="#Top" rel="start" title="Top">
14052d159aSCy Schubert<link href="dir.html#Top" rel="up" title="(dir)">
15052d159aSCy Schubert<style type="text/css">
16052d159aSCy Schubert<!--
17052d159aSCy Schuberta.summary-letter {text-decoration: none}
18052d159aSCy Schubertblockquote.indentedblock {margin-right: 0em}
19052d159aSCy Schubertdiv.display {margin-left: 3.2em}
20052d159aSCy Schubertdiv.example {margin-left: 3.2em}
21052d159aSCy Schubertdiv.lisp {margin-left: 3.2em}
22052d159aSCy Schubertkbd {font-style: oblique}
232b15cb3dSCy Schubertpre.display {font-family: inherit}
242b15cb3dSCy Schubertpre.format {font-family: inherit}
25052d159aSCy Schubertpre.menu-comment {font-family: serif}
26052d159aSCy Schubertpre.menu-preformatted {font-family: serif}
27052d159aSCy Schubertspan.nolinebreak {white-space: nowrap}
28052d159aSCy Schubertspan.roman {font-family: initial; font-weight: normal}
29052d159aSCy Schubertspan.sansserif {font-family: sans-serif; font-weight: normal}
30052d159aSCy Schubertul.no-bullet {list-style: none}
31052d159aSCy Schubert-->
32052d159aSCy Schubert</style>
33052d159aSCy Schubert
34052d159aSCy Schubert
352b15cb3dSCy Schubert</head>
36052d159aSCy Schubert
37052d159aSCy Schubert<body lang="en">
38052d159aSCy Schubert<h1 class="settitle" align="center">ntpq: Network Time Protocol Query User&rsquo;s Manual</h1>
39052d159aSCy Schubert
40052d159aSCy Schubert
41052d159aSCy Schubert
42052d159aSCy Schubert
43052d159aSCy Schubert
44a466cc55SCy Schubert<span id="SEC_Overview"></span>
45052d159aSCy Schubert<h2 class="shortcontents-heading">Short Table of Contents</h2>
46052d159aSCy Schubert
472b15cb3dSCy Schubert<div class="shortcontents">
48052d159aSCy Schubert<ul class="no-bullet">
49a466cc55SCy Schubert<li><a id="stoc-Description" href="#toc-Description">1 Description</a></li>
502b15cb3dSCy Schubert</ul>
512b15cb3dSCy Schubert</div>
522b15cb3dSCy Schubert
532b15cb3dSCy Schubert
54a466cc55SCy Schubert<span id="Top"></span><div class="header">
55052d159aSCy Schubert<p>
56052d159aSCy SchubertNext: <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>
572b15cb3dSCy Schubert</div>
58a466cc55SCy Schubert<span id="ntpq_003a-Network-Time-Protocol-Query-User-Manual"></span><h1 class="top">ntpq: Network Time Protocol Query User Manual</h1>
592b15cb3dSCy Schubert
602b15cb3dSCy Schubert<p>The <code>ntpq</code> utility program is used to
612b15cb3dSCy Schubertmonitor the operational status
622b15cb3dSCy Schubertand determine the performance of
632b15cb3dSCy Schubert<code>ntpd</code>, the NTP daemon.
64052d159aSCy Schubert</p>
65*f5f40dd6SCy Schubert<p>This document applies to version 4.2.8p18 of <code>ntpq</code>.
66052d159aSCy Schubert</p>
67052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
68a466cc55SCy Schubert<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">
69052d159aSCy Schubert</td></tr>
70a466cc55SCy Schubert<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
71052d159aSCy Schubert</td></tr>
72a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="3">Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
73052d159aSCy Schubert</td></tr>
74a466cc55SCy Schubert<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">
75052d159aSCy Schubert</td></tr>
76a466cc55SCy Schubert<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">
77052d159aSCy Schubert</td></tr>
78a466cc55SCy Schubert<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">
79052d159aSCy Schubert</td></tr>
80a466cc55SCy Schubert<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">
81052d159aSCy Schubert</td></tr>
82a466cc55SCy Schubert<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">
83052d159aSCy Schubert</td></tr>
84a466cc55SCy Schubert<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">
85052d159aSCy Schubert</td></tr>
86052d159aSCy Schubert</table>
872b15cb3dSCy Schubert
88052d159aSCy Schubert<hr>
89a466cc55SCy Schubert<span id="ntpq-Description"></span><div class="header">
90052d159aSCy Schubert<p>
91052d159aSCy SchubertNext: <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>
922b15cb3dSCy Schubert</div>
93a466cc55SCy Schubert<span id="Description"></span><h2 class="chapter">1 Description</h2>
942b15cb3dSCy Schubert
952b15cb3dSCy Schubert<p>The <code>ntpq</code> utility program is used to monitor NTP daemon <code>ntpd</code> operations and determine performance.
962b15cb3dSCy SchubertIt uses the standard NTP mode 6 control message formats defined in
972b15cb3dSCy SchubertAppendix B of the NTPv3 specification RFC1305.
982b15cb3dSCy SchubertThe same formats are used in NTPv4, although some of the variable names have changed and new ones added.
992b15cb3dSCy SchubertThe description on this page is for the NTPv4 variables.
100052d159aSCy Schubert</p>
1012b15cb3dSCy Schubert<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.
102052d159aSCy Schubert</p>
1032b15cb3dSCy Schubert<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.
104052d159aSCy Schubert</p>
1052b15cb3dSCy Schubert<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.
106052d159aSCy Schubert</p>
1072b15cb3dSCy Schubert<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.
108052d159aSCy Schubert</p>
1092b15cb3dSCy Schubert<p>For examples and usage, see the <a href="debug.html">NTP Debugging Techniques</a> page.
110052d159aSCy Schubert</p>
111052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
112a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-Invocation" accesskey="1">Invoking ntpq</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
113052d159aSCy Schubert</td></tr>
114a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#Usage" accesskey="2">Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
115052d159aSCy Schubert</td></tr>
116a466cc55SCy Schubert<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">
117052d159aSCy Schubert</td></tr>
118a466cc55SCy Schubert<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">
119052d159aSCy Schubert</td></tr>
120a466cc55SCy Schubert<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">
121052d159aSCy Schubert</td></tr>
122a466cc55SCy Schubert<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">
123052d159aSCy Schubert</td></tr>
124a466cc55SCy Schubert<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">
125052d159aSCy Schubert</td></tr>
126a466cc55SCy Schubert<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">
127052d159aSCy Schubert</td></tr>
128052d159aSCy Schubert</table>
1292b15cb3dSCy Schubert
130052d159aSCy Schubert<hr>
131a466cc55SCy Schubert<span id="ntpq-Invocation"></span><div class="header">
132052d159aSCy Schubert<p>
133052d159aSCy SchubertNext: <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>
1342b15cb3dSCy Schubert</div>
135a466cc55SCy Schubert<span id="Invoking-ntpq"></span><h3 class="section">1.1 Invoking ntpq</h3>
136a466cc55SCy Schubert<span id="index-ntpq"></span>
137a466cc55SCy Schubert<span id="index-standard-NTP-query-program"></span>
1382b15cb3dSCy Schubert
1392b15cb3dSCy Schubert
1402b15cb3dSCy Schubert<p>The
1412b15cb3dSCy Schubert<code>ntpq</code>
14209100258SXin LIutility program is used to query NTP servers to monitor NTP operations
14309100258SXin LIand performance, requesting
1442b15cb3dSCy Schubertinformation about current state and/or changes in that state.
1452b15cb3dSCy SchubertThe program may be run either in interactive mode or controlled using
1462b15cb3dSCy Schubertcommand line arguments.
1472b15cb3dSCy SchubertRequests to read and write arbitrary
1482b15cb3dSCy Schubertvariables can be assembled, with raw and pretty-printed output
1492b15cb3dSCy Schubertoptions being available.
1502b15cb3dSCy SchubertThe
1512b15cb3dSCy Schubert<code>ntpq</code>
1522b15cb3dSCy Schubertutility can also obtain and print a
1532b15cb3dSCy Schubertlist of peers in a common format by sending multiple queries to the
1542b15cb3dSCy Schubertserver.
155052d159aSCy Schubert</p>
1562b15cb3dSCy Schubert<p>If one or more request options is included on the command line
1572b15cb3dSCy Schubertwhen
1582b15cb3dSCy Schubert<code>ntpq</code>
1592b15cb3dSCy Schubertis executed, each of the requests will be sent
1602b15cb3dSCy Schubertto the NTP servers running on each of the hosts given as command
1612b15cb3dSCy Schubertline arguments, or on localhost by default.
1622b15cb3dSCy SchubertIf no request options
1632b15cb3dSCy Schubertare given,
1642b15cb3dSCy Schubert<code>ntpq</code>
1652b15cb3dSCy Schubertwill attempt to read commands from the
1662b15cb3dSCy Schubertstandard input and execute these on the NTP server running on the
1672b15cb3dSCy Schubertfirst host given on the command line, again defaulting to localhost
1682b15cb3dSCy Schubertwhen no other host is specified.
1692b15cb3dSCy SchubertThe
1702b15cb3dSCy Schubert<code>ntpq</code>
1712b15cb3dSCy Schubertutility will prompt for
1722b15cb3dSCy Schubertcommands if the standard input is a terminal device.
173052d159aSCy Schubert</p>
1742b15cb3dSCy Schubert<p><code>ntpq</code>
1752b15cb3dSCy Schubertuses NTP mode 6 packets to communicate with the
1762b15cb3dSCy SchubertNTP server, and hence can be used to query any compatible server on
1772b15cb3dSCy Schubertthe network which permits it.
1782b15cb3dSCy SchubertNote that since NTP is a UDP protocol
1792b15cb3dSCy Schubertthis communication will be somewhat unreliable, especially over
1802b15cb3dSCy Schubertlarge distances in terms of network topology.
1812b15cb3dSCy SchubertThe
1822b15cb3dSCy Schubert<code>ntpq</code>
1832b15cb3dSCy Schubertutility makes
1842b15cb3dSCy Schubertone attempt to retransmit requests, and will time requests out if
1852b15cb3dSCy Schubertthe remote host is not heard from within a suitable timeout
1862b15cb3dSCy Schuberttime.
187052d159aSCy Schubert</p>
18809100258SXin LI<p>Note that in contexts where a host name is expected, a
18909100258SXin LI<code>-4</code>
19009100258SXin LIqualifier preceding the host name forces resolution to the IPv4
19109100258SXin LInamespace, while a
19209100258SXin LI<code>-6</code>
19309100258SXin LIqualifier forces resolution to the IPv6 namespace.
19409100258SXin LIFor examples and usage, see the
195052d159aSCy Schubert&ldquo;NTP Debugging Techniques&rdquo;
19609100258SXin LIpage.
197052d159aSCy Schubert</p>
1982b15cb3dSCy Schubert<p>Specifying a
1992b15cb3dSCy Schubertcommand line option other than
2002b15cb3dSCy Schubert<code>-i</code>
2012b15cb3dSCy Schubertor
2022b15cb3dSCy Schubert<code>-n</code>
2032b15cb3dSCy Schubertwill
2042b15cb3dSCy Schubertcause the specified query (queries) to be sent to the indicated
2052b15cb3dSCy Schuberthost(s) immediately.
2062b15cb3dSCy SchubertOtherwise,
2072b15cb3dSCy Schubert<code>ntpq</code>
2082b15cb3dSCy Schubertwill attempt to read
2092b15cb3dSCy Schubertinteractive format commands from the standard input.
210052d159aSCy Schubert</p>
211052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
212a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-usage" accesskey="1">ntpq help/usage (<samp>--help</samp>)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
213052d159aSCy Schubert</td></tr>
214a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-ipv4" accesskey="2">ipv4 option (-4)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
215052d159aSCy Schubert</td></tr>
216a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-ipv6" accesskey="3">ipv6 option (-6)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
217052d159aSCy Schubert</td></tr>
218a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-command" accesskey="4">command option (-c)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
219052d159aSCy Schubert</td></tr>
220a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-interactive" accesskey="5">interactive option (-i)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
221052d159aSCy Schubert</td></tr>
222a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-numeric" accesskey="6">numeric option (-n)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
223052d159aSCy Schubert</td></tr>
224a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-old_002drv" accesskey="7">old-rv option</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
225052d159aSCy Schubert</td></tr>
226a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-peers" accesskey="8">peers option (-p)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
227052d159aSCy Schubert</td></tr>
228a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-refid" accesskey="9">refid option (-r)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
229052d159aSCy Schubert</td></tr>
230a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-unconnected">unconnected option (-u)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
231052d159aSCy Schubert</td></tr>
232a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-wide">wide option (-w)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
233052d159aSCy Schubert</td></tr>
234a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-config">presetting/configuring ntpq</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
235a466cc55SCy Schubert</td></tr>
236a466cc55SCy Schubert<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">
237052d159aSCy Schubert</td></tr>
238052d159aSCy Schubert</table>
2392b15cb3dSCy Schubert
240a466cc55SCy Schubert<span id="Internal-Commands-1"></span><h4 class="subsection">1.1.1 Internal Commands</h4>
2412b15cb3dSCy Schubert
2422b15cb3dSCy Schubert<p>Interactive format commands consist of a keyword followed by zero
2432b15cb3dSCy Schubertto four arguments.
2442b15cb3dSCy SchubertOnly enough characters of the full keyword to
2452b15cb3dSCy Schubertuniquely identify the command need be typed.
246052d159aSCy Schubert</p>
2472b15cb3dSCy Schubert<p>A
2482b15cb3dSCy Schubertnumber of interactive format commands are executed entirely within
2492b15cb3dSCy Schubertthe
2502b15cb3dSCy Schubert<code>ntpq</code>
25109100258SXin LIutility itself and do not result in NTP
2522b15cb3dSCy Schubertrequests being sent to a server.
2532b15cb3dSCy SchubertThese are described following.
254052d159aSCy Schubert</p><dl compact="compact">
255052d159aSCy Schubert<dt><code>?</code> <code>[<kbd>command</kbd>]</code></dt>
256052d159aSCy Schubert<dt><code>help</code> <code>[<kbd>command</kbd>]</code></dt>
257052d159aSCy Schubert<dd><p>A
258052d159aSCy Schubert&lsquo;?&rsquo;
25909100258SXin LIby itself will print a list of all the commands
26009100258SXin LIknown to
2612b15cb3dSCy Schubert<code>ntpq</code>
2622b15cb3dSCy SchubertA
263052d159aSCy Schubert&lsquo;?&rsquo;
26409100258SXin LIfollowed by a command name will print function and usage
2652b15cb3dSCy Schubertinformation about the command.
266052d159aSCy Schubert</p></dd>
267052d159aSCy Schubert<dt><code>addvars</code> <kbd>name</kbd><code>[=<kbd>value</kbd>]</code><code>[,...]</code></dt>
268052d159aSCy Schubert<dt><code>rmvars</code> <kbd>name</kbd><code>[,...]</code></dt>
269052d159aSCy Schubert<dt><code>clearvars</code></dt>
270052d159aSCy Schubert<dt><code>showvars</code></dt>
271052d159aSCy Schubert<dd><p>The arguments to this command consist of a list of
2722b15cb3dSCy Schubertitems of the form
273052d159aSCy Schubert<kbd>name</kbd><code>[=<kbd>value</kbd>]</code>,
2742b15cb3dSCy Schubertwhere the
27509100258SXin LI.No = Ns Ar value
2762b15cb3dSCy Schubertis ignored, and can be omitted,
2772b15cb3dSCy Schubertin requests to the server to read variables.
2782b15cb3dSCy SchubertThe
2792b15cb3dSCy Schubert<code>ntpq</code>
28009100258SXin LIutility maintains an internal list in which data to be included in
28109100258SXin LImessages can be assembled, and displayed or set using the
2822b15cb3dSCy Schubert<code>readlist</code>
2832b15cb3dSCy Schubertand
2842b15cb3dSCy Schubert<code>writelist</code>
2852b15cb3dSCy Schubertcommands described below.
2862b15cb3dSCy SchubertThe
2872b15cb3dSCy Schubert<code>addvars</code>
2882b15cb3dSCy Schubertcommand allows variables and their optional values to be added to
2892b15cb3dSCy Schubertthe list.
2902b15cb3dSCy SchubertIf more than one variable is to be added, the list should
2912b15cb3dSCy Schubertbe comma-separated and not contain white space.
2922b15cb3dSCy SchubertThe
2932b15cb3dSCy Schubert<code>rmvars</code>
2942b15cb3dSCy Schubertcommand can be used to remove individual variables from the list,
2952b15cb3dSCy Schubertwhile the
29609100258SXin LI<code>clearvars</code>
2972b15cb3dSCy Schubertcommand removes all variables from the
2982b15cb3dSCy Schubertlist.
2992b15cb3dSCy SchubertThe
3002b15cb3dSCy Schubert<code>showvars</code>
3012b15cb3dSCy Schubertcommand displays the current list of optional variables.
302052d159aSCy Schubert</p></dd>
303052d159aSCy Schubert<dt><code>authenticate</code> <code>[<code>yes</code>|<code>no</code>]</code></dt>
304052d159aSCy Schubert<dd><p>Normally
3052b15cb3dSCy Schubert<code>ntpq</code>
3062b15cb3dSCy Schubertdoes not authenticate requests unless
3072b15cb3dSCy Schubertthey are write requests.
3082b15cb3dSCy SchubertThe command
30909100258SXin LI<code>authenticate</code> <code>yes</code>
3102b15cb3dSCy Schubertcauses
3112b15cb3dSCy Schubert<code>ntpq</code>
3122b15cb3dSCy Schubertto send authentication with all requests it
3132b15cb3dSCy Schubertmakes.
3142b15cb3dSCy SchubertAuthenticated requests causes some servers to handle
31509100258SXin LIrequests slightly differently.
3162b15cb3dSCy SchubertThe command
31709100258SXin LI<code>authenticate</code>
3182b15cb3dSCy Schubertcauses
3192b15cb3dSCy Schubert<code>ntpq</code>
3202b15cb3dSCy Schubertto display whether or not
32109100258SXin LIit is currently authenticating requests.
322052d159aSCy Schubert</p></dd>
323052d159aSCy Schubert<dt><code>cooked</code></dt>
324052d159aSCy Schubert<dd><p>Causes output from query commands to be &quot;cooked&quot;, so that
3252b15cb3dSCy Schubertvariables which are recognized by
3262b15cb3dSCy Schubert<code>ntpq</code>
3272b15cb3dSCy Schubertwill have their
3282b15cb3dSCy Schubertvalues reformatted for human consumption.
3292b15cb3dSCy SchubertVariables which
3302b15cb3dSCy Schubert<code>ntpq</code>
33109100258SXin LIcould not decode completely are
3322b15cb3dSCy Schubertmarked with a trailing
333052d159aSCy Schubert&lsquo;?&rsquo;.
334052d159aSCy Schubert</p></dd>
335052d159aSCy Schubert<dt><code>debug</code> <code>[<code>more</code>|<code>less</code>|<code>off</code>]</code></dt>
336052d159aSCy Schubert<dd><p>With no argument, displays the current debug level.
33709100258SXin LIOtherwise, the debugging level is changed as indicated.
338052d159aSCy Schubert</p></dd>
339052d159aSCy Schubert<dt><code>delay</code> <code>[<kbd>milliseconds</kbd>]</code></dt>
340052d159aSCy Schubert<dd><p>Specify a time interval to be added to timestamps included in
3412b15cb3dSCy Schubertrequests which require authentication.
3422b15cb3dSCy SchubertThis is used to enable
3432b15cb3dSCy Schubert(unreliable) server reconfiguration over long delay network paths
3442b15cb3dSCy Schubertor between machines whose clocks are unsynchronized.
3452b15cb3dSCy SchubertActually the
3462b15cb3dSCy Schubertserver does not now require timestamps in authenticated requests,
3472b15cb3dSCy Schubertso this command may be obsolete.
34809100258SXin LIWithout any arguments, displays the current delay.
349052d159aSCy Schubert</p></dd>
350052d159aSCy Schubert<dt><code>drefid</code> <code>[<code>hash</code>|<code>ipv4</code>]</code></dt>
351052d159aSCy Schubert<dd><p>Display refids as IPv4 or hash.
35209100258SXin LIWithout any arguments, displays whether refids are shown as IPv4
35309100258SXin LIaddresses or hashes.
354052d159aSCy Schubert</p></dd>
355052d159aSCy Schubert<dt><code>exit</code></dt>
356052d159aSCy Schubert<dd><p>Exit
3572b15cb3dSCy Schubert<code>ntpq</code>
358052d159aSCy Schubert</p></dd>
359052d159aSCy Schubert<dt><code>host</code> <code>[<kbd>name</kbd>]</code></dt>
360052d159aSCy Schubert<dd><p>Set the host to which future queries will be sent.
36109100258SXin LIThe
36209100258SXin LI<kbd>name</kbd>
3632b15cb3dSCy Schubertmay be either a host name or a numeric address.
36409100258SXin LIWithout any arguments, displays the current host.
365052d159aSCy Schubert</p></dd>
366052d159aSCy Schubert<dt><code>hostnames</code> <code>[<code>yes</code>|<code>no</code>]</code></dt>
367052d159aSCy Schubert<dd><p>If
3682b15cb3dSCy Schubert<code>yes</code>
3692b15cb3dSCy Schubertis specified, host names are printed in
3702b15cb3dSCy Schubertinformation displays.
3712b15cb3dSCy SchubertIf
3722b15cb3dSCy Schubert<code>no</code>
3732b15cb3dSCy Schubertis specified, numeric
3742b15cb3dSCy Schubertaddresses are printed instead.
3752b15cb3dSCy SchubertThe default is
3762b15cb3dSCy Schubert<code>yes</code>,
3772b15cb3dSCy Schubertunless
3782b15cb3dSCy Schubertmodified using the command line
3792b15cb3dSCy Schubert<code>-n</code>
3802b15cb3dSCy Schubertswitch.
38109100258SXin LIWithout any arguments, displays whether host names or numeric addresses
38209100258SXin LIare shown.
383052d159aSCy Schubert</p></dd>
384052d159aSCy Schubert<dt><code>keyid</code> <code>[<kbd>keyid</kbd>]</code></dt>
385052d159aSCy Schubert<dd><p>This command allows the specification of a key number to be
3862b15cb3dSCy Schubertused to authenticate configuration requests.
3872b15cb3dSCy SchubertThis must correspond
388276da39aSCy Schubertto the
389276da39aSCy Schubert<code>controlkey</code>
390276da39aSCy Schubertkey number the server has been configured to use for this
3912b15cb3dSCy Schubertpurpose.
39209100258SXin LIWithout any arguments, displays the current
39309100258SXin LI<kbd>keyid</kbd>.
394052d159aSCy Schubert</p></dd>
395052d159aSCy Schubert<dt><code>keytype</code> <code>[<kbd>digest</kbd>]</code></dt>
396052d159aSCy Schubert<dd><p>Specify the digest algorithm to use for authenticating requests, with default
39709100258SXin LI<code>MD5</code>.
3982b15cb3dSCy SchubertIf
3992b15cb3dSCy Schubert<code>ntpq</code>
40009100258SXin LIwas built with OpenSSL support, and OpenSSL is installed,
40109100258SXin LI<kbd>digest</kbd>
40209100258SXin LIcan be any message digest algorithm supported by OpenSSL.
4032b15cb3dSCy SchubertIf no argument is given, the current
40409100258SXin LI<code>keytype</code> <kbd>digest</kbd>
40509100258SXin LIalgorithm used is displayed.
406052d159aSCy Schubert</p></dd>
407052d159aSCy Schubert<dt><code>ntpversion</code> <code>[<code>1</code>|<code>2</code>|<code>3</code>|<code>4</code>]</code></dt>
408052d159aSCy Schubert<dd><p>Sets the NTP version number which
4092b15cb3dSCy Schubert<code>ntpq</code>
4102b15cb3dSCy Schubertclaims in
4112b15cb3dSCy Schubertpackets.
4122b15cb3dSCy SchubertDefaults to 3, and note that mode 6 control messages (and
413052d159aSCy Schubertmodes, for that matter) didn&rsquo;t exist in NTP version 1.
4142b15cb3dSCy SchubertThere appear
4152b15cb3dSCy Schubertto be no servers left which demand version 1.
4162b15cb3dSCy SchubertWith no argument, displays the current NTP version that will be used
4172b15cb3dSCy Schubertwhen communicating with servers.
418052d159aSCy Schubert</p></dd>
419052d159aSCy Schubert<dt><code>passwd</code></dt>
420052d159aSCy Schubert<dd><p>This command prompts you to type in a password (which will not
4212b15cb3dSCy Schubertbe echoed) which will be used to authenticate configuration
4222b15cb3dSCy Schubertrequests.
4232b15cb3dSCy SchubertThe password must correspond to the key configured for
4242b15cb3dSCy Schubertuse by the NTP server for this purpose if such requests are to be
4252b15cb3dSCy Schubertsuccessful.
426052d159aSCy Schubert</p></dd>
427052d159aSCy Schubert<dt><code>poll</code> <code>[<kbd>n</kbd>]</code> <code>[<code>verbose</code>]</code></dt>
428052d159aSCy Schubert<dd><p>Poll an NTP server in client mode
4292b15cb3dSCy Schubert<kbd>n</kbd>
43009100258SXin LItimes.
43109100258SXin LIPoll not implemented yet.
432052d159aSCy Schubert</p></dd>
433052d159aSCy Schubert<dt><code>quit</code></dt>
434052d159aSCy Schubert<dd><p>Exit
4352b15cb3dSCy Schubert<code>ntpq</code>
436052d159aSCy Schubert</p></dd>
437052d159aSCy Schubert<dt><code>raw</code></dt>
438052d159aSCy Schubert<dd><p>Causes all output from query commands is printed as received
4392b15cb3dSCy Schubertfrom the remote server.
4402b15cb3dSCy SchubertThe only formating/interpretation done on
4412b15cb3dSCy Schubertthe data is to transform nonascii data into a printable (but barely
4422b15cb3dSCy Schubertunderstandable) form.
443052d159aSCy Schubert</p></dd>
444052d159aSCy Schubert<dt><code>timeout</code> <code>[<kbd>milliseconds</kbd>]</code></dt>
445052d159aSCy Schubert<dd><p>Specify a timeout period for responses to server queries.
4462b15cb3dSCy SchubertThe
4472b15cb3dSCy Schubertdefault is about 5000 milliseconds.
44809100258SXin LIWithout any arguments, displays the current timeout period.
4492b15cb3dSCy SchubertNote that since
4502b15cb3dSCy Schubert<code>ntpq</code>
4512b15cb3dSCy Schubertretries each query once after a timeout, the total waiting time for
4522b15cb3dSCy Schuberta timeout will be twice the timeout value set.
453052d159aSCy Schubert</p></dd>
454052d159aSCy Schubert<dt><code>version</code></dt>
455052d159aSCy Schubert<dd><p>Display the version of the
4562b15cb3dSCy Schubert<code>ntpq</code>
4572b15cb3dSCy Schubertprogram.
458052d159aSCy Schubert</p></dd>
4592b15cb3dSCy Schubert</dl>
4602b15cb3dSCy Schubert
461a466cc55SCy Schubert<span id="Control-Message-Commands-1"></span><h4 class="subsubsection">1.1.1.1 Control Message Commands</h4>
46209100258SXin LI<p>Association ids are used to identify system, peer and clock variables.
46309100258SXin LISystem variables are assigned an association id of zero and system name
46409100258SXin LIspace, while each association is assigned a nonzero association id and
46509100258SXin LIpeer namespace.
46609100258SXin LIMost control commands send a single message to the server and expect a
46709100258SXin LIsingle response message.
4682b15cb3dSCy SchubertThe exceptions are the
4692b15cb3dSCy Schubert<code>peers</code>
4702b15cb3dSCy Schubertcommand, which sends a series of messages,
4712b15cb3dSCy Schubertand the
4722b15cb3dSCy Schubert<code>mreadlist</code>
4732b15cb3dSCy Schubertand
4742b15cb3dSCy Schubert<code>mreadvar</code>
4752b15cb3dSCy Schubertcommands, which iterate over a range of associations.
476052d159aSCy Schubert</p><dl compact="compact">
477052d159aSCy Schubert<dt><code>apeers</code></dt>
478052d159aSCy Schubert<dd><p>Display a list of peers in the form:
479052d159aSCy Schubert</p><div class="example">
48009100258SXin LI<pre class="example">[tally]remote refid assid st t when pool reach delay offset jitter
481052d159aSCy Schubert</pre></div>
48209100258SXin LI<p>where the output is just like the
48309100258SXin LI<code>peers</code>
48409100258SXin LIcommand except that the
48509100258SXin LI<code>refid</code>
48609100258SXin LIis displayed in hex format and the association number is also displayed.
487052d159aSCy Schubert</p></dd>
488052d159aSCy Schubert<dt><code>associations</code></dt>
489052d159aSCy Schubert<dd><p>Display a list of mobilized associations in the form:
490052d159aSCy Schubert</p><div class="example">
4912b15cb3dSCy Schubert<pre class="example">ind assid status conf reach auth condition last_event cnt
492052d159aSCy Schubert</pre></div>
493052d159aSCy Schubert<dl compact="compact">
494052d159aSCy Schubert<dt>Sy Variable Ta Sy Description</dt>
495052d159aSCy Schubert<dt><code>ind</code> <code>Ta</code> <code>index</code> <code>on</code> <code>this</code> <code>list</code></dt>
496052d159aSCy Schubert<dt><code>assid</code> <code>Ta</code> <code>association</code> <code>id</code></dt>
497052d159aSCy Schubert<dt><code>status</code> <code>Ta</code> <code>peer</code> <code>status</code> <code>word</code></dt>
498052d159aSCy Schubert<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>
499052d159aSCy Schubert<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>
500052d159aSCy Schubert<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>
501052d159aSCy Schubert<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>
502052d159aSCy Schubert<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>
503052d159aSCy Schubert<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>
504052d159aSCy Schubert</dl>
505052d159aSCy Schubert</dd>
506052d159aSCy Schubert<dt><code>authinfo</code></dt>
507052d159aSCy Schubert<dd><p>Display the authentication statistics counters:
50809100258SXin LItime since reset, stored keys, free keys, key lookups, keys not found,
50909100258SXin LIuncached keys, expired keys, encryptions, decryptions.
510052d159aSCy Schubert</p></dd>
511052d159aSCy Schubert<dt><code>clocklist</code> <code>[<kbd>associd</kbd>]</code></dt>
512052d159aSCy Schubert<dt><code>cl</code> <code>[<kbd>associd</kbd>]</code></dt>
513052d159aSCy Schubert<dd><p>Display all clock variables in the variable list for those associations
51409100258SXin LIsupporting a reference clock.
515052d159aSCy Schubert</p></dd>
516052d159aSCy Schubert<dt><code>clockvar</code> <code>[<kbd>associd</kbd>]</code> <code>[<kbd>name</kbd><code>[=<kbd>value</kbd>]</code>]</code><code>[,...]</code></dt>
517052d159aSCy Schubert<dt><code>cv</code> <code>[<kbd>associd</kbd>]</code> <code>[<kbd>name</kbd><code>[=<kbd>value</kbd>]</code>]</code><code>[,...]</code></dt>
518052d159aSCy Schubert<dd><p>Display a list of clock variables for those associations supporting a
51909100258SXin LIreference clock.
520052d159aSCy Schubert</p></dd>
521052d159aSCy Schubert<dt><code>:config</code> <kbd>configuration command line</kbd></dt>
522052d159aSCy Schubert<dd><p>Send the remainder of the command line, including whitespace, to the
52309100258SXin LIserver as a run-time configuration command in the same format as a line
52409100258SXin LIin the configuration file.
52509100258SXin LIThis command is experimental until further notice and clarification.
52609100258SXin LIAuthentication is of course required.
527052d159aSCy Schubert</p></dd>
528052d159aSCy Schubert<dt><code>config-from-file</code> <kbd>filename</kbd></dt>
529052d159aSCy Schubert<dd><p>Send each line of
5302b15cb3dSCy Schubert<kbd>filename</kbd>
53109100258SXin LIto the server as run-time configuration commands in the same format as
53209100258SXin LIlines in the configuration file.
53309100258SXin LIThis command is experimental until further notice and clarification.
53409100258SXin LIAuthentication is required.
535052d159aSCy Schubert</p></dd>
536052d159aSCy Schubert<dt><code>ifstats</code></dt>
537052d159aSCy Schubert<dd><p>Display status and statistics counters for each local network interface address:
53809100258SXin LIinterface number, interface name and address or broadcast, drop, flag,
53909100258SXin LIttl, mc, received, sent, send failed, peers, uptime.
54009100258SXin LIAuthentication is required.
541052d159aSCy Schubert</p></dd>
542052d159aSCy Schubert<dt><code>iostats</code></dt>
543052d159aSCy Schubert<dd><p>Display network and reference clock I/O statistics:
54409100258SXin LItime since reset, receive buffers, free receive buffers, used receive buffers,
54509100258SXin LIlow water refills, dropped packets, ignored packets, received packets,
54609100258SXin LIpackets sent, packet send failures, input wakeups, useful input wakeups.
547052d159aSCy Schubert</p></dd>
548052d159aSCy Schubert<dt><code>kerninfo</code></dt>
549052d159aSCy Schubert<dd><p>Display kernel loop and PPS statistics:
55009100258SXin LIassocid, status, pll offset, pll frequency, maximum error,
55109100258SXin LIestimated error, kernel status, pll time constant, precision,
55209100258SXin LIfrequency tolerance, pps frequency, pps stability, pps jitter,
55309100258SXin LIcalibration interval, calibration cycles, jitter exceeded,
55409100258SXin LIstability exceeded, calibration errors.
55509100258SXin LIAs with other ntpq output, times are in milliseconds; very small values
55609100258SXin LImay be shown as exponentials.
55709100258SXin LIThe precision value displayed is in milliseconds as well, unlike the
55809100258SXin LIprecision system variable.
559052d159aSCy Schubert</p></dd>
560052d159aSCy Schubert<dt><code>lassociations</code></dt>
561052d159aSCy Schubert<dd><p>Perform the same function as the associations command, except display
56209100258SXin LImobilized and unmobilized associations, including all clients.
563052d159aSCy Schubert</p></dd>
564052d159aSCy Schubert<dt><code>lopeers</code> <code>[<code>-4</code>|<code>-6</code>]</code></dt>
565052d159aSCy Schubert<dd><p>Display a list of all peers and clients showing
56609100258SXin LI<code>dstadr</code>
56709100258SXin LI(associated with the given IP version).
568052d159aSCy Schubert</p></dd>
569052d159aSCy Schubert<dt><code>lpassociations</code></dt>
570052d159aSCy Schubert<dd><p>Display the last obtained list of associations, including all clients.
571052d159aSCy Schubert</p></dd>
572052d159aSCy Schubert<dt><code>lpeers</code> <code>[<code>-4</code>|<code>-6</code>]</code></dt>
573052d159aSCy Schubert<dd><p>Display a list of all peers and clients (associated with the given IP version).
574052d159aSCy Schubert</p></dd>
575052d159aSCy Schubert<dt><code>monstats</code></dt>
576052d159aSCy Schubert<dd><p>Display monitor facility status, statistics, and limits:
57709100258SXin LIenabled, addresses, peak addresses, maximum addresses,
57809100258SXin LIreclaim above count, reclaim older than, kilobytes, maximum kilobytes.
579052d159aSCy Schubert</p></dd>
580052d159aSCy Schubert<dt><code>mreadlist</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd></dt>
581052d159aSCy Schubert<dt><code>mrl</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd></dt>
582052d159aSCy Schubert<dd><p>Perform the same function as the
58309100258SXin LI<code>readlist</code>
58409100258SXin LIcommand for a range of association ids.
585052d159aSCy Schubert</p></dd>
586052d159aSCy Schubert<dt><code>mreadvar</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd> <code>[<kbd>name</kbd>]</code><code>[,...]</code></dt>
587052d159aSCy Schubert<dd><p>This range may be determined from the list displayed by any
58809100258SXin LIcommand showing associations.
589052d159aSCy Schubert</p></dd>
590052d159aSCy Schubert<dt><code>mrv</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd> <code>[<kbd>name</kbd>]</code><code>[,...]</code></dt>
591052d159aSCy Schubert<dd><p>Perform the same function as the
59209100258SXin LI<code>readvar</code>
59309100258SXin LIcommand for a range of association ids.
59409100258SXin LIThis range may be determined from the list displayed by any
59509100258SXin LIcommand showing associations.
596052d159aSCy Schubert</p></dd>
597052d159aSCy Schubert<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>
598052d159aSCy Schubert<dd><p>Display traffic counts of the most recently seen source addresses
59909100258SXin LIcollected and maintained by the monitor facility.
6002b15cb3dSCy SchubertWith the exception of
60109100258SXin LI<code>sort</code>=<code>[-]</code><kbd>sortorder</kbd>,
6022b15cb3dSCy Schubertthe options filter the list returned by
60309100258SXin LI<code>ntpd(8)</code>.
6042b15cb3dSCy SchubertThe
6052b15cb3dSCy Schubert<code>limited</code>
6062b15cb3dSCy Schubertand
6072b15cb3dSCy Schubert<code>kod</code>
60809100258SXin LIoptions return only entries representing client addresses from which the
60909100258SXin LIlast packet received triggered either discarding or a KoD response.
6102b15cb3dSCy SchubertThe
6112b15cb3dSCy Schubert<code>mincount</code>=<kbd>count</kbd>
6122b15cb3dSCy Schubertoption filters entries representing less than
6132b15cb3dSCy Schubert<kbd>count</kbd>
6142b15cb3dSCy Schubertpackets.
6152b15cb3dSCy SchubertThe
6162b15cb3dSCy Schubert<code>laddr</code>=<kbd>localaddr</kbd>
6172b15cb3dSCy Schubertoption filters entries for packets received on any local address other than
6182b15cb3dSCy Schubert<kbd>localaddr</kbd>.
6192b15cb3dSCy Schubert<code>resany</code>=<kbd>hexmask</kbd>
6202b15cb3dSCy Schubertand
6212b15cb3dSCy Schubert<code>resall</code>=<kbd>hexmask</kbd>
6222b15cb3dSCy Schubertfilter entries containing none or less than all, respectively, of the bits in
6232b15cb3dSCy Schubert<kbd>hexmask</kbd>,
6242b15cb3dSCy Schubertwhich must begin with
6252b15cb3dSCy Schubert<code>0x</code>.
6262b15cb3dSCy SchubertThe
6272b15cb3dSCy Schubert<kbd>sortorder</kbd>
6282b15cb3dSCy Schubertdefaults to
6292b15cb3dSCy Schubert<code>lstint</code>
63009100258SXin LIand may be
6312b15cb3dSCy Schubert<code>addr</code>,
6322b15cb3dSCy Schubert<code>avgint</code>,
63309100258SXin LI<code>count</code>,
6342b15cb3dSCy Schubert<code>lstint</code>,
63509100258SXin LIor any of those preceded by
636052d159aSCy Schubert&lsquo;-&rsquo;
63709100258SXin LIto reverse the sort order.
6382b15cb3dSCy SchubertThe output columns are:
639052d159aSCy Schubert</p><dl compact="compact">
640052d159aSCy Schubert<dt>Column</dt>
641052d159aSCy Schubert<dd><p>Description
642052d159aSCy Schubert</p></dd>
643052d159aSCy Schubert<dt><code>lstint</code></dt>
644052d159aSCy Schubert<dd><p>Interval in seconds between the receipt of the most recent packet from
64509100258SXin LIthis address and the completion of the retrieval of the MRU list by
6462b15cb3dSCy Schubert<code>ntpq</code>
647052d159aSCy Schubert</p></dd>
648052d159aSCy Schubert<dt><code>avgint</code></dt>
649052d159aSCy Schubert<dd><p>Average interval in s between packets from this address.
650052d159aSCy Schubert</p></dd>
651052d159aSCy Schubert<dt><code>rstr</code></dt>
652052d159aSCy Schubert<dd><p>Restriction flags associated with this address.
6532b15cb3dSCy SchubertMost are copied unchanged from the matching
6542b15cb3dSCy Schubert<code>restrict</code>
65509100258SXin LIcommand, however 0x400 (kod) and 0x20 (limited) flags are cleared unless
65609100258SXin LIthe last packet from this address triggered a rate control response.
657052d159aSCy Schubert</p></dd>
658052d159aSCy Schubert<dt><code>r</code></dt>
659052d159aSCy Schubert<dd><p>Rate control indicator, either
6602b15cb3dSCy Schuberta period,
6612b15cb3dSCy Schubert<code>L</code>
6622b15cb3dSCy Schubertor
6632b15cb3dSCy Schubert<code>K</code>
6642b15cb3dSCy Schubertfor no rate control response,
6652b15cb3dSCy Schubertrate limiting by discarding, or rate limiting with a KoD response, respectively.
666052d159aSCy Schubert</p></dd>
667052d159aSCy Schubert<dt><code>m</code></dt>
668052d159aSCy Schubert<dd><p>Packet mode.
669052d159aSCy Schubert</p></dd>
670052d159aSCy Schubert<dt><code>v</code></dt>
671052d159aSCy Schubert<dd><p>Packet version number.
672052d159aSCy Schubert</p></dd>
673052d159aSCy Schubert<dt><code>count</code></dt>
674052d159aSCy Schubert<dd><p>Packets received from this address.
675052d159aSCy Schubert</p></dd>
676052d159aSCy Schubert<dt><code>rport</code></dt>
677052d159aSCy Schubert<dd><p>Source port of last packet from this address.
678052d159aSCy Schubert</p></dd>
679052d159aSCy Schubert<dt><code>remote</code> <code>address</code></dt>
680052d159aSCy Schubert<dd><p>host or DNS name, numeric address, or address followed by
6812b15cb3dSCy Schubertclaimed DNS name which could not be verified in parentheses.
682052d159aSCy Schubert</p></dd>
6832b15cb3dSCy Schubert</dl>
684052d159aSCy Schubert</dd>
685052d159aSCy Schubert<dt><code>opeers</code> <code>[<code>-4</code> | <code>-6</code>]</code></dt>
686052d159aSCy Schubert<dd><p>Obtain and print the old-style list of all peers and clients showing
68709100258SXin LI<code>dstadr</code>
68809100258SXin LI(associated with the given IP version),
6892b15cb3dSCy Schubertrather than the
69009100258SXin LI<code>refid</code>.
691052d159aSCy Schubert</p></dd>
692052d159aSCy Schubert<dt><code>passociations</code></dt>
693052d159aSCy Schubert<dd><p>Perform the same function as the
6942b15cb3dSCy Schubert<code>associations</code>
6952b15cb3dSCy Schubertcommand,
6962b15cb3dSCy Schubertexcept that it uses previously stored data rather than making a new query.
697052d159aSCy Schubert</p></dd>
698052d159aSCy Schubert<dt><code>peers</code></dt>
699052d159aSCy Schubert<dd><p>Display a list of peers in the form:
700052d159aSCy Schubert</p><div class="example">
7012b15cb3dSCy Schubert<pre class="example">[tally]remote refid st t when pool reach delay offset jitter
702052d159aSCy Schubert</pre></div>
703052d159aSCy Schubert<dl compact="compact">
704052d159aSCy Schubert<dt>Variable</dt>
705052d159aSCy Schubert<dd><p>Description
706052d159aSCy Schubert</p></dd>
707052d159aSCy Schubert<dt><code>[tally]</code></dt>
708052d159aSCy Schubert<dd><p>single-character code indicating current value of the
7092b15cb3dSCy Schubert<code>select</code>
7102b15cb3dSCy Schubertfield of the
711052d159aSCy Schubert.Lk decode.html#peer &quot;peer status word&quot;
712052d159aSCy Schubert</p></dd>
713052d159aSCy Schubert<dt><code>remote</code></dt>
714052d159aSCy Schubert<dd><p>host name (or IP number) of peer.
7152b15cb3dSCy SchubertThe value displayed will be truncated to 15 characters unless the
71609100258SXin LI<code>ntpq</code>
7172b15cb3dSCy Schubert<code>-w</code>
71809100258SXin LIoption is given, in which case the full value will be displayed
71909100258SXin LIon the first line, and if too long,
72009100258SXin LIthe remaining data will be displayed on the next line.
721052d159aSCy Schubert</p></dd>
722052d159aSCy Schubert<dt><code>refid</code></dt>
723052d159aSCy Schubert<dd><p>source IP address or
724052d159aSCy Schubert.Lk decode.html#kiss &quot;&rsquo;kiss code&quot;
725052d159aSCy Schubert</p></dd>
726052d159aSCy Schubert<dt><code>st</code></dt>
727052d159aSCy Schubert<dd><p>stratum: 0 for local reference clocks, 1 for servers with local
72809100258SXin LIreference clocks, ..., 16 for unsynchronized server clocks
729052d159aSCy Schubert</p></dd>
730052d159aSCy Schubert<dt><code>t</code></dt>
731052d159aSCy Schubert<dd><p><code>u</code>:
7322b15cb3dSCy Schubertunicast or manycast client,
7332b15cb3dSCy Schubert<code>b</code>:
7342b15cb3dSCy Schubertbroadcast or multicast client,
73509100258SXin LI<code>p</code>:
73609100258SXin LIpool source,
7372b15cb3dSCy Schubert<code>l</code>:
7382b15cb3dSCy Schubertlocal (reference clock),
7392b15cb3dSCy Schubert<code>s</code>:
7402b15cb3dSCy Schubertsymmetric (peer),
7412b15cb3dSCy Schubert<code>A</code>:
7422b15cb3dSCy Schubertmanycast server,
7432b15cb3dSCy Schubert<code>B</code>:
7442b15cb3dSCy Schubertbroadcast server,
7452b15cb3dSCy Schubert<code>M</code>:
7462b15cb3dSCy Schubertmulticast server
747052d159aSCy Schubert</p></dd>
748052d159aSCy Schubert<dt><code>when</code></dt>
749052d159aSCy Schubert<dd><p>time in seconds, minutes, hours, or days since the last packet
75009100258SXin LIwas received, or
751052d159aSCy Schubert&lsquo;-&rsquo;
75209100258SXin LIif a packet has never been received
753052d159aSCy Schubert</p></dd>
754052d159aSCy Schubert<dt><code>poll</code></dt>
755052d159aSCy Schubert<dd><p>poll interval (s)
756052d159aSCy Schubert</p></dd>
757052d159aSCy Schubert<dt><code>reach</code></dt>
758052d159aSCy Schubert<dd><p>reach shift register (octal)
759052d159aSCy Schubert</p></dd>
760052d159aSCy Schubert<dt><code>delay</code></dt>
761052d159aSCy Schubert<dd><p>roundtrip delay
762052d159aSCy Schubert</p></dd>
763052d159aSCy Schubert<dt><code>offset</code></dt>
764052d159aSCy Schubert<dd><p>offset of server relative to this host
765052d159aSCy Schubert</p></dd>
766052d159aSCy Schubert<dt><code>jitter</code></dt>
767052d159aSCy Schubert<dd><p>offset RMS error estimate.
768052d159aSCy Schubert</p></dd>
7692b15cb3dSCy Schubert</dl>
770052d159aSCy Schubert</dd>
771052d159aSCy Schubert<dt><code>pstats</code> <kbd>associd</kbd></dt>
772052d159aSCy Schubert<dd><p>Display the statistics for the peer with the given
77309100258SXin LI<kbd>associd</kbd>:
77409100258SXin LIassocid, status, remote host, local address, time last received,
77509100258SXin LItime until next send, reachability change, packets sent,
77609100258SXin LIpackets received, bad authentication, bogus origin, duplicate,
77709100258SXin LIbad dispersion, bad reference time, candidate order.
778052d159aSCy Schubert</p></dd>
779052d159aSCy Schubert<dt><code>readlist</code> <code>[<kbd>associd</kbd>]</code></dt>
780052d159aSCy Schubert<dt><code>rl</code> <code>[<kbd>associd</kbd>]</code></dt>
781052d159aSCy Schubert<dd><p>Display all system or peer variables.
78209100258SXin LIIf the
78309100258SXin LI<kbd>associd</kbd>
78409100258SXin LIis omitted, it is assumed to be zero.
785052d159aSCy Schubert</p></dd>
786052d159aSCy Schubert<dt><code>readvar</code> <code>[<kbd>associd</kbd> <kbd>name</kbd><code>[=<kbd>value</kbd>]</code> <code>[, ...]</code>]</code></dt>
787052d159aSCy Schubert<dt><code>rv</code> <code>[<kbd>associd</kbd> <kbd>name</kbd><code>[=<kbd>value</kbd>]</code> <code>[, ...]</code>]</code></dt>
788052d159aSCy Schubert<dd><p>Display the specified system or peer variables.
7892b15cb3dSCy SchubertIf
79009100258SXin LI<kbd>associd</kbd>
7912b15cb3dSCy Schubertis zero, the variables are from the
7922b15cb3dSCy Schubert<a href="#System-Variables">System Variables</a>
7932b15cb3dSCy Schubertname space, otherwise they are from the
7942b15cb3dSCy Schubert<a href="#Peer-Variables">Peer Variables</a>
7952b15cb3dSCy Schubertname space.
7962b15cb3dSCy SchubertThe
79709100258SXin LI<kbd>associd</kbd>
7982b15cb3dSCy Schubertis required, as the same name can occur in both spaces.
7992b15cb3dSCy SchubertIf no
8002b15cb3dSCy Schubert<kbd>name</kbd>
8012b15cb3dSCy Schubertis included, all operative variables in the name space are displayed.
80209100258SXin LIIn this case only, if the
80309100258SXin LI<kbd>associd</kbd>
80409100258SXin LIis omitted, it is assumed to be zero.
8052b15cb3dSCy SchubertMultiple names are specified with comma separators and without whitespace.
8062b15cb3dSCy SchubertNote that time values are represented in milliseconds
8072b15cb3dSCy Schubertand frequency values in parts-per-million (PPM).
8082b15cb3dSCy SchubertSome NTP timestamps are represented in the format
80909100258SXin LI<kbd>YYYY</kbd><kbd>MM</kbd> <kbd>DD</kbd> <kbd>TTTT</kbd>,
81009100258SXin LIwhere
81109100258SXin LI<kbd>YYYY</kbd>
81209100258SXin LIis the year,
81309100258SXin LI<kbd>MM</kbd>
81409100258SXin LIthe month of year,
81509100258SXin LI<kbd>DD</kbd>
81609100258SXin LIthe day of month and
81709100258SXin LI<kbd>TTTT</kbd>
81809100258SXin LIthe time of day.
819052d159aSCy Schubert</p></dd>
820052d159aSCy Schubert<dt><code>reslist</code></dt>
821052d159aSCy Schubert<dd><p>Display the access control (restrict) list for
8222b15cb3dSCy Schubert<code>ntpq</code>
82309100258SXin LIAuthentication is required.
824052d159aSCy Schubert</p></dd>
825052d159aSCy Schubert<dt><code>saveconfig</code> <kbd>filename</kbd></dt>
826052d159aSCy Schubert<dd><p>Save the current configuration,
82709100258SXin LIincluding any runtime modifications made by
8282b15cb3dSCy Schubert<code>:config</code>
8292b15cb3dSCy Schubertor
8302b15cb3dSCy Schubert<code>config-from-file</code>,
83109100258SXin LIto the NTP server host file
8322b15cb3dSCy Schubert<kbd>filename</kbd>.
8332b15cb3dSCy SchubertThis command will be rejected by the server unless
834052d159aSCy Schubert.Lk miscopt.html#saveconfigdir &quot;saveconfigdir&quot;
8352b15cb3dSCy Schubertappears in the
83609100258SXin LI<code>ntpd(8)</code>
8372b15cb3dSCy Schubertconfiguration file.
8382b15cb3dSCy Schubert<kbd>filename</kbd>
8392b15cb3dSCy Schubertcan use
84009100258SXin LI<code>date(1)</code>
84109100258SXin LIformat specifiers to substitute the current date and time, for
84209100258SXin LIexample,
843052d159aSCy Schubert</p><div class="example">
844052d159aSCy Schubert<pre class="example"><code>saveconfig</code> <samp>ntp-%Y%m%d-%H%M%S.conf</samp>.
845052d159aSCy Schubert</pre></div>
84609100258SXin LI<p>The filename used is stored in system variable
8472b15cb3dSCy Schubert<code>savedconfig</code>.
8482b15cb3dSCy SchubertAuthentication is required.
849052d159aSCy Schubert</p></dd>
850052d159aSCy Schubert<dt><code>sysinfo</code></dt>
851052d159aSCy Schubert<dd><p>Display system operational summary:
85209100258SXin LIassocid, status, system peer, system peer mode, leap indicator,
85309100258SXin LIstratum, log2 precision, root delay, root dispersion,
85409100258SXin LIreference id, reference time, system jitter, clock jitter,
85509100258SXin LIclock wander, broadcast delay, symm. auth. delay.
856052d159aSCy Schubert</p></dd>
857052d159aSCy Schubert<dt><code>sysstats</code></dt>
858052d159aSCy Schubert<dd><p>Display system uptime and packet counts maintained in the
85909100258SXin LIprotocol module:
86009100258SXin LIuptime, sysstats reset, packets received, current version,
86109100258SXin LIolder version, bad length or format, authentication failed,
86209100258SXin LIdeclined, restricted, rate limited, KoD responses,
86309100258SXin LIprocessed for time.
864052d159aSCy Schubert</p></dd>
865052d159aSCy Schubert<dt><code>timerstats</code></dt>
866052d159aSCy Schubert<dd><p>Display interval timer counters:
86709100258SXin LItime since reset, timer overruns, calls to transmit.
868052d159aSCy Schubert</p></dd>
869052d159aSCy Schubert<dt><code>writelist</code> <kbd>associd</kbd></dt>
870052d159aSCy Schubert<dd><p>Set all system or peer variables included in the variable list.
871052d159aSCy Schubert</p></dd>
872052d159aSCy Schubert<dt><code>writevar</code> <kbd>associd</kbd> <kbd>name</kbd>=<kbd>value</kbd> <code>[, ...]</code></dt>
873052d159aSCy Schubert<dd><p>Set the specified variables in the variable list.
8742b15cb3dSCy SchubertIf the
87509100258SXin LI<kbd>associd</kbd>
8762b15cb3dSCy Schubertis zero, the variables are from the
8772b15cb3dSCy Schubert<a href="#System-Variables">System Variables</a>
8782b15cb3dSCy Schubertname space, otherwise they are from the
8792b15cb3dSCy Schubert<a href="#Peer-Variables">Peer Variables</a>
8802b15cb3dSCy Schubertname space.
8812b15cb3dSCy SchubertThe
88209100258SXin LI<kbd>associd</kbd>
8832b15cb3dSCy Schubertis required, as the same name can occur in both spaces.
88409100258SXin LIAuthentication is required.
885052d159aSCy Schubert</p></dd>
8862b15cb3dSCy Schubert</dl>
8872b15cb3dSCy Schubert
888a466cc55SCy Schubert<span id="Status-Words-and-Kiss-Codes-1"></span><h4 class="subsubsection">1.1.1.2 Status Words and Kiss Codes</h4>
8892b15cb3dSCy Schubert<p>The current state of the operating program is shown
8902b15cb3dSCy Schubertin a set of status words
8912b15cb3dSCy Schubertmaintained by the system.
8922b15cb3dSCy SchubertStatus information is also available on a per-association basis.
89309100258SXin LIThese words are displayed by the
89409100258SXin LI<code>readlist</code>
8952b15cb3dSCy Schubertand
89609100258SXin LI<code>associations</code>
8972b15cb3dSCy Schubertcommands both in hexadecimal and in decoded short tip strings.
8982b15cb3dSCy SchubertThe codes, tips and short explanations are documented on the
899052d159aSCy Schubert.Lk decode.html &quot;Event Messages and Status Words&quot;
9002b15cb3dSCy Schubertpage.
9012b15cb3dSCy SchubertThe page also includes a list of system and peer messages,
9022b15cb3dSCy Schubertthe code for the latest of which is included in the status word.
903052d159aSCy Schubert</p>
9042b15cb3dSCy Schubert<p>Information resulting from protocol machine state transitions
9052b15cb3dSCy Schubertis displayed using an informal set of ASCII strings called
906052d159aSCy Schubert.Lk decode.html#kiss &quot;kiss codes&quot; .
907052d159aSCy SchubertThe original purpose was for kiss-o&rsquo;-death (KoD) packets
9082b15cb3dSCy Schubertsent by the server to advise the client of an unusual condition.
9092b15cb3dSCy SchubertThey are now displayed, when appropriate,
9102b15cb3dSCy Schubertin the reference identifier field in various billboards.
911052d159aSCy Schubert</p>
912a466cc55SCy Schubert<span id="System-Variables-1"></span><h4 class="subsubsection">1.1.1.3 System Variables</h4>
9132b15cb3dSCy Schubert<p>The following system variables appear in the
91409100258SXin LI<code>readlist</code>
9152b15cb3dSCy Schubertbillboard.
9162b15cb3dSCy SchubertNot all variables are displayed in some configurations.
917052d159aSCy Schubert</p>
918052d159aSCy Schubert<dl compact="compact">
919052d159aSCy Schubert<dt>Variable</dt>
920052d159aSCy Schubert<dd><p>Description
921052d159aSCy Schubert</p></dd>
922052d159aSCy Schubert<dt><code>status</code></dt>
923052d159aSCy Schubert<dd><p>.Lk decode.html#sys &quot;system status word&quot;
924052d159aSCy Schubert</p></dd>
925052d159aSCy Schubert<dt><code>version</code></dt>
926052d159aSCy Schubert<dd><p>NTP software version and build time
927052d159aSCy Schubert</p></dd>
928052d159aSCy Schubert<dt><code>processor</code></dt>
929052d159aSCy Schubert<dd><p>hardware platform and version
930052d159aSCy Schubert</p></dd>
931052d159aSCy Schubert<dt><code>system</code></dt>
932052d159aSCy Schubert<dd><p>operating system and version
933052d159aSCy Schubert</p></dd>
934052d159aSCy Schubert<dt><code>leap</code></dt>
935052d159aSCy Schubert<dd><p>leap warning indicator (0-3)
936052d159aSCy Schubert</p></dd>
937052d159aSCy Schubert<dt><code>stratum</code></dt>
938052d159aSCy Schubert<dd><p>stratum (1-15)
939052d159aSCy Schubert</p></dd>
940052d159aSCy Schubert<dt><code>precision</code></dt>
941052d159aSCy Schubert<dd><p>precision (log2 s)
942052d159aSCy Schubert</p></dd>
943052d159aSCy Schubert<dt><code>rootdelay</code></dt>
944052d159aSCy Schubert<dd><p>total roundtrip delay to the primary reference clock
945052d159aSCy Schubert</p></dd>
946052d159aSCy Schubert<dt><code>rootdisp</code></dt>
947052d159aSCy Schubert<dd><p>total dispersion to the primary reference clock
948052d159aSCy Schubert</p></dd>
949052d159aSCy Schubert<dt><code>refid</code></dt>
950052d159aSCy Schubert<dd><p>reference id or
951052d159aSCy Schubert.Lk decode.html#kiss &quot;kiss code&quot;
952052d159aSCy Schubert</p></dd>
953052d159aSCy Schubert<dt><code>reftime</code></dt>
954052d159aSCy Schubert<dd><p>reference time
955052d159aSCy Schubert</p></dd>
956052d159aSCy Schubert<dt><code>clock</code></dt>
957052d159aSCy Schubert<dd><p>date and time of day
958052d159aSCy Schubert</p></dd>
959052d159aSCy Schubert<dt><code>peer</code></dt>
960052d159aSCy Schubert<dd><p>system peer association id
961052d159aSCy Schubert</p></dd>
962052d159aSCy Schubert<dt><code>tc</code></dt>
963052d159aSCy Schubert<dd><p>time constant and poll exponent (log2 s) (3-17)
964052d159aSCy Schubert</p></dd>
965052d159aSCy Schubert<dt><code>mintc</code></dt>
966052d159aSCy Schubert<dd><p>minimum time constant (log2 s) (3-10)
967052d159aSCy Schubert</p></dd>
968052d159aSCy Schubert<dt><code>offset</code></dt>
969052d159aSCy Schubert<dd><p>combined offset of server relative to this host
970052d159aSCy Schubert</p></dd>
971052d159aSCy Schubert<dt><code>frequency</code></dt>
972052d159aSCy Schubert<dd><p>frequency drift (PPM) relative to hardware clock
973052d159aSCy Schubert</p></dd>
974052d159aSCy Schubert<dt><code>sys_jitter</code></dt>
975052d159aSCy Schubert<dd><p>combined system jitter
976052d159aSCy Schubert</p></dd>
977052d159aSCy Schubert<dt><code>clk_wander</code></dt>
978052d159aSCy Schubert<dd><p>clock frequency wander (PPM)
979052d159aSCy Schubert</p></dd>
980052d159aSCy Schubert<dt><code>clk_jitter</code></dt>
981052d159aSCy Schubert<dd><p>clock jitter
982052d159aSCy Schubert</p></dd>
983052d159aSCy Schubert<dt><code>tai</code></dt>
984052d159aSCy Schubert<dd><p>TAI-UTC offset (s)
985052d159aSCy Schubert</p></dd>
986052d159aSCy Schubert<dt><code>leapsec</code></dt>
987052d159aSCy Schubert<dd><p>NTP seconds when the next leap second is/was inserted
988052d159aSCy Schubert</p></dd>
989052d159aSCy Schubert<dt><code>expire</code></dt>
990052d159aSCy Schubert<dd><p>NTP seconds when the NIST leapseconds file expires
991052d159aSCy Schubert</p></dd>
9922b15cb3dSCy Schubert</dl>
993052d159aSCy Schubert<p>The jitter and wander statistics are exponentially-weighted RMS averages.
9942b15cb3dSCy SchubertThe system jitter is defined in the NTPv4 specification;
9952b15cb3dSCy Schubertthe clock jitter statistic is computed by the clock discipline module.
996052d159aSCy Schubert</p>
9972b15cb3dSCy Schubert<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
9982b15cb3dSCy Schubertadditional system variables are displayed,
9992b15cb3dSCy Schubertincluding some or all of the following,
10002b15cb3dSCy Schubertdepending on the particular Autokey dance:
1001052d159aSCy Schubert</p><dl compact="compact">
1002052d159aSCy Schubert<dt>Variable</dt>
1003052d159aSCy Schubert<dd><p>Description
1004052d159aSCy Schubert</p></dd>
1005052d159aSCy Schubert<dt><code>host</code></dt>
1006052d159aSCy Schubert<dd><p>Autokey host name for this host
1007052d159aSCy Schubert</p></dd>
1008052d159aSCy Schubert<dt><code>ident</code></dt>
1009052d159aSCy Schubert<dd><p>Autokey group name for this host
1010052d159aSCy Schubert</p></dd>
1011052d159aSCy Schubert<dt><code>flags</code></dt>
1012052d159aSCy Schubert<dd><p>host flags  (see Autokey specification)
1013052d159aSCy Schubert</p></dd>
1014052d159aSCy Schubert<dt><code>digest</code></dt>
1015052d159aSCy Schubert<dd><p>OpenSSL message digest algorithm
1016052d159aSCy Schubert</p></dd>
1017052d159aSCy Schubert<dt><code>signature</code></dt>
1018052d159aSCy Schubert<dd><p>OpenSSL digest/signature scheme
1019052d159aSCy Schubert</p></dd>
1020052d159aSCy Schubert<dt><code>update</code></dt>
1021052d159aSCy Schubert<dd><p>NTP seconds at last signature update
1022052d159aSCy Schubert</p></dd>
1023052d159aSCy Schubert<dt><code>cert</code></dt>
1024052d159aSCy Schubert<dd><p>certificate subject, issuer and certificate flags
1025052d159aSCy Schubert</p></dd>
1026052d159aSCy Schubert<dt><code>until</code></dt>
1027052d159aSCy Schubert<dd><p>NTP seconds when the certificate expires
1028052d159aSCy Schubert</p></dd>
10292b15cb3dSCy Schubert</dl>
1030a466cc55SCy Schubert<span id="Peer-Variables-1"></span><h4 class="subsubsection">1.1.1.4 Peer Variables</h4>
10312b15cb3dSCy Schubert<p>The following peer variables appear in the
103209100258SXin LI<code>readlist</code>
10332b15cb3dSCy Schubertbillboard for each association.
10342b15cb3dSCy SchubertNot all variables are displayed in some configurations.
1035052d159aSCy Schubert</p>
1036052d159aSCy Schubert<dl compact="compact">
1037052d159aSCy Schubert<dt>Variable</dt>
1038052d159aSCy Schubert<dd><p>Description
1039052d159aSCy Schubert</p></dd>
1040052d159aSCy Schubert<dt><code>associd</code></dt>
1041052d159aSCy Schubert<dd><p>association id
1042052d159aSCy Schubert</p></dd>
1043052d159aSCy Schubert<dt><code>status</code></dt>
1044052d159aSCy Schubert<dd><p>.Lk decode.html#peer &quot;peer status word&quot;
1045052d159aSCy Schubert</p></dd>
1046052d159aSCy Schubert<dt><code>srcadr</code></dt>
1047052d159aSCy Schubert<dd><p>source (remote) IP address
1048052d159aSCy Schubert</p></dd>
1049052d159aSCy Schubert<dt><code>srcport</code></dt>
1050052d159aSCy Schubert<dd><p>source (remote) port
1051052d159aSCy Schubert</p></dd>
1052052d159aSCy Schubert<dt><code>dstadr</code></dt>
1053052d159aSCy Schubert<dd><p>destination (local) IP address
1054052d159aSCy Schubert</p></dd>
1055052d159aSCy Schubert<dt><code>dstport</code></dt>
1056052d159aSCy Schubert<dd><p>destination (local) port
1057052d159aSCy Schubert</p></dd>
1058052d159aSCy Schubert<dt><code>leap</code></dt>
1059052d159aSCy Schubert<dd><p>leap indicator (0-3)
1060052d159aSCy Schubert</p></dd>
1061052d159aSCy Schubert<dt><code>stratum</code></dt>
1062052d159aSCy Schubert<dd><p>stratum (0-15)
1063052d159aSCy Schubert</p></dd>
1064052d159aSCy Schubert<dt><code>precision</code></dt>
1065052d159aSCy Schubert<dd><p>precision (log2 s)
1066052d159aSCy Schubert</p></dd>
1067052d159aSCy Schubert<dt><code>rootdelay</code></dt>
1068052d159aSCy Schubert<dd><p>total roundtrip delay to the primary reference clock
1069052d159aSCy Schubert</p></dd>
1070052d159aSCy Schubert<dt><code>rootdisp</code></dt>
1071052d159aSCy Schubert<dd><p>total root dispersion to the primary reference clock
1072052d159aSCy Schubert</p></dd>
1073052d159aSCy Schubert<dt><code>refid</code></dt>
1074052d159aSCy Schubert<dd><p>reference id or
1075052d159aSCy Schubert.Lk decode.html#kiss &quot;kiss code&quot;
1076052d159aSCy Schubert</p></dd>
1077052d159aSCy Schubert<dt><code>reftime</code></dt>
1078052d159aSCy Schubert<dd><p>reference time
1079052d159aSCy Schubert</p></dd>
1080052d159aSCy Schubert<dt><code>rec</code></dt>
1081052d159aSCy Schubert<dd><p>last packet received time
1082052d159aSCy Schubert</p></dd>
1083052d159aSCy Schubert<dt><code>reach</code></dt>
1084052d159aSCy Schubert<dd><p>reach register (octal)
1085052d159aSCy Schubert</p></dd>
1086052d159aSCy Schubert<dt><code>unreach</code></dt>
1087052d159aSCy Schubert<dd><p>unreach counter
1088052d159aSCy Schubert</p></dd>
1089052d159aSCy Schubert<dt><code>hmode</code></dt>
1090052d159aSCy Schubert<dd><p>host mode (1-6)
1091052d159aSCy Schubert</p></dd>
1092052d159aSCy Schubert<dt><code>pmode</code></dt>
1093052d159aSCy Schubert<dd><p>peer mode (1-5)
1094052d159aSCy Schubert</p></dd>
1095052d159aSCy Schubert<dt><code>hpoll</code></dt>
1096052d159aSCy Schubert<dd><p>host poll exponent (log2 s) (3-17)
1097052d159aSCy Schubert</p></dd>
1098052d159aSCy Schubert<dt><code>ppoll</code></dt>
1099052d159aSCy Schubert<dd><p>peer poll exponent (log2 s) (3-17)
1100052d159aSCy Schubert</p></dd>
1101052d159aSCy Schubert<dt><code>headway</code></dt>
1102052d159aSCy Schubert<dd><p>headway (see
1103052d159aSCy Schubert.Lk rate.html &quot;Rate Management and the Kiss-o&rsquo;-Death Packet&quot; )
1104052d159aSCy Schubert</p></dd>
1105052d159aSCy Schubert<dt><code>flash</code></dt>
1106052d159aSCy Schubert<dd><p>.Lk decode.html#flash &quot;flash status word&quot;
1107052d159aSCy Schubert</p></dd>
1108052d159aSCy Schubert<dt><code>keyid</code></dt>
1109052d159aSCy Schubert<dd><p>symmetric key id
1110052d159aSCy Schubert</p></dd>
1111052d159aSCy Schubert<dt><code>offset</code></dt>
1112052d159aSCy Schubert<dd><p>filter offset
1113052d159aSCy Schubert</p></dd>
1114052d159aSCy Schubert<dt><code>delay</code></dt>
1115052d159aSCy Schubert<dd><p>filter delay
1116052d159aSCy Schubert</p></dd>
1117052d159aSCy Schubert<dt><code>dispersion</code></dt>
1118052d159aSCy Schubert<dd><p>filter dispersion
1119052d159aSCy Schubert</p></dd>
1120052d159aSCy Schubert<dt><code>jitter</code></dt>
1121052d159aSCy Schubert<dd><p>filter jitter
1122052d159aSCy Schubert</p></dd>
1123052d159aSCy Schubert<dt><code>bias</code></dt>
1124052d159aSCy Schubert<dd><p>unicast/broadcast bias
1125052d159aSCy Schubert</p></dd>
1126052d159aSCy Schubert<dt><code>xleave</code></dt>
1127052d159aSCy Schubert<dd><p>interleave delay (see
1128052d159aSCy Schubert.Lk xleave.html &quot;NTP Interleaved Modes&quot; )
1129052d159aSCy Schubert</p></dd>
11302b15cb3dSCy Schubert</dl>
1131052d159aSCy Schubert<p>The
11322b15cb3dSCy Schubert<code>bias</code>
11332b15cb3dSCy Schubertvariable is calculated when the first broadcast packet is received
11342b15cb3dSCy Schubertafter the calibration volley.
113509100258SXin LIIt represents the offset of the broadcast subgraph relative to the
113609100258SXin LIunicast subgraph.
11372b15cb3dSCy SchubertThe
11382b15cb3dSCy Schubert<code>xleave</code>
11392b15cb3dSCy Schubertvariable appears only for the interleaved symmetric and interleaved modes.
11402b15cb3dSCy SchubertIt represents the internal queuing, buffering and transmission delays
11412b15cb3dSCy Schubertfor the preceding packet.
1142052d159aSCy Schubert</p>
11432b15cb3dSCy Schubert<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
11442b15cb3dSCy Schubertadditional peer variables are displayed, including the following:
1145052d159aSCy Schubert</p><dl compact="compact">
1146052d159aSCy Schubert<dt>Variable</dt>
1147052d159aSCy Schubert<dd><p>Description
1148052d159aSCy Schubert</p></dd>
1149052d159aSCy Schubert<dt><code>flags</code></dt>
1150052d159aSCy Schubert<dd><p>peer flags (see Autokey specification)
1151052d159aSCy Schubert</p></dd>
1152052d159aSCy Schubert<dt><code>host</code></dt>
1153052d159aSCy Schubert<dd><p>Autokey server name
1154052d159aSCy Schubert</p></dd>
1155052d159aSCy Schubert<dt><code>flags</code></dt>
1156052d159aSCy Schubert<dd><p>peer flags (see Autokey specification)
1157052d159aSCy Schubert</p></dd>
1158052d159aSCy Schubert<dt><code>signature</code></dt>
1159052d159aSCy Schubert<dd><p>OpenSSL digest/signature scheme
1160052d159aSCy Schubert</p></dd>
1161052d159aSCy Schubert<dt><code>initsequence</code></dt>
1162052d159aSCy Schubert<dd><p>initial key id
1163052d159aSCy Schubert</p></dd>
1164052d159aSCy Schubert<dt><code>initkey</code></dt>
1165052d159aSCy Schubert<dd><p>initial key index
1166052d159aSCy Schubert</p></dd>
1167052d159aSCy Schubert<dt><code>timestamp</code></dt>
1168052d159aSCy Schubert<dd><p>Autokey signature timestamp
1169052d159aSCy Schubert</p></dd>
1170052d159aSCy Schubert<dt><code>ident</code></dt>
1171052d159aSCy Schubert<dd><p>Autokey group name for this association
1172052d159aSCy Schubert</p></dd>
11732b15cb3dSCy Schubert</dl>
11742b15cb3dSCy Schubert
1175a466cc55SCy Schubert<span id="Clock-Variables-1"></span><h4 class="subsubsection">1.1.1.5 Clock Variables</h4>
11762b15cb3dSCy Schubert<p>The following clock variables appear in the
117709100258SXin LI<code>clocklist</code>
11782b15cb3dSCy Schubertbillboard for each association with a reference clock.
11792b15cb3dSCy SchubertNot all variables are displayed in some configurations.
1180052d159aSCy Schubert</p><dl compact="compact">
1181052d159aSCy Schubert<dt>Variable</dt>
1182052d159aSCy Schubert<dd><p>Description
1183052d159aSCy Schubert</p></dd>
1184052d159aSCy Schubert<dt><code>associd</code></dt>
1185052d159aSCy Schubert<dd><p>association id
1186052d159aSCy Schubert</p></dd>
1187052d159aSCy Schubert<dt><code>status</code></dt>
1188052d159aSCy Schubert<dd><p>.Lk decode.html#clock &quot;clock status word&quot;
1189052d159aSCy Schubert</p></dd>
1190052d159aSCy Schubert<dt><code>device</code></dt>
1191052d159aSCy Schubert<dd><p>device description
1192052d159aSCy Schubert</p></dd>
1193052d159aSCy Schubert<dt><code>timecode</code></dt>
1194052d159aSCy Schubert<dd><p>ASCII time code string (specific to device)
1195052d159aSCy Schubert</p></dd>
1196052d159aSCy Schubert<dt><code>poll</code></dt>
1197052d159aSCy Schubert<dd><p>poll messages sent
1198052d159aSCy Schubert</p></dd>
1199052d159aSCy Schubert<dt><code>noreply</code></dt>
1200052d159aSCy Schubert<dd><p>no reply
1201052d159aSCy Schubert</p></dd>
1202052d159aSCy Schubert<dt><code>badformat</code></dt>
1203052d159aSCy Schubert<dd><p>bad format
1204052d159aSCy Schubert</p></dd>
1205052d159aSCy Schubert<dt><code>baddata</code></dt>
1206052d159aSCy Schubert<dd><p>bad date or time
1207052d159aSCy Schubert</p></dd>
1208052d159aSCy Schubert<dt><code>fudgetime1</code></dt>
1209052d159aSCy Schubert<dd><p>fudge time 1
1210052d159aSCy Schubert</p></dd>
1211052d159aSCy Schubert<dt><code>fudgetime2</code></dt>
1212052d159aSCy Schubert<dd><p>fudge time 2
1213052d159aSCy Schubert</p></dd>
1214052d159aSCy Schubert<dt><code>stratum</code></dt>
1215052d159aSCy Schubert<dd><p>driver stratum
1216052d159aSCy Schubert</p></dd>
1217052d159aSCy Schubert<dt><code>refid</code></dt>
1218052d159aSCy Schubert<dd><p>driver reference id
1219052d159aSCy Schubert</p></dd>
1220052d159aSCy Schubert<dt><code>flags</code></dt>
1221052d159aSCy Schubert<dd><p>driver flags
1222052d159aSCy Schubert</p></dd>
12232b15cb3dSCy Schubert</dl>
12242b15cb3dSCy Schubert
12252b15cb3dSCy Schubert<p>This section was generated by <strong>AutoGen</strong>,
12262b15cb3dSCy Schubertusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpq</code> program.
12272b15cb3dSCy SchubertThis software is released under the NTP license, &lt;http://ntp.org/license&gt;.
1228052d159aSCy Schubert</p>
1229052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
1230a466cc55SCy Schubert<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>)
1231052d159aSCy Schubert</td></tr>
1232a466cc55SCy Schubert<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)
1233052d159aSCy Schubert</td></tr>
1234a466cc55SCy Schubert<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)
1235052d159aSCy Schubert</td></tr>
1236a466cc55SCy Schubert<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)
1237052d159aSCy Schubert</td></tr>
1238a466cc55SCy Schubert<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)
1239052d159aSCy Schubert</td></tr>
1240a466cc55SCy Schubert<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)
1241052d159aSCy Schubert</td></tr>
1242a466cc55SCy Schubert<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
1243052d159aSCy Schubert</td></tr>
1244a466cc55SCy Schubert<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)
1245052d159aSCy Schubert</td></tr>
1246a466cc55SCy Schubert<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)
1247052d159aSCy Schubert</td></tr>
1248a466cc55SCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-unconnected">ntpq unconnected</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">unconnected option (-u)
1249052d159aSCy Schubert</td></tr>
1250a466cc55SCy Schubert<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)
1251052d159aSCy Schubert</td></tr>
1252a466cc55SCy Schubert<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
1253a466cc55SCy Schubert</td></tr>
1254a466cc55SCy Schubert<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
1255052d159aSCy Schubert</td></tr>
1256052d159aSCy Schubert</table>
12572b15cb3dSCy Schubert
1258052d159aSCy Schubert<hr>
1259a466cc55SCy Schubert<span id="ntpq-usage"></span><div class="header">
1260052d159aSCy Schubert<p>
1261052d159aSCy SchubertNext: <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>
12622b15cb3dSCy Schubert</div>
1263a466cc55SCy Schubert<span id="ntpq-help_002fusage-_0028_002d_002dhelp_0029"></span><h4 class="subsection">1.1.2 ntpq help/usage (<samp>--help</samp>)</h4>
1264a466cc55SCy Schubert<span id="index-ntpq-help"></span>
12652b15cb3dSCy Schubert
1266052d159aSCy Schubert<p>This is the automatically generated usage text for ntpq.
1267052d159aSCy Schubert</p>
12682b15cb3dSCy Schubert<p>The text printed is the same whether selected with the <code>help</code> option
1269052d159aSCy Schubert(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
12702b15cb3dSCy Schubertthe usage text by passing it through a pager program.
12712b15cb3dSCy Schubert<code>more-help</code> is disabled on platforms without a working
12722b15cb3dSCy Schubert<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
1273052d159aSCy Schubertused to select the program, defaulting to <samp>more</samp>.  Both will exit
12742b15cb3dSCy Schubertwith a status code of 0.
1275052d159aSCy Schubert</p>
1276052d159aSCy Schubert<div class="example">
1277*f5f40dd6SCy Schubert<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p18
12782b15cb3dSCy SchubertUsage:  ntpq [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
12792b15cb3dSCy Schubert  Flg Arg Option-Name    Description
128009100258SXin LI   -4 no  ipv4           Force IPv4 name resolution
12812b15cb3dSCy Schubert                                - prohibits the option 'ipv6'
128209100258SXin LI   -6 no  ipv6           Force IPv6 name resolution
12832b15cb3dSCy Schubert                                - prohibits the option 'ipv4'
12842b15cb3dSCy Schubert   -c Str command        run a command and exit
12852b15cb3dSCy Schubert                                - may appear multiple times
12862b15cb3dSCy Schubert   -d no  debug-level    Increase debug verbosity level
12872b15cb3dSCy Schubert                                - may appear multiple times
12882b15cb3dSCy Schubert   -D Num set-debug-level Set the debug verbosity level
12892b15cb3dSCy Schubert                                - may appear multiple times
12902b15cb3dSCy Schubert   -i no  interactive    Force ntpq to operate in interactive mode
12912b15cb3dSCy Schubert                                - prohibits these options:
12922b15cb3dSCy Schubert                                command
12932b15cb3dSCy Schubert                                peers
12942b15cb3dSCy Schubert   -n no  numeric        numeric host addresses
12952b15cb3dSCy Schubert      no  old-rv         Always output status line with readvar
12962b15cb3dSCy Schubert   -p no  peers          Print a list of the peers
12972b15cb3dSCy Schubert                                - prohibits the option 'interactive'
12984990d495SXin LI   -r KWd refid          Set default display type for S2+ refids
1299a466cc55SCy Schubert   -u no  unconnected    Use unconnected UDP to communicate with ntpd (default on Windows)
13002b15cb3dSCy Schubert   -w no  wide           Display the full 'remote' value
13012b15cb3dSCy Schubert      opt version        output version information and exit
13022b15cb3dSCy Schubert   -? no  help           display extended usage information and exit
13032b15cb3dSCy Schubert   -! no  more-help      extended usage information passed thru pager
13042b15cb3dSCy Schubert   -&gt; opt save-opts      save the option state to a config file
13052b15cb3dSCy Schubert   -&lt; Str load-opts      load options from a config file
13062b15cb3dSCy Schubert                                - disabled as '--no-load-opts'
13072b15cb3dSCy Schubert                                - may appear multiple times
13082b15cb3dSCy Schubert
13092b15cb3dSCy SchubertOptions are specified by doubled hyphens and their name or by a single
13102b15cb3dSCy Schuberthyphen and the flag character.
13112b15cb3dSCy Schubert
13122b15cb3dSCy SchubertThe following option preset mechanisms are supported:
13132b15cb3dSCy Schubert - reading file $HOME/.ntprc
13142b15cb3dSCy Schubert - reading file ./.ntprc
13152b15cb3dSCy Schubert - examining environment variables named NTPQ_*
13162b15cb3dSCy Schubert
1317052d159aSCy SchubertThe valid &quot;refid&quot; option keywords are:
13184990d495SXin LI  hash ipv4
13194990d495SXin LI  or an integer from 0 through 1
13204990d495SXin LI
1321a466cc55SCy SchubertPlease send bug reports to:  &lt;https://bugs.ntp.org, bugs@ntp.org&gt;
1322052d159aSCy Schubert</pre></div>
1323052d159aSCy Schubert
1324052d159aSCy Schubert<hr>
1325a466cc55SCy Schubert<span id="ntpq-ipv4"></span><div class="header">
1326052d159aSCy Schubert<p>
1327052d159aSCy SchubertNext: <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>
13282b15cb3dSCy Schubert</div>
1329a466cc55SCy Schubert<span id="ipv4-option-_0028_002d4_0029"></span><h4 class="subsection">1.1.3 ipv4 option (-4)</h4>
1330a466cc55SCy Schubert<span id="index-ntpq_002dipv4"></span>
13312b15cb3dSCy Schubert
1332052d159aSCy Schubert<p>This is the &ldquo;force ipv4 name resolution&rdquo; option.
1333052d159aSCy Schubert</p>
1334052d159aSCy Schubert<p>This option has some usage constraints.  It:
1335052d159aSCy Schubert</p><ul>
13362b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
13372b15cb3dSCy Schubertipv6.
1338052d159aSCy Schubert</li></ul>
13392b15cb3dSCy Schubert
134009100258SXin LI<p>Force resolution of following host names on the command line
13412b15cb3dSCy Schubertto the IPv4 namespace.
1342052d159aSCy Schubert</p><hr>
1343a466cc55SCy Schubert<span id="ntpq-ipv6"></span><div class="header">
1344052d159aSCy Schubert<p>
1345052d159aSCy SchubertNext: <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>
13462b15cb3dSCy Schubert</div>
1347a466cc55SCy Schubert<span id="ipv6-option-_0028_002d6_0029"></span><h4 class="subsection">1.1.4 ipv6 option (-6)</h4>
1348a466cc55SCy Schubert<span id="index-ntpq_002dipv6"></span>
13492b15cb3dSCy Schubert
1350052d159aSCy Schubert<p>This is the &ldquo;force ipv6 name resolution&rdquo; option.
1351052d159aSCy Schubert</p>
1352052d159aSCy Schubert<p>This option has some usage constraints.  It:
1353052d159aSCy Schubert</p><ul>
13542b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
13552b15cb3dSCy Schubertipv4.
1356052d159aSCy Schubert</li></ul>
13572b15cb3dSCy Schubert
135809100258SXin LI<p>Force resolution of following host names on the command line
13592b15cb3dSCy Schubertto the IPv6 namespace.
1360052d159aSCy Schubert</p><hr>
1361a466cc55SCy Schubert<span id="ntpq-command"></span><div class="header">
1362052d159aSCy Schubert<p>
1363052d159aSCy SchubertNext: <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>
13642b15cb3dSCy Schubert</div>
1365a466cc55SCy Schubert<span id="command-option-_0028_002dc_0029"></span><h4 class="subsection">1.1.5 command option (-c)</h4>
1366a466cc55SCy Schubert<span id="index-ntpq_002dcommand"></span>
13672b15cb3dSCy Schubert
1368052d159aSCy Schubert<p>This is the &ldquo;run a command and exit&rdquo; option.
1369052d159aSCy SchubertThis option takes a string argument <samp>cmd</samp>.
1370052d159aSCy Schubert</p>
1371052d159aSCy Schubert<p>This option has some usage constraints.  It:
1372052d159aSCy Schubert</p><ul>
13732b15cb3dSCy Schubert<li> may appear an unlimited number of times.
1374052d159aSCy Schubert</li></ul>
13752b15cb3dSCy Schubert
13762b15cb3dSCy Schubert<p>The following argument is interpreted as an interactive format command
13772b15cb3dSCy Schubertand is added to the list of commands to be executed on the specified
13782b15cb3dSCy Schuberthost(s).
1379052d159aSCy Schubert</p><hr>
1380a466cc55SCy Schubert<span id="ntpq-interactive"></span><div class="header">
1381052d159aSCy Schubert<p>
1382052d159aSCy SchubertNext: <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>
13832b15cb3dSCy Schubert</div>
1384a466cc55SCy Schubert<span id="interactive-option-_0028_002di_0029"></span><h4 class="subsection">1.1.6 interactive option (-i)</h4>
1385a466cc55SCy Schubert<span id="index-ntpq_002dinteractive"></span>
13862b15cb3dSCy Schubert
1387052d159aSCy Schubert<p>This is the &ldquo;force ntpq to operate in interactive mode&rdquo; option.
1388052d159aSCy Schubert</p>
1389052d159aSCy Schubert<p>This option has some usage constraints.  It:
1390052d159aSCy Schubert</p><ul>
13912b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
13922b15cb3dSCy Schubertcommand, peers.
1393052d159aSCy Schubert</li></ul>
13942b15cb3dSCy Schubert
13952b15cb3dSCy Schubert<p>Force <code>ntpq</code> to operate in interactive mode.
13962b15cb3dSCy SchubertPrompts will be written to the standard output and
13972b15cb3dSCy Schubertcommands read from the standard input.
1398052d159aSCy Schubert</p><hr>
1399a466cc55SCy Schubert<span id="ntpq-numeric"></span><div class="header">
1400052d159aSCy Schubert<p>
1401052d159aSCy SchubertNext: <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>
14022b15cb3dSCy Schubert</div>
1403a466cc55SCy Schubert<span id="numeric-option-_0028_002dn_0029"></span><h4 class="subsection">1.1.7 numeric option (-n)</h4>
1404a466cc55SCy Schubert<span id="index-ntpq_002dnumeric"></span>
14052b15cb3dSCy Schubert
1406052d159aSCy Schubert<p>This is the &ldquo;numeric host addresses&rdquo; option.
14072b15cb3dSCy SchubertOutput all host addresses in dotted-quad numeric format rather than
14082b15cb3dSCy Schubertconverting to the canonical host names.
1409052d159aSCy Schubert</p><hr>
1410a466cc55SCy Schubert<span id="ntpq-old_002drv"></span><div class="header">
1411052d159aSCy Schubert<p>
1412052d159aSCy SchubertNext: <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>
14132b15cb3dSCy Schubert</div>
1414a466cc55SCy Schubert<span id="old_002drv-option"></span><h4 class="subsection">1.1.8 old-rv option</h4>
1415a466cc55SCy Schubert<span id="index-ntpq_002dold_002drv"></span>
14162b15cb3dSCy Schubert
1417052d159aSCy Schubert<p>This is the &ldquo;always output status line with readvar&rdquo; option.
14182b15cb3dSCy SchubertBy default, <code>ntpq</code> now suppresses the <code>associd=...</code>
14192b15cb3dSCy Schubertline that precedes the output of <code>readvar</code>
14202b15cb3dSCy Schubert(alias <code>rv</code>) when a single variable is requested, such as
1421052d159aSCy Schubert<code>ntpq -c &quot;rv 0 offset&quot;</code>.
14222b15cb3dSCy SchubertThis option causes <code>ntpq</code> to include both lines of output
14232b15cb3dSCy Schubertfor a single-variable <code>readvar</code>.
14242b15cb3dSCy SchubertUsing an environment variable to
14252b15cb3dSCy Schubertpreset this option in a script will enable both older and
14262b15cb3dSCy Schubertnewer <code>ntpq</code> to behave identically in this regard.
1427052d159aSCy Schubert</p><hr>
1428a466cc55SCy Schubert<span id="ntpq-peers"></span><div class="header">
1429052d159aSCy Schubert<p>
1430052d159aSCy SchubertNext: <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>
14312b15cb3dSCy Schubert</div>
1432a466cc55SCy Schubert<span id="peers-option-_0028_002dp_0029"></span><h4 class="subsection">1.1.9 peers option (-p)</h4>
1433a466cc55SCy Schubert<span id="index-ntpq_002dpeers"></span>
14342b15cb3dSCy Schubert
1435052d159aSCy Schubert<p>This is the &ldquo;print a list of the peers&rdquo; option.
1436052d159aSCy Schubert</p>
1437052d159aSCy Schubert<p>This option has some usage constraints.  It:
1438052d159aSCy Schubert</p><ul>
14392b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
14402b15cb3dSCy Schubertinteractive.
1441052d159aSCy Schubert</li></ul>
14422b15cb3dSCy Schubert
14432b15cb3dSCy Schubert<p>Print a list of the peers known to the server as well as a summary
1444052d159aSCy Schubertof their state. This is equivalent to the &rsquo;peers&rsquo; interactive command.
1445052d159aSCy Schubert</p><hr>
1446a466cc55SCy Schubert<span id="ntpq-refid"></span><div class="header">
1447052d159aSCy Schubert<p>
1448a466cc55SCy SchubertNext: <a href="#ntpq-unconnected" accesskey="n" rel="next">ntpq unconnected</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>
14492b15cb3dSCy Schubert</div>
1450a466cc55SCy Schubert<span id="refid-option-_0028_002dr_0029"></span><h4 class="subsection">1.1.10 refid option (-r)</h4>
1451a466cc55SCy Schubert<span id="index-ntpq_002drefid"></span>
14522b15cb3dSCy Schubert
1453052d159aSCy Schubert<p>This is the &ldquo;set default display type for s2+ refids&rdquo; option.
14544990d495SXin LIThis option takes a keyword argument.
1455052d159aSCy Schubert</p>
1456052d159aSCy Schubert<p>This option has some usage constraints.  It:
1457052d159aSCy Schubert</p><ul>
14584990d495SXin LI<li> This option takes a keyword as its argument.
14594990d495SXin LIThe argument sets an enumeration value that can be tested by comparing the option value macro (OPT_VALUE_REFID).
14604990d495SXin LIThe available keywords are:
1461052d159aSCy Schubert<div class="example">
14624990d495SXin LI<pre class="example">    hash ipv4
1463052d159aSCy Schubert</pre></div>
1464052d159aSCy Schubert
1465a466cc55SCy Schubert<p>or their numeric equivalent.
1466a466cc55SCy Schubert</p></li></ul>
14674990d495SXin LI
14684990d495SXin LI<p>Set the default display format for S2+ refids.
1469052d159aSCy Schubert</p><hr>
1470a466cc55SCy Schubert<span id="ntpq-unconnected"></span><div class="header">
1471052d159aSCy Schubert<p>
1472a466cc55SCy SchubertNext: <a href="#ntpq-wide" accesskey="n" rel="next">ntpq wide</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>
14734990d495SXin LI</div>
1474a466cc55SCy Schubert<span id="unconnected-option-_0028_002du_0029"></span><h4 class="subsection">1.1.11 unconnected option (-u)</h4>
1475a466cc55SCy Schubert<span id="index-ntpq_002dunconnected"></span>
1476a466cc55SCy Schubert
1477a466cc55SCy Schubert<p>This is the &ldquo;use unconnected udp to communicate with ntpd (default on windows)&rdquo; option.
1478a466cc55SCy SchubertOpen an unconnected UDP association to ntpd (the default
1479a466cc55SCy Schuberton Windows).
1480a466cc55SCy Schubert</p><hr>
1481a466cc55SCy Schubert<span id="ntpq-wide"></span><div class="header">
1482a466cc55SCy Schubert<p>
1483a466cc55SCy SchubertNext: <a href="#ntpq-config" accesskey="n" rel="next">ntpq config</a>, Previous: <a href="#ntpq-unconnected" accesskey="p" rel="prev">ntpq unconnected</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
1484a466cc55SCy Schubert</div>
1485a466cc55SCy Schubert<span id="wide-option-_0028_002dw_0029"></span><h4 class="subsection">1.1.12 wide option (-w)</h4>
1486a466cc55SCy Schubert<span id="index-ntpq_002dwide"></span>
14874990d495SXin LI
1488052d159aSCy Schubert<p>This is the &ldquo;display the full &rsquo;remote&rsquo; value&rdquo; option.
1489052d159aSCy SchubertDisplay the full value of the &rsquo;remote&rsquo; value.  If this requires
14902b15cb3dSCy Schubertmore than 15 characters, display the full value, emit a newline,
14912b15cb3dSCy Schubertand continue the data display properly indented on the next line.
1492052d159aSCy Schubert</p>
14932b15cb3dSCy Schubert
1494052d159aSCy Schubert<hr>
1495a466cc55SCy Schubert<span id="ntpq-config"></span><div class="header">
1496052d159aSCy Schubert<p>
1497052d159aSCy SchubertNext: <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>
14982b15cb3dSCy Schubert</div>
1499a466cc55SCy Schubert<span id="presetting_002fconfiguring-ntpq"></span><h4 class="subsection">1.1.13 presetting/configuring ntpq</h4>
15002b15cb3dSCy Schubert
15012b15cb3dSCy Schubert<p>Any option that is not marked as <i>not presettable</i> may be preset by
1502052d159aSCy Schubertloading 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
15032b15cb3dSCy Schubertthe options listed above in upper case and segmented with underscores.
15042b15cb3dSCy SchubertThe <code>NTPQ</code> variable will be tokenized and parsed like
15052b15cb3dSCy Schubertthe command line.  The remaining variables are tested for existence and their
15062b15cb3dSCy Schubertvalues are treated like option arguments.
1507052d159aSCy Schubert</p>
15082b15cb3dSCy Schubert
1509052d159aSCy Schubert<p><code>libopts</code> will search in 2 places for configuration files:
1510052d159aSCy Schubert</p><ul>
15112b15cb3dSCy Schubert<li> $HOME
1512052d159aSCy Schubert</li><li> $PWD
1513052d159aSCy Schubert</li></ul>
1514052d159aSCy Schubert<p>The environment variables <code>HOME</code>, and <code>PWD</code>
1515052d159aSCy Schubertare expanded and replaced when <samp>ntpq</samp> runs.
15162b15cb3dSCy SchubertFor any of these that are plain files, they are simply processed.
1517052d159aSCy SchubertFor any that are directories, then a file named <samp>.ntprc</samp> is searched for
15182b15cb3dSCy Schubertwithin that directory and processed.
1519052d159aSCy Schubert</p>
15202b15cb3dSCy Schubert<p>Configuration files may be in a wide variety of formats.
15212b15cb3dSCy SchubertThe basic format is an option name followed by a value (argument) on the
15222b15cb3dSCy Schubertsame line.  Values may be separated from the option name with a colon,
15232b15cb3dSCy Schubertequal sign or simply white space.  Values may be continued across multiple
15242b15cb3dSCy Schubertlines by escaping the newline with a backslash.
1525052d159aSCy Schubert</p>
15262b15cb3dSCy Schubert<p>Multiple programs may also share the same initialization file.
15272b15cb3dSCy SchubertCommon options are collected at the top, followed by program specific
15282b15cb3dSCy Schubertsegments.  The segments are separated by lines like:
1529052d159aSCy Schubert</p><div class="example">
15302b15cb3dSCy Schubert<pre class="example">[NTPQ]
1531052d159aSCy Schubert</pre></div>
1532052d159aSCy Schubert<p>or by
1533052d159aSCy Schubert</p><div class="example">
15342b15cb3dSCy Schubert<pre class="example">&lt;?program ntpq&gt;
1535052d159aSCy Schubert</pre></div>
1536052d159aSCy Schubert<p>Do not mix these styles within one configuration file.
1537052d159aSCy Schubert</p>
15382b15cb3dSCy Schubert<p>Compound values and carefully constructed string values may also be
15392b15cb3dSCy Schubertspecified using XML syntax:
1540052d159aSCy Schubert</p><div class="example">
15412b15cb3dSCy Schubert<pre class="example">&lt;option-name&gt;
15422b15cb3dSCy Schubert   &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
15432b15cb3dSCy Schubert&lt;/option-name&gt;
1544052d159aSCy Schubert</pre></div>
1545052d159aSCy Schubert<p>yielding an <code>option-name.sub-opt</code> string value of
1546052d159aSCy Schubert</p><div class="example">
1547052d159aSCy Schubert<pre class="example">&quot;...&lt;...&gt;...&quot;
1548052d159aSCy Schubert</pre></div>
15492b15cb3dSCy Schubert<p><code>AutoOpts</code> does not track suboptions.  You simply note that it is a
15502b15cb3dSCy Schuberthierarchicly valued option.  <code>AutoOpts</code> does provide a means for searching
15512b15cb3dSCy Schubertthe associated name/value pair list (see: optionFindValue).
1552052d159aSCy Schubert</p>
15532b15cb3dSCy Schubert<p>The command line options relating to configuration and/or usage help are:
1554052d159aSCy Schubert</p>
1555a466cc55SCy Schubert<span id="version-_0028_002d_0029"></span><h4 class="subsubheading">version (-)</h4>
15562b15cb3dSCy Schubert
15572b15cb3dSCy Schubert<p>Print the program version to standard out, optionally with licensing
15582b15cb3dSCy Schubertinformation, then exit 0.  The optional argument specifies how much licensing
1559a466cc55SCy Schubertdetail to provide.  The default is to print just the version.  The licensing information may be selected with an option argument.
15602b15cb3dSCy SchubertOnly the first letter of the argument is examined:
1561052d159aSCy Schubert</p>
1562052d159aSCy Schubert<dl compact="compact">
1563052d159aSCy Schubert<dt>&lsquo;<samp>version</samp>&rsquo;</dt>
1564052d159aSCy Schubert<dd><p>Only print the version.  This is the default.
1565052d159aSCy Schubert</p></dd>
1566052d159aSCy Schubert<dt>&lsquo;<samp>copyright</samp>&rsquo;</dt>
1567052d159aSCy Schubert<dd><p>Name the copyright usage licensing terms.
1568052d159aSCy Schubert</p></dd>
1569052d159aSCy Schubert<dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
1570052d159aSCy Schubert<dd><p>Print the full copyright usage licensing terms.
1571052d159aSCy Schubert</p></dd>
15722b15cb3dSCy Schubert</dl>
15732b15cb3dSCy Schubert
1574052d159aSCy Schubert<hr>
1575a466cc55SCy Schubert<span id="ntpq-exit-status"></span><div class="header">
1576052d159aSCy Schubert<p>
1577052d159aSCy SchubertPrevious: <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>
15782b15cb3dSCy Schubert</div>
1579a466cc55SCy Schubert<span id="ntpq-exit-status-1"></span><h4 class="subsection">1.1.14 ntpq exit status</h4>
15802b15cb3dSCy Schubert
15812b15cb3dSCy Schubert<p>One of the following exit values will be returned:
1582052d159aSCy Schubert</p><dl compact="compact">
1583052d159aSCy Schubert<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
1584052d159aSCy Schubert<dd><p>Successful program execution.
1585052d159aSCy Schubert</p></dd>
1586052d159aSCy Schubert<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
1587052d159aSCy Schubert<dd><p>The operation failed or the command syntax was not valid.
1588052d159aSCy Schubert</p></dd>
1589052d159aSCy Schubert<dt>&lsquo;<samp>66 (EX_NOINPUT)</samp>&rsquo;</dt>
1590052d159aSCy Schubert<dd><p>A specified configuration file could not be loaded.
1591052d159aSCy Schubert</p></dd>
1592052d159aSCy Schubert<dt>&lsquo;<samp>70 (EX_SOFTWARE)</samp>&rsquo;</dt>
1593052d159aSCy Schubert<dd><p>libopts had an internal operational error.  Please report
15942b15cb3dSCy Schubertit to autogen-users@lists.sourceforge.net.  Thank you.
1595052d159aSCy Schubert</p></dd>
15962b15cb3dSCy Schubert</dl>
15972b15cb3dSCy Schubert
1598052d159aSCy Schubert<hr>
1599a466cc55SCy Schubert<span id="Usage"></span><div class="header">
1600052d159aSCy Schubert<p>
1601052d159aSCy SchubertNext: <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>
16022b15cb3dSCy Schubert</div>
1603a466cc55SCy Schubert<span id="Usage-1"></span><h3 class="section">1.2 Usage</h3>
16042b15cb3dSCy Schubert
1605052d159aSCy Schubert<table>
1606052d159aSCy Schubert<thead><tr><th width="23%">What</th><th width="23%">Default</th><th width="5%">Flag</th><th width="15%">Option</th></tr></thead>
1607052d159aSCy Schubert<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>
1608052d159aSCy Schubert<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>
1609052d159aSCy Schubert<tr><td width="23%">leapseconds file</td><td width="23%">none</td><td width="5%"></td><td width="15%"><code>leapfile</code></td></tr>
1610052d159aSCy Schubert<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>
1611052d159aSCy Schubert<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>
1612052d159aSCy Schubert<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>
1613052d159aSCy Schubert<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>
1614052d159aSCy Schubert<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>
1615052d159aSCy Schubert</table>
16162b15cb3dSCy Schubert
1617052d159aSCy Schubert<hr>
1618a466cc55SCy Schubert<span id="Internal-Commands"></span><div class="header">
1619052d159aSCy Schubert<p>
1620052d159aSCy SchubertNext: <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>
16212b15cb3dSCy Schubert</div>
1622a466cc55SCy Schubert<span id="Internal-Commands-2"></span><h3 class="section">1.3 Internal Commands</h3>
16232b15cb3dSCy Schubert
16242b15cb3dSCy Schubert<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.
1625052d159aSCy Schubert</p>
1626052d159aSCy Schubert<dl compact="compact">
1627a466cc55SCy Schubert<dt><code><span id="help"></span><code>? [</code><kbd>command_keyword</kbd><code>]</code></code></dt>
1628052d159aSCy Schubert<dt><code><code>help [</code><kbd>command_keyword</kbd><code>]</code></code></dt>
1629052d159aSCy Schubert<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.
1630052d159aSCy Schubert</p>
1631052d159aSCy Schubert</dd>
1632a466cc55SCy Schubert<dt><code><span id="addvars"></span>&gt;<code>addvars <kbd>name</kbd> [ = <kbd>value</kbd>] [...]</code></code></dt>
1633052d159aSCy Schubert<dt><code><code>rmvars <kbd>name</kbd> [...]</code></code></dt>
1634052d159aSCy Schubert<dt><code><code>clearvars</code>&lt;/dt&gt;</code></dt>
1635052d159aSCy Schubert<dd><p>The arguments to these commands consist of a list of items of the form
1636052d159aSCy Schubert<code><kbd>name</kbd> = <kbd>value</kbd></code>, where the <code>= <kbd>value</kbd></code> is ignored,
16372b15cb3dSCy Schubertand can be omitted in read requests.
16382b15cb3dSCy Schubert<code>ntpq</code> maintains an internal list in which data to be included
16392b15cb3dSCy Schubertin control messages can be assembled, and sent using the <code>readlist</code>
16402b15cb3dSCy Schubertand <code>writelist</code> commands described below.
16412b15cb3dSCy SchubertThe <code>addvars</code> command allows variables and optional values
16422b15cb3dSCy Schubertto be added to the list.
16432b15cb3dSCy SchubertIf more than one variable is to be added
16442b15cb3dSCy Schubertthe list should be comma-separated and not contain white space.
16452b15cb3dSCy SchubertThe <code>rmvars</code> command can be used to remove individual variables
16462b15cb3dSCy Schubertfrom the list,
16472b15cb3dSCy Schubertwhile the <code>clearlist</code> command removes all variables from the list.
1648052d159aSCy Schubert</p>
1649052d159aSCy Schubert</dd>
1650a466cc55SCy Schubert<dt><code><span id="cooked"></span><code>cooked</code></code></dt>
1651052d159aSCy Schubert<dd><p>Display server messages in prettyprint format.
1652052d159aSCy Schubert</p>
1653052d159aSCy Schubert</dd>
1654a466cc55SCy Schubert<dt><code><span id="debug"></span><code>debug more | less | off</code></code></dt>
1655052d159aSCy Schubert<dd><p>Turns internal query program debugging on and off.
1656052d159aSCy Schubert</p>
1657052d159aSCy Schubert</dd>
1658a466cc55SCy Schubert<dt><code><span id="delay"></span><code>delay <kbd>milliseconds</kbd></code></code></dt>
1659052d159aSCy Schubert<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.
1660052d159aSCy Schubert</p>
1661052d159aSCy Schubert</dd>
1662a466cc55SCy Schubert<dt><code><span id="host"></span><code>host <kbd>name</kbd></code></code></dt>
1663052d159aSCy Schubert<dd><p>Set the host to which future queries will be sent.
16642b15cb3dSCy SchubertThe name may be either a DNS name or a numeric address.
1665052d159aSCy Schubert</p>
1666052d159aSCy Schubert</dd>
1667a466cc55SCy Schubert<dt><code><span id="hostnames"></span><code>hostnames [yes | no]</code></code></dt>
1668052d159aSCy Schubert<dd><p>If <code>yes</code> is specified, host names are printed in information displays.
16692b15cb3dSCy SchubertIf <code>no</code> is specified, numeric addresses are printed instead.
16702b15cb3dSCy SchubertThe default is <code>yes</code>,
16712b15cb3dSCy Schubertunless modified using the command line <code>-n</code> switch.
1672052d159aSCy Schubert</p>
1673052d159aSCy Schubert</dd>
1674a466cc55SCy Schubert<dt><code><span id="keyid"></span><code>keyid <kbd>keyid</kbd></code></code></dt>
1675052d159aSCy Schubert<dd><p>This command specifies the key number to be used
16762b15cb3dSCy Schubertto authenticate configuration requests.
16772b15cb3dSCy SchubertThis must correspond to a key ID configured in <code>ntp.conf</code> for this purpose.
1678052d159aSCy Schubert</p>
1679052d159aSCy Schubert</dd>
1680a466cc55SCy Schubert<dt><code><span id="keytype"></span><code>keytype</code></code></dt>
1681052d159aSCy Schubert<dd><p>Specify the digest algorithm to use for authenticated requests,
16822b15cb3dSCy Schubertwith default <code>MD5</code>.
16832b15cb3dSCy SchubertIf the OpenSSL library is installed,
16842b15cb3dSCy Schubertdigest can be be any message digest algorithm supported by the library.
168509100258SXin LIThe 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>.
1686052d159aSCy Schubert</p>
1687052d159aSCy Schubert</dd>
1688a466cc55SCy Schubert<dt><code><span id="ntpversion"></span><code>ntpversion 1 | 2 | 3 | 4</code></code></dt>
1689052d159aSCy Schubert<dd><p>Sets the NTP version number which <code>ntpq</code> claims in packets.
16902b15cb3dSCy SchubertDefaults to 2.
16912b15cb3dSCy SchubertNote that mode-6 control messages (and modes, for that matter)
1692052d159aSCy Schubertdidn&rsquo;t exist in NTP version 1.
1693052d159aSCy Schubert</p>
1694052d159aSCy Schubert</dd>
1695a466cc55SCy Schubert<dt><code><span id="passwd"></span><code>passwd</code></code></dt>
1696052d159aSCy Schubert<dd><p>This command prompts for a password to authenticate requests.
16972b15cb3dSCy SchubertThe password must correspond to the key ID configured in <code>ntp.conf</code> for this purpose.
1698052d159aSCy Schubert</p>
1699052d159aSCy Schubert</dd>
1700a466cc55SCy Schubert<dt><code><span id="quit"></span><code>quit</code></code></dt>
1701052d159aSCy Schubert<dd><p>Exit <code>ntpq</code>.
1702052d159aSCy Schubert</p>
1703052d159aSCy Schubert</dd>
1704a466cc55SCy Schubert<dt><code><span id="raw"></span><code>raw</code></code></dt>
1705052d159aSCy Schubert<dd><p>Display server messages as received and without reformatting.
1706052d159aSCy Schubert</p>
1707052d159aSCy Schubert</dd>
1708a466cc55SCy Schubert<dt><code><span id="timeout"></span><code>timeout <kbd>milliseconds</kbd></code></code></dt>
1709052d159aSCy Schubert<dd><p>Specify a timeout period for responses to server queries.
17102b15cb3dSCy SchubertThe default is about 5000 milliseconds.
17112b15cb3dSCy SchubertNote that since <code>ntpq</code> retries each query once after a timeout
17122b15cb3dSCy Schubertthe total waiting time for a timeout will be twice the timeout value set.
1713052d159aSCy Schubert</p>
1714052d159aSCy Schubert</dd>
17152b15cb3dSCy Schubert</dl>
17162b15cb3dSCy Schubert
1717052d159aSCy Schubert<hr>
1718a466cc55SCy Schubert<span id="Control-Message-Commands"></span><div class="header">
1719052d159aSCy Schubert<p>
1720052d159aSCy SchubertNext: <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>
17212b15cb3dSCy Schubert</div>
1722a466cc55SCy Schubert<span id="Control-Message-Commands-2"></span><h3 class="section">1.4 Control Message Commands</h3>
17232b15cb3dSCy Schubert
17242b15cb3dSCy Schubert<p>Association IDs are used to identify system, peer and clock variables.
17252b15cb3dSCy SchubertSystem variables are assigned an association ID of zero and system name space,
17262b15cb3dSCy Schubertwhile each association is assigned a nonzero association ID and peer namespace.
17272b15cb3dSCy SchubertMost control commands send a single mode-6 message to the server
17282b15cb3dSCy Schubertand expect a single response message.
17292b15cb3dSCy SchubertThe exceptions are the <code>peers</code> command,
17302b15cb3dSCy Schubertwhich sends a series of messages,
17312b15cb3dSCy Schubertand the <code>mreadlist</code> and <code>mreadvar</code> commands,
17322b15cb3dSCy Schubertwhich iterate over a range of associations.
1733052d159aSCy Schubert</p>
1734a466cc55SCy Schubert<span id="as"></span><dl compact="compact">
1735052d159aSCy Schubert<dt><code><code>associations</code></code></dt>
1736052d159aSCy Schubert<dd><p>Display a list of mobilized associations in the form:
17372b15cb3dSCy Schubert<br>
17382b15cb3dSCy Schubert<code>ind assid status conf reach auth condition last_event cnt</code>
1739052d159aSCy Schubert</p>
1740052d159aSCy Schubert<table>
1741052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="40%">Description</th></tr></thead>
1742052d159aSCy Schubert<tr><td width="10%"><code>ind</code></td><td width="40%">index on this list</td></tr>
1743052d159aSCy Schubert<tr><td width="10%"><code>assid</code></td><td width="40%">association ID</td></tr>
1744052d159aSCy Schubert<tr><td width="10%"><code>status</code></td><td width="40%"><a href="decode.html#peer">peer status word</a></td></tr>
1745052d159aSCy Schubert<tr><td width="10%"><code>conf</code></td><td width="40%"><code>yes</code>: persistent, <code>no</code>: ephemeral</td></tr>
1746052d159aSCy Schubert<tr><td width="10%"><code>reach</code></td><td width="40%"><code>yes</code>: reachable, <code>no</code>: unreachable</td></tr>
1747052d159aSCy Schubert<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>
1748052d159aSCy Schubert<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>
1749052d159aSCy Schubert<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>
1750052d159aSCy Schubert<tr><td width="10%"><code>cnt</code>
1751052d159aSCy Schubertevent count (see the <code>count</code> field of the <a href="decode.html#peer">peer status word</a>)</td></tr>
1752052d159aSCy Schubert</table>
17532b15cb3dSCy Schubert
1754052d159aSCy Schubert</dd>
1755a466cc55SCy Schubert<dt><code><span id="cv"></span>clockvar <kbd>assocID</kbd> [<kbd>name</kbd> [ = <kbd>value</kbd> [...]] [...]]</code></dt>
1756052d159aSCy Schubert<dt><code>cv <kbd>assocID</kbd> [<kbd>name</kbd> [ = <kbd>value</kbd> [...] ][...]]</code></dt>
1757052d159aSCy Schubert<dd><p>Display a list of &lsquo;clock variables&rsquo; for those associations supporting a reference clock.
1758052d159aSCy Schubert</p>
1759052d159aSCy Schubert</dd>
1760a466cc55SCy Schubert<dt><code><span id="g_t_003aconfig"></span>:config [...]</code></dt>
1761052d159aSCy Schubert<dd><p>Send the remainder of the command line, including whitespace, to the server
17622b15cb3dSCy Schubertas a run-time configuration command in the same format
17632b15cb3dSCy Schubertas the configuration file.
17642b15cb3dSCy SchubertThis command is experimental until further notice and clarification.
17652b15cb3dSCy SchubertAuthentication is of course required.
1766052d159aSCy Schubert</p>
1767052d159aSCy Schubert</dd>
1768a466cc55SCy Schubert<dt><code><span id="config_002dfrom_002dfile"></span>config-from-file <kbd>filename</kbd></code></dt>
1769052d159aSCy Schubert<dd><p>Send the each line of <kbd>filename</kbd> to the server as
17702b15cb3dSCy Schubertrun-time configuration commands in the same format as the configuration file.
17712b15cb3dSCy SchubertThis command is experimental until further notice and clarification.
17722b15cb3dSCy SchubertAuthentication is required.
1773052d159aSCy Schubert</p>
1774052d159aSCy Schubert</dd>
1775a466cc55SCy Schubert<dt><code><span id="ifstats"></span>ifstats</code></dt>
1776052d159aSCy Schubert<dd><p>Display statistics for each local network address.
17772b15cb3dSCy SchubertAuthentication is required.
1778052d159aSCy Schubert</p>
1779052d159aSCy Schubert</dd>
1780a466cc55SCy Schubert<dt><code><span id="iostats"></span>iostats</code></dt>
1781052d159aSCy Schubert<dd><p>Display network and reference clock I/O statistics.
1782052d159aSCy Schubert</p>
1783052d159aSCy Schubert</dd>
1784a466cc55SCy Schubert<dt><code><span id="kerninfo"></span>kerninfo</code></dt>
1785052d159aSCy Schubert<dd><p>Display kernel loop and PPS statistics.
17862b15cb3dSCy SchubertAs with other ntpq output, times are in milliseconds.
17872b15cb3dSCy SchubertThe precision value displayed is in milliseconds as well,
17882b15cb3dSCy Schubertunlike the precision system variable.
1789052d159aSCy Schubert</p>
1790052d159aSCy Schubert</dd>
1791a466cc55SCy Schubert<dt><code><span id="lassoc"></span>lassociations</code></dt>
1792052d159aSCy Schubert<dd><p>Perform the same function as the associations command,
17932b15cb3dSCy Schubertexcept display mobilized and unmobilized associations.
1794052d159aSCy Schubert</p>
1795052d159aSCy Schubert</dd>
1796a466cc55SCy Schubert<dt><code><span id="monstats"></span>monstats</code></dt>
1797052d159aSCy Schubert<dd><p>Display monitor facility statistics.
1798052d159aSCy Schubert</p>
1799052d159aSCy Schubert</dd>
1800a466cc55SCy Schubert<dt><code><span id="mrulist"></span>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>
1801052d159aSCy Schubert<dd><p>Obtain and print traffic counts collected and maintained by
18022b15cb3dSCy Schubertthe monitor facility.
1803052d159aSCy SchubertWith the exception of <code>sort=<kbd>sortorder</kbd></code>,
18042b15cb3dSCy Schubertthe options filter the list returned by <code>ntpd</code>.
18052b15cb3dSCy SchubertThe <code>limited</code> and <code>kod</code> options return only entries
18062b15cb3dSCy Schubertrepresenting client addresses from which the last packet received
18072b15cb3dSCy Schuberttriggered either discarding or a KoD response.
1808052d159aSCy SchubertThe <code>mincount=<kbd>count</kbd></code> option filters entries representing
1809052d159aSCy Schubertless than <code><kbd>count</kbd></code> packets.
1810052d159aSCy SchubertThe <code>laddr=<kbd>localaddr</kbd></code> option filters entries for packets
1811052d159aSCy Schubertreceived on any local address other than <code><kbd>localaddr</kbd></code>.
1812052d159aSCy Schubert<code>resany=<kbd>hexmask</kbd></code> and <code>resall=<kbd>hexmask</kbd></code>
18132b15cb3dSCy Schubertfilter entries containing none or less than all, respectively,
1814052d159aSCy Schubertof the bits in <code><kbd>hexmask</kbd></code>, which must begin with <code>0x</code>.
18152b15cb3dSCy Schubert<br>
1816052d159aSCy SchubertThe <code><kbd>sortorder</kbd></code> defaults to <code>lstint</code> and may be any of
18172b15cb3dSCy Schubert<code>addr</code>, <code>count</code>, <code>avgint</code>, <code>lstint</code>, or
18182b15cb3dSCy Schubertany of those preceded by a minus sign (hyphen) to reverse the sort order.
18192b15cb3dSCy SchubertThe output columns are:
1820052d159aSCy Schubert</p>
1821052d159aSCy Schubert<table>
1822052d159aSCy Schubert<thead><tr><th width="10%">Column</th><th width="40%">Description</th></tr></thead>
1823052d159aSCy Schubert<tr><td width="10%"><code>lstint</code></td><td width="40%">Interval in s between the receipt of the most recent packet from this
1824052d159aSCy Schubertaddress and the completion of the retrieval of the MRU list by <code>ntpq</code></td></tr>
1825052d159aSCy Schubert<tr><td width="10%"><code>avgint</code></td><td width="40%">Average interval in s between packets from this address.</td></tr>
1826052d159aSCy Schubert<tr><td width="10%"><code>rstr</code></td><td width="40%">Restriction flags associated with this address.
18272b15cb3dSCy SchubertMost are copied unchanged from the matching <code>restrict</code> command,
18282b15cb3dSCy Schuberthowever 0x400 (kod) and 0x20 (limited) flags are cleared unless
1829052d159aSCy Schubertthe last packet from this address triggered a rate control response.</td></tr>
1830052d159aSCy Schubert<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
18312b15cb3dSCy Schubertno rate control response, rate limiting by discarding, or
1832052d159aSCy Schubertrate limiting with a KoD response, respectively.</td></tr>
1833052d159aSCy Schubert<tr><td width="10%"><code>m</code></td><td width="40%">Packet mode.</td></tr>
1834052d159aSCy Schubert<tr><td width="10%"><code>v</code></td><td width="40%">Packet version number.</td></tr>
1835052d159aSCy Schubert<tr><td width="10%"><code>count</code></td><td width="40%">Packets received from this address.</td></tr>
1836052d159aSCy Schubert<tr><td width="10%"><code>rport</code></td><td width="40%">Source port of last packet from this address.</td></tr>
1837052d159aSCy Schubert<tr><td width="10%"><code>remote address</code></td><td width="40%">DNS name, numeric address, or address followed by claimed DNS name which
1838052d159aSCy Schubertcould not be verified in parentheses.</td></tr>
1839052d159aSCy Schubert</table>
18402b15cb3dSCy Schubert
1841052d159aSCy Schubert</dd>
1842a466cc55SCy Schubert<dt><code><span id="mreadvar"></span><code>mreadvar <kbd>assocID</kbd> <kbd>assocID</kbd> [ <kbd>variable_name</kbd> [ = <kbd>value</kbd>[ ... ]</code></code></dt>
1843a466cc55SCy Schubert<dt><code><span id="mrv"></span><code>mrv <kbd>assocID</kbd> <kbd>assocID</kbd> [ <kbd>variable_name</kbd> [ = <kbd>value</kbd>[ ... ]</code></code></dt>
1844052d159aSCy Schubert<dd><p>Perform the same function as the <code>readvar</code> command,
18452b15cb3dSCy Schubertexcept for a range of association IDs.
18462b15cb3dSCy SchubertThis range is determined from the association list cached by
18472b15cb3dSCy Schubertthe most recent <code>associations</code> command.
1848052d159aSCy Schubert</p>
1849052d159aSCy Schubert</dd>
1850a466cc55SCy Schubert<dt><code><span id="passoc"></span><code>passociations</code></code></dt>
1851052d159aSCy Schubert<dd><p>Perform the same function as the <code>associations command</code>, except that
18522b15cb3dSCy Schubertit uses previously stored data rather than making a new query.
1853052d159aSCy Schubert</p>
1854052d159aSCy Schubert</dd>
1855a466cc55SCy Schubert<dt><code><span id="pe"></span><code>peers</code></code></dt>
1856052d159aSCy Schubert<dd><p>Display a list of peers in the form:
18572b15cb3dSCy Schubert<br>
18582b15cb3dSCy Schubert<code>[tally]remote refid st t when pool reach delay offset jitter</code>
1859052d159aSCy Schubert</p>
1860052d159aSCy Schubert<table>
1861052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
1862052d159aSCy Schubert<tr><td width="10%"><code>[tally]</code></td><td width="20%">single-character code indicating current value of the <code>select</code> field
1863052d159aSCy Schubertof the <a href="decode.html#peer">peer status word</a>.</td></tr>
1864052d159aSCy Schubert<tr><td width="10%"><code>remote</code></td><td width="20%">host name (or IP number) of peer</td></tr>
1865052d159aSCy Schubert<tr><td width="10%"><code>refid</code></td><td width="20%">association ID or <a href="decode.html#kiss">kiss code</a>.</td></tr>
1866052d159aSCy Schubert<tr><td width="10%"><code>st</code></td><td width="20%">stratum</td></tr>
1867052d159aSCy Schubert<tr><td width="10%"><code>t</code></td><td width="20%"><code>u</code>: unicast or manycast client,
18682b15cb3dSCy Schubert<code>b</code>: broadcast or multicast client,
18692b15cb3dSCy Schubert<code>l</code>: local (reference clock),
18702b15cb3dSCy Schubert<code>s</code>: symmetric (peer),
18712b15cb3dSCy Schubert<code>A</code>: manycast server,
18722b15cb3dSCy Schubert<code>B</code>: broadcast server,
1873052d159aSCy Schubert<code>M</code>: multicast server.</td></tr>
1874052d159aSCy Schubert<tr><td width="10%"><code>when</code></td><td width="20%">sec/min/hr since last received packet</td></tr>
1875052d159aSCy Schubert<tr><td width="10%"><code>poll</code></td><td width="20%">poll interval (log(2) s)</td></tr>
1876052d159aSCy Schubert<tr><td width="10%"><code>reach</code></td><td width="20%">reach shift register (octal)</td></tr>
1877052d159aSCy Schubert<tr><td width="10%"><code>delay</code></td><td width="20%">roundtrip delay</td></tr>
1878052d159aSCy Schubert<tr><td width="10%"><code>offset</code></td><td width="20%">offset of server relative to this host</td></tr>
1879052d159aSCy Schubert<tr><td width="10%"><code>jitter</code></td><td width="20%">jitter</td></tr>
1880052d159aSCy Schubert</table>
18812b15cb3dSCy Schubert
1882052d159aSCy Schubert</dd>
1883a466cc55SCy Schubert<dt><code><span id="rv"></span>readvar <kbd>assocID</kbd> <kbd>name</kbd> [ = <kbd>value</kbd> ] [,...]</code></dt>
1884052d159aSCy Schubert<dt><code>rv <kbd>assocID</kbd> [ <kbd>name</kbd> ] [,...]</code></dt>
1885052d159aSCy Schubert<dd><p>Display the specified variables.
1886052d159aSCy SchubertIf <code><kbd>assocID</kbd></code> is zero,
1887052d159aSCy Schubertthe variables are from the &lsquo;system variables&rsquo; name space,
1888052d159aSCy Schubertotherwise they are from the &lsquo;peer variables&rsquo; name space.
18892b15cb3dSCy SchubertThe <kbd>assocID</kbd> is required, as the same name can occur in both spaces.
18902b15cb3dSCy SchubertIf no <kbd>name</kbd> is included,
18912b15cb3dSCy Schubertall operative variables in the name space are displayed.
1892052d159aSCy SchubertIn this case only, if the <code><kbd>assocID</kbd></code> is omitted, it is assumed zero.
18932b15cb3dSCy SchubertMultiple names are specified with comma separators and without whitespace.
18942b15cb3dSCy SchubertNote that time values are represented in milliseconds and
18952b15cb3dSCy Schubertfrequency values in parts-per-million (PPM).
18962b15cb3dSCy SchubertSome NTP timestamps are represented in the format YYYYMMDDTTTT,
18972b15cb3dSCy Schubertwhere YYYY is the year, MM the month of year, DD the day of month and
18982b15cb3dSCy SchubertTTTT the time of day.
1899052d159aSCy Schubert</p>
1900052d159aSCy Schubert</dd>
1901a466cc55SCy Schubert<dt><code><span id="saveconfig"></span><code>saveconfig <kbd>filename</kbd></code></code></dt>
1902052d159aSCy Schubert<dd><p>Write the current configuration, including any runtime modifications
19032b15cb3dSCy Schubertgiven with <code>:config</code> or <code>config-from-file</code>,
1904052d159aSCy Schubertto the ntpd host&rsquo;s file <kbd>filename</kbd>.
19052b15cb3dSCy SchubertThis command will be rejected by the server unless
19062b15cb3dSCy Schubert<a href="miscopt.html#saveconfigdir">saveconfigdir</a>
19072b15cb3dSCy Schubertappears in the <code>ntpd</code> configuration file.
19082b15cb3dSCy Schubert<kbd>filename</kbd> can use <code>strftime()</code> format specifiers
19092b15cb3dSCy Schubertto substitute the current date and time, for example,
19102b15cb3dSCy Schubert<code>saveconfig ntp-%Y%m%d-%H%M%S.conf</code>.
19112b15cb3dSCy SchubertThe filename used is stored in system variable <code>savedconfig</code>.
19122b15cb3dSCy SchubertAuthentication is required.
1913052d159aSCy Schubert</p>
1914052d159aSCy Schubert</dd>
1915a466cc55SCy Schubert<dt><code><span id="writevar"></span>writevar <kbd>assocID</kbd> <kbd>name</kbd> = <kbd>value</kbd> [,...]</code></dt>
1916052d159aSCy Schubert<dd><p>Write the specified variables.
1917052d159aSCy SchubertIf the <code><kbd>assocID</kbd></code> is zero, the variables are from the
1918052d159aSCy Schubert&lsquo;system variables&rsquo; name space, otherwise they are from the
1919052d159aSCy Schubert&lsquo;peer variables&rsquo; name	space.
1920052d159aSCy SchubertThe <code><kbd>assocID</kbd></code> is required,
19212b15cb3dSCy Schubertas the same name can occur in both spaces.
1922052d159aSCy Schubert</p>
1923052d159aSCy Schubert</dd>
1924a466cc55SCy Schubert<dt><code><span id="sysinfo"></span><code>sysinfo</code></code></dt>
1925052d159aSCy Schubert<dd><p>Display operational summary.
1926052d159aSCy Schubert</p>
1927052d159aSCy Schubert</dd>
1928a466cc55SCy Schubert<dt><code><span id="sysstats"></span><code>sysstats</code></code></dt>
1929052d159aSCy Schubert<dd><p>Print statistics counters maintained in the protocol module.
1930052d159aSCy Schubert</p>
1931052d159aSCy Schubert</dd>
19322b15cb3dSCy Schubert</dl>
19332b15cb3dSCy Schubert
1934052d159aSCy Schubert<hr>
1935a466cc55SCy Schubert<span id="Status-Words-and-Kiss-Codes"></span><div class="header">
1936052d159aSCy Schubert<p>
1937052d159aSCy SchubertNext: <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>
19382b15cb3dSCy Schubert</div>
1939a466cc55SCy Schubert<span id="Status-Words-and-Kiss-Codes-2"></span><h3 class="section">1.5 Status Words and Kiss Codes</h3>
19402b15cb3dSCy Schubert
19412b15cb3dSCy Schubert<p>The current state of the operating program is shown
19422b15cb3dSCy Schubertin a set of status words maintained by the system
19432b15cb3dSCy Schubertand each association separately.
19442b15cb3dSCy SchubertThese words are displayed in the <code>rv</code> and <code>as</code> commands
19452b15cb3dSCy Schubertboth in hexadecimal and decoded short tip strings.
19462b15cb3dSCy SchubertThe codes, tips and short explanations are on the
19472b15cb3dSCy Schubert<a href="decode.html">Event Messages and Status Words</a> page.
19482b15cb3dSCy SchubertThe page also includes a list of system and peer messages,
19492b15cb3dSCy Schubertthe code for the latest of which is included in the status word.
1950052d159aSCy Schubert</p>
19512b15cb3dSCy Schubert<p>Information resulting from protocol machine state transitions
19522b15cb3dSCy Schubertis displayed using an informal set of ASCII strings called
19532b15cb3dSCy Schubert<a href="decode.html#kiss">kiss codes</a>.
1954052d159aSCy SchubertThe original purpose was for kiss-o&rsquo;-death (KoD) packets sent
19552b15cb3dSCy Schubertby the server to advise the client of an unusual condition.
19562b15cb3dSCy SchubertThey are now displayed, when appropriate,
19572b15cb3dSCy Schubertin the reference identifier field in various billboards.
1958052d159aSCy Schubert</p>
1959052d159aSCy Schubert<hr>
1960a466cc55SCy Schubert<span id="System-Variables"></span><div class="header">
1961052d159aSCy Schubert<p>
1962052d159aSCy SchubertNext: <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>
19632b15cb3dSCy Schubert</div>
1964a466cc55SCy Schubert<span id="System-Variables-2"></span><h3 class="section">1.6 System Variables</h3>
19652b15cb3dSCy Schubert
19662b15cb3dSCy Schubert<p>The following system variables appear in the <code>rv</code> billboard.
19672b15cb3dSCy SchubertNot all variables are displayed in some configurations.
1968052d159aSCy Schubert</p>
1969052d159aSCy Schubert<table>
1970052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
1971052d159aSCy Schubert<tr><td width="10%"><code>status</code></td><td width="20%"><a href="decode.html#sys">system status word</a></td></tr>
1972052d159aSCy Schubert<tr><td width="10%"><code>version</code></td><td width="20%">NTP software version and build time</td></tr>
1973052d159aSCy Schubert<tr><td width="10%"><code>processor</code></td><td width="20%">hardware platform and version</td></tr>
1974052d159aSCy Schubert<tr><td width="10%"><code>system</code></td><td width="20%">operating system and version</td></tr>
1975052d159aSCy Schubert<tr><td width="10%"><code>leap</code></td><td width="20%">leap warning indicator (0-3)</td></tr>
1976052d159aSCy Schubert<tr><td width="10%"><code>stratum</code></td><td width="20%">stratum (1-15)</td></tr>
1977052d159aSCy Schubert<tr><td width="10%"><code>precision</code></td><td width="20%">precision (log(2) s)</td></tr>
1978052d159aSCy Schubert<tr><td width="10%"><code>rootdelay</code></td><td width="20%">total roundtrip delay to the primary reference clock</td></tr>
1979052d159aSCy Schubert<tr><td width="10%"><code>rootdisp</code></td><td width="20%">total dispersion to the primary reference clock</td></tr>
1980052d159aSCy Schubert<tr><td width="10%"><code>peer</code></td><td width="20%">system peer association ID</td></tr>
1981052d159aSCy Schubert<tr><td width="10%"><code>tc</code>
1982052d159aSCy Schuberttime constant and poll exponent (log(2) s) (3-17)</td></tr>
1983052d159aSCy Schubert<tr><td width="10%"><code>mintc</code>
1984052d159aSCy Schubertminimum time constant (log(2) s) (3-10)</td></tr>
1985052d159aSCy Schubert<tr><td width="10%"><code>clock</code></td><td width="20%">date and time of day</td></tr>
1986052d159aSCy Schubert<tr><td width="10%"><code>refid</code>
1987052d159aSCy Schubertreference ID or <a href="decode.html#kiss">kiss code</a></td></tr>
1988052d159aSCy Schubert<tr><td width="10%"><code>reftime</code></td><td width="20%">reference time</td></tr>
1989052d159aSCy Schubert<tr><td width="10%"><code>offset</code></td><td width="20%">combined offset of server relative to this host</td></tr>
1990052d159aSCy Schubert<tr><td width="10%"><code>sys_jitter</code></td><td width="20%">combined system jitter</td></tr>
1991052d159aSCy Schubert<tr><td width="10%"><code>frequency</code></td><td width="20%">frequency offset (PPM) relative to hardware clock</td></tr>
1992052d159aSCy Schubert<tr><td width="10%"><code>clk_wander</code></td><td width="20%">clock frequency wander (PPM)</td></tr>
1993052d159aSCy Schubert<tr><td width="10%"><code>clk_jitter</code></td><td width="20%">clock jitter</td></tr>
1994052d159aSCy Schubert<tr><td width="10%"><code>tai</code></td><td width="20%">TAI-UTC offset (s)</td></tr>
1995052d159aSCy Schubert<tr><td width="10%"><code>leapsec</code></td><td width="20%">NTP seconds when the next leap second is/was inserted</td></tr>
1996052d159aSCy Schubert<tr><td width="10%"><code>expire</code></td><td width="20%">NTP seconds when the NIST leapseconds file expires</td></tr>
1997052d159aSCy Schubert</table>
19982b15cb3dSCy Schubert
19992b15cb3dSCy Schubert<p>The jitter and wander statistics are exponentially-weighted RMS averages.
20002b15cb3dSCy SchubertThe system jitter is defined in the NTPv4 specification;
20012b15cb3dSCy Schubertthe clock jitter statistic is computed by the clock discipline module.
2002052d159aSCy Schubert</p>
20032b15cb3dSCy Schubert<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
20042b15cb3dSCy Schubertadditional system variables are displayed, including some or all of the
20052b15cb3dSCy Schubertfollowing, depending on the particular Autokey dance:
2006052d159aSCy Schubert</p>
2007052d159aSCy Schubert<table>
2008052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2009052d159aSCy Schubert<tr><td width="10%"><code>host</code></td><td width="20%">Autokey host name for this host</td></tr>
2010052d159aSCy Schubert<tr><td width="10%"><code>ident</code></td><td width="20%">Autokey group name for this host</td></tr>
2011052d159aSCy Schubert<tr><td width="10%"><code>flags</code></td><td width="20%">host flags  (see Autokey specification)</td></tr>
2012052d159aSCy Schubert<tr><td width="10%"><code>digest</code></td><td width="20%">OpenSSL message digest algorithm</td></tr>
2013052d159aSCy Schubert<tr><td width="10%"><code>signature</code></td><td width="20%">OpenSSL digest/signature scheme</td></tr>
2014052d159aSCy Schubert<tr><td width="10%"><code>update</code></td><td width="20%">NTP seconds at last signature update</td></tr>
2015052d159aSCy Schubert<tr><td width="10%"><code>cert</code></td><td width="20%">certificate subject, issuer and certificate flags</td></tr>
2016052d159aSCy Schubert<tr><td width="10%"><code>until</code></td><td width="20%">NTP seconds when the certificate expires</td></tr>
2017052d159aSCy Schubert</table>
20182b15cb3dSCy Schubert
2019052d159aSCy Schubert<hr>
2020a466cc55SCy Schubert<span id="Peer-Variables"></span><div class="header">
2021052d159aSCy Schubert<p>
2022052d159aSCy SchubertNext: <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>
20232b15cb3dSCy Schubert</div>
2024a466cc55SCy Schubert<span id="Peer-Variables-2"></span><h3 class="section">1.7 Peer Variables</h3>
20252b15cb3dSCy Schubert
20262b15cb3dSCy Schubert<p>The following peer variables appear in the <code>rv</code> billboard
20272b15cb3dSCy Schubertfor each association.
20282b15cb3dSCy SchubertNot all variables are displayed in some configurations.
2029052d159aSCy Schubert</p>
2030052d159aSCy Schubert<table>
2031052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2032052d159aSCy Schubert<tr><td width="10%"><code>associd</code></td><td width="20%">association ID</td></tr>
2033052d159aSCy Schubert<tr><td width="10%"><code>status</code></td><td width="20%"><a href="decode.html#peer">peer status word</a></td></tr>
2034a466cc55SCy Schubert<tr><td width="10%"><code>srcadr</code></td><td width="20%">source (remote) IP address and port</td></tr>
2035a466cc55SCy Schubert<tr><td width="10%"><code>dstadr</code></td><td width="20%">destination (local) IP address and port</td></tr>
2036052d159aSCy Schubert<tr><td width="10%"><code>leap</code></td><td width="20%">leap indicator (0-3)</td></tr>
2037052d159aSCy Schubert<tr><td width="10%"><code>stratum</code></td><td width="20%">stratum (0-15)</td></tr>
2038052d159aSCy Schubert<tr><td width="10%"><code>precision</code></td><td width="20%">precision (log(2) s)</td></tr>
2039052d159aSCy Schubert<tr><td width="10%"><code>rootdelay</code></td><td width="20%">total roundtrip delay to the primary reference clock</td></tr>
2040052d159aSCy Schubert<tr><td width="10%"><code>rootdisp</code></td><td width="20%">total root dispersion to the primary reference clock</td></tr>
2041052d159aSCy Schubert<tr><td width="10%"><code>refid</code></td><td width="20%">reference ID or <a href="decode.html#kiss">kiss code</a></td></tr>
2042052d159aSCy Schubert<tr><td width="10%"><code>reftime</code></td><td width="20%">reference time</td></tr>
2043052d159aSCy Schubert<tr><td width="10%"><code>reach</code></td><td width="20%">reach register (octal)</td></tr>
2044052d159aSCy Schubert<tr><td width="10%"><code>unreach</code></td><td width="20%">unreach counter</td></tr>
2045052d159aSCy Schubert<tr><td width="10%"><code>hmode</code></td><td width="20%">host mode (1-6)</td></tr>
2046052d159aSCy Schubert<tr><td width="10%"><code>pmode</code></td><td width="20%">peer mode (1-5)</td></tr>
2047052d159aSCy Schubert<tr><td width="10%"><code>hpoll</code></td><td width="20%">host poll exponent (log(2) s) (3-17)</td></tr>
2048052d159aSCy Schubert<tr><td width="10%"><code>ppoll</code></td><td width="20%">peer poll exponent (log(2) s) (3-17)</td></tr>
2049052d159aSCy Schubert<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>
2050052d159aSCy Schubert<tr><td width="10%"><code>flash</code></td><td width="20%"><a href="decode.html#flash">flash status word</a></td></tr>
2051052d159aSCy Schubert<tr><td width="10%"><code>offset</code></td><td width="20%">filter offset</td></tr>
2052052d159aSCy Schubert<tr><td width="10%"><code>delay</code></td><td width="20%">filter delay</td></tr>
2053052d159aSCy Schubert<tr><td width="10%"><code>dispersion</code></td><td width="20%">filter dispersion</td></tr>
2054052d159aSCy Schubert<tr><td width="10%"><code>jitter</code></td><td width="20%">filter jitter</td></tr>
2055052d159aSCy Schubert<tr><td width="10%"><code>ident</code></td><td width="20%">Autokey group name for this association</td></tr>
2056052d159aSCy Schubert<tr><td width="10%"><code>bias</code></td><td width="20%">unicast/broadcast bias</td></tr>
2057052d159aSCy Schubert<tr><td width="10%"><code>xleave</code></td><td width="20%">interleave delay (see <a href="xleave.html">NTP Interleaved Modes</a>)</td></tr>
2058052d159aSCy Schubert</table>
20592b15cb3dSCy Schubert
20602b15cb3dSCy Schubert<p>The bias variable is calculated when the first broadcast packet is received
20612b15cb3dSCy Schubertafter the calibration volley.  It represents the offset of the broadcast
20622b15cb3dSCy Schubertsubgraph relative to the unicast subgraph.  The xleave variable appears
20632b15cb3dSCy Schubertonly the interleaved symmetric and interleaved modes.  It represents
20642b15cb3dSCy Schubertthe internal queuing, buffering and transmission delays for the preceding
20652b15cb3dSCy Schubertpacket.
2066052d159aSCy Schubert</p>
20672b15cb3dSCy Schubert<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
20682b15cb3dSCy Schubertadditional peer variables are displayed, including the following:
2069052d159aSCy Schubert</p>
2070052d159aSCy Schubert<table>
2071052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2072052d159aSCy Schubert<tr><td width="10%"><code>flags</code></td><td width="20%">peer flags (see Autokey specification)</td></tr>
2073052d159aSCy Schubert<tr><td width="10%"><code>host</code></td><td width="20%">Autokey server name</td></tr>
2074052d159aSCy Schubert<tr><td width="10%"><code>flags</code></td><td width="20%">peer flags (see Autokey specification)</td></tr>
2075052d159aSCy Schubert<tr><td width="10%"><code>signature</code></td><td width="20%">OpenSSL digest/signature scheme</td></tr>
2076052d159aSCy Schubert<tr><td width="10%"><code>initsequence</code></td><td width="20%">initial key ID</td></tr>
2077052d159aSCy Schubert<tr><td width="10%"><code>initkey</code></td><td width="20%">initial key index</td></tr>
2078052d159aSCy Schubert<tr><td width="10%"><code>timestamp</code></td><td width="20%">Autokey signature timestamp</td></tr>
2079052d159aSCy Schubert</table>
20802b15cb3dSCy Schubert
2081052d159aSCy Schubert<hr>
2082a466cc55SCy Schubert<span id="Clock-Variables"></span><div class="header">
2083052d159aSCy Schubert<p>
2084052d159aSCy SchubertPrevious: <a href="#Peer-Variables" accesskey="p" rel="prev">Peer Variables</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
20852b15cb3dSCy Schubert</div>
2086a466cc55SCy Schubert<span id="Clock-Variables-2"></span><h3 class="section">1.8 Clock Variables</h3>
20872b15cb3dSCy Schubert
20882b15cb3dSCy Schubert<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.
2089052d159aSCy Schubert</p>
2090052d159aSCy Schubert<table>
2091052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2092052d159aSCy Schubert<tr><td width="10%"><code>associd</code></td><td width="20%">association ID</td></tr>
2093052d159aSCy Schubert<tr><td width="10%"><code>status</code></td><td width="20%"><a href="decode.html#clock">clock status word</a></td></tr>
2094052d159aSCy Schubert<tr><td width="10%"><code>device</code></td><td width="20%">device description</td></tr>
2095052d159aSCy Schubert<tr><td width="10%"><code>timecode</code></td><td width="20%">ASCII time code string (specific to device)</td></tr>
2096052d159aSCy Schubert<tr><td width="10%"><code>poll</code></td><td width="20%">poll messages sent</td></tr>
2097052d159aSCy Schubert<tr><td width="10%"><code>noreply</code></td><td width="20%">no reply</td></tr>
2098052d159aSCy Schubert<tr><td width="10%"><code>badformat</code></td><td width="20%">bad format</td></tr>
2099052d159aSCy Schubert<tr><td width="10%"><code>baddata</code></td><td width="20%">bad date or time</td></tr>
2100052d159aSCy Schubert<tr><td width="10%"><code>fudgetime1</code></td><td width="20%">fudge time 1</td></tr>
2101052d159aSCy Schubert<tr><td width="10%"><code>fudgetime2</code></td><td width="20%">fudge time 2</td></tr>
2102052d159aSCy Schubert<tr><td width="10%"><code>stratum</code></td><td width="20%">driver stratum</td></tr>
2103052d159aSCy Schubert<tr><td width="10%"><code>refid</code></td><td width="20%">driver reference ID</td></tr>
2104052d159aSCy Schubert<tr><td width="10%"><code>flags</code></td><td width="20%">driver flags</td></tr>
2105052d159aSCy Schubert</table>
2106052d159aSCy Schubert<hr>
21072b15cb3dSCy Schubert
21082b15cb3dSCy Schubert
21092b15cb3dSCy Schubert
2110052d159aSCy Schubert</body>
2111052d159aSCy Schubert</html>
2112