xref: /freebsd/contrib/ntp/ntpq/ntpq.html (revision 052d159a8b83f03d7dc5eb31cd9a9b4a6fe3d9da)
1*052d159aSCy Schubert<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2*052d159aSCy Schubert<html>
3*052d159aSCy Schubert<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
42b15cb3dSCy Schubert<head>
5*052d159aSCy Schubert<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6*052d159aSCy Schubert<title>ntpq: Network Time Protocol Query User&rsquo;s Manual</title>
7*052d159aSCy Schubert
8*052d159aSCy Schubert<meta name="description" content="ntpq: Network Time Protocol Query User&rsquo;s Manual">
9*052d159aSCy Schubert<meta name="keywords" content="ntpq: Network Time Protocol Query User&rsquo;s Manual">
10*052d159aSCy Schubert<meta name="resource-type" content="document">
11*052d159aSCy Schubert<meta name="distribution" content="global">
12*052d159aSCy Schubert<meta name="Generator" content="makeinfo">
13*052d159aSCy Schubert<link href="#Top" rel="start" title="Top">
14*052d159aSCy Schubert<link href="dir.html#Top" rel="up" title="(dir)">
15*052d159aSCy Schubert<style type="text/css">
16*052d159aSCy Schubert<!--
17*052d159aSCy Schuberta.summary-letter {text-decoration: none}
18*052d159aSCy Schubertblockquote.indentedblock {margin-right: 0em}
19*052d159aSCy Schubertblockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
20*052d159aSCy Schubertblockquote.smallquotation {font-size: smaller}
21*052d159aSCy Schubertdiv.display {margin-left: 3.2em}
22*052d159aSCy Schubertdiv.example {margin-left: 3.2em}
23*052d159aSCy Schubertdiv.lisp {margin-left: 3.2em}
24*052d159aSCy Schubertdiv.smalldisplay {margin-left: 3.2em}
25*052d159aSCy Schubertdiv.smallexample {margin-left: 3.2em}
26*052d159aSCy Schubertdiv.smalllisp {margin-left: 3.2em}
27*052d159aSCy Schubertkbd {font-style: oblique}
282b15cb3dSCy Schubertpre.display {font-family: inherit}
292b15cb3dSCy Schubertpre.format {font-family: inherit}
30*052d159aSCy Schubertpre.menu-comment {font-family: serif}
31*052d159aSCy Schubertpre.menu-preformatted {font-family: serif}
322b15cb3dSCy Schubertpre.smalldisplay {font-family: inherit; font-size: smaller}
332b15cb3dSCy Schubertpre.smallexample {font-size: smaller}
34*052d159aSCy Schubertpre.smallformat {font-family: inherit; font-size: smaller}
352b15cb3dSCy Schubertpre.smalllisp {font-size: smaller}
36*052d159aSCy Schubertspan.nolinebreak {white-space: nowrap}
37*052d159aSCy Schubertspan.roman {font-family: initial; font-weight: normal}
38*052d159aSCy Schubertspan.sansserif {font-family: sans-serif; font-weight: normal}
39*052d159aSCy Schubertul.no-bullet {list-style: none}
40*052d159aSCy Schubert-->
41*052d159aSCy Schubert</style>
42*052d159aSCy Schubert
43*052d159aSCy Schubert
442b15cb3dSCy Schubert</head>
45*052d159aSCy Schubert
46*052d159aSCy Schubert<body lang="en">
47*052d159aSCy Schubert<h1 class="settitle" align="center">ntpq: Network Time Protocol Query User&rsquo;s Manual</h1>
48*052d159aSCy Schubert
49*052d159aSCy Schubert
50*052d159aSCy Schubert
51*052d159aSCy Schubert
52*052d159aSCy Schubert
53*052d159aSCy Schubert<a name="SEC_Overview"></a>
54*052d159aSCy Schubert<h2 class="shortcontents-heading">Short Table of Contents</h2>
55*052d159aSCy Schubert
562b15cb3dSCy Schubert<div class="shortcontents">
57*052d159aSCy Schubert<ul class="no-bullet">
58*052d159aSCy Schubert<li><a name="stoc-Description" href="#toc-Description">1 Description</a></li>
592b15cb3dSCy Schubert</ul>
602b15cb3dSCy Schubert</div>
612b15cb3dSCy Schubert
622b15cb3dSCy Schubert
63*052d159aSCy Schubert<a name="Top"></a>
64*052d159aSCy Schubert<div class="header">
65*052d159aSCy Schubert<p>
66*052d159aSCy 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>
672b15cb3dSCy Schubert</div>
68*052d159aSCy Schubert<a name="ntpq_003a-Network-Time-Protocol-Query-User-Manual"></a>
69*052d159aSCy Schubert<h1 class="top">ntpq: Network Time Protocol Query User Manual</h1>
702b15cb3dSCy Schubert
712b15cb3dSCy Schubert<p>The <code>ntpq</code> utility program is used to
722b15cb3dSCy Schubertmonitor the operational status
732b15cb3dSCy Schubertand determine the performance of
742b15cb3dSCy Schubert<code>ntpd</code>, the NTP daemon.
75*052d159aSCy Schubert</p>
76*052d159aSCy Schubert<p>This document applies to version 4.2.8p13 of <code>ntpq</code>.
77*052d159aSCy Schubert</p>
78*052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
79*052d159aSCy 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">
80*052d159aSCy Schubert</td></tr>
81*052d159aSCy 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
82*052d159aSCy Schubert</td></tr>
83*052d159aSCy 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">
84*052d159aSCy Schubert</td></tr>
85*052d159aSCy 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">
86*052d159aSCy Schubert</td></tr>
87*052d159aSCy 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">
88*052d159aSCy Schubert</td></tr>
89*052d159aSCy 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">
90*052d159aSCy Schubert</td></tr>
91*052d159aSCy 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">
92*052d159aSCy Schubert</td></tr>
93*052d159aSCy 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">
94*052d159aSCy Schubert</td></tr>
95*052d159aSCy 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">
96*052d159aSCy Schubert</td></tr>
97*052d159aSCy Schubert</table>
982b15cb3dSCy Schubert
99*052d159aSCy Schubert<hr>
100*052d159aSCy Schubert<a name="ntpq-Description"></a>
101*052d159aSCy Schubert<div class="header">
102*052d159aSCy Schubert<p>
103*052d159aSCy 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>
1042b15cb3dSCy Schubert</div>
105*052d159aSCy Schubert<a name="Description"></a>
106*052d159aSCy Schubert<h2 class="chapter">1 Description</h2>
1072b15cb3dSCy Schubert
1082b15cb3dSCy Schubert<p>The <code>ntpq</code> utility program is used to monitor NTP daemon <code>ntpd</code> operations and determine performance.
1092b15cb3dSCy SchubertIt uses the standard NTP mode 6 control message formats defined in
1102b15cb3dSCy SchubertAppendix B of the NTPv3 specification RFC1305.
1112b15cb3dSCy SchubertThe same formats are used in NTPv4, although some of the variable names have changed and new ones added.
1122b15cb3dSCy SchubertThe description on this page is for the NTPv4 variables.
113*052d159aSCy Schubert</p>
1142b15cb3dSCy 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.
115*052d159aSCy Schubert</p>
1162b15cb3dSCy 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.
117*052d159aSCy Schubert</p>
1182b15cb3dSCy 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.
119*052d159aSCy Schubert</p>
1202b15cb3dSCy 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.
121*052d159aSCy Schubert</p>
1222b15cb3dSCy Schubert<p>For examples and usage, see the <a href="debug.html">NTP Debugging Techniques</a> page.
123*052d159aSCy Schubert</p>
124*052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
125*052d159aSCy Schubert<tr><td align="left" valign="top">&bull; <a href="#ntpq-Invocation" accesskey="1">ntpq Invocation</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
126*052d159aSCy Schubert</td></tr>
127*052d159aSCy 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">
128*052d159aSCy Schubert</td></tr>
129*052d159aSCy 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">
130*052d159aSCy Schubert</td></tr>
131*052d159aSCy 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">
132*052d159aSCy Schubert</td></tr>
133*052d159aSCy 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">
134*052d159aSCy Schubert</td></tr>
135*052d159aSCy 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">
136*052d159aSCy Schubert</td></tr>
137*052d159aSCy 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">
138*052d159aSCy Schubert</td></tr>
139*052d159aSCy 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">
140*052d159aSCy Schubert</td></tr>
141*052d159aSCy Schubert</table>
1422b15cb3dSCy Schubert
143*052d159aSCy Schubert<hr>
1442b15cb3dSCy Schubert<a name="ntpq-Invocation"></a>
145*052d159aSCy Schubert<div class="header">
146*052d159aSCy Schubert<p>
147*052d159aSCy 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>
1482b15cb3dSCy Schubert</div>
149*052d159aSCy Schubert<a name="Invoking-ntpq"></a>
150*052d159aSCy Schubert<h3 class="section">1.1 Invoking ntpq</h3>
151*052d159aSCy Schubert<a name="index-ntpq"></a>
152*052d159aSCy Schubert<a name="index-standard-NTP-query-program"></a>
1532b15cb3dSCy Schubert
1542b15cb3dSCy Schubert
1552b15cb3dSCy Schubert<p>The
1562b15cb3dSCy Schubert<code>ntpq</code>
15709100258SXin LIutility program is used to query NTP servers to monitor NTP operations
15809100258SXin LIand performance, requesting
1592b15cb3dSCy Schubertinformation about current state and/or changes in that state.
1602b15cb3dSCy SchubertThe program may be run either in interactive mode or controlled using
1612b15cb3dSCy Schubertcommand line arguments.
1622b15cb3dSCy SchubertRequests to read and write arbitrary
1632b15cb3dSCy Schubertvariables can be assembled, with raw and pretty-printed output
1642b15cb3dSCy Schubertoptions being available.
1652b15cb3dSCy SchubertThe
1662b15cb3dSCy Schubert<code>ntpq</code>
1672b15cb3dSCy Schubertutility can also obtain and print a
1682b15cb3dSCy Schubertlist of peers in a common format by sending multiple queries to the
1692b15cb3dSCy Schubertserver.
170*052d159aSCy Schubert</p>
1712b15cb3dSCy Schubert<p>If one or more request options is included on the command line
1722b15cb3dSCy Schubertwhen
1732b15cb3dSCy Schubert<code>ntpq</code>
1742b15cb3dSCy Schubertis executed, each of the requests will be sent
1752b15cb3dSCy Schubertto the NTP servers running on each of the hosts given as command
1762b15cb3dSCy Schubertline arguments, or on localhost by default.
1772b15cb3dSCy SchubertIf no request options
1782b15cb3dSCy Schubertare given,
1792b15cb3dSCy Schubert<code>ntpq</code>
1802b15cb3dSCy Schubertwill attempt to read commands from the
1812b15cb3dSCy Schubertstandard input and execute these on the NTP server running on the
1822b15cb3dSCy Schubertfirst host given on the command line, again defaulting to localhost
1832b15cb3dSCy Schubertwhen no other host is specified.
1842b15cb3dSCy SchubertThe
1852b15cb3dSCy Schubert<code>ntpq</code>
1862b15cb3dSCy Schubertutility will prompt for
1872b15cb3dSCy Schubertcommands if the standard input is a terminal device.
188*052d159aSCy Schubert</p>
1892b15cb3dSCy Schubert<p><code>ntpq</code>
1902b15cb3dSCy Schubertuses NTP mode 6 packets to communicate with the
1912b15cb3dSCy SchubertNTP server, and hence can be used to query any compatible server on
1922b15cb3dSCy Schubertthe network which permits it.
1932b15cb3dSCy SchubertNote that since NTP is a UDP protocol
1942b15cb3dSCy Schubertthis communication will be somewhat unreliable, especially over
1952b15cb3dSCy Schubertlarge distances in terms of network topology.
1962b15cb3dSCy SchubertThe
1972b15cb3dSCy Schubert<code>ntpq</code>
1982b15cb3dSCy Schubertutility makes
1992b15cb3dSCy Schubertone attempt to retransmit requests, and will time requests out if
2002b15cb3dSCy Schubertthe remote host is not heard from within a suitable timeout
2012b15cb3dSCy Schuberttime.
202*052d159aSCy Schubert</p>
20309100258SXin LI<p>Note that in contexts where a host name is expected, a
20409100258SXin LI<code>-4</code>
20509100258SXin LIqualifier preceding the host name forces resolution to the IPv4
20609100258SXin LInamespace, while a
20709100258SXin LI<code>-6</code>
20809100258SXin LIqualifier forces resolution to the IPv6 namespace.
20909100258SXin LIFor examples and usage, see the
210*052d159aSCy Schubert&ldquo;NTP Debugging Techniques&rdquo;
21109100258SXin LIpage.
212*052d159aSCy Schubert</p>
2132b15cb3dSCy Schubert<p>Specifying a
2142b15cb3dSCy Schubertcommand line option other than
2152b15cb3dSCy Schubert<code>-i</code>
2162b15cb3dSCy Schubertor
2172b15cb3dSCy Schubert<code>-n</code>
2182b15cb3dSCy Schubertwill
2192b15cb3dSCy Schubertcause the specified query (queries) to be sent to the indicated
2202b15cb3dSCy Schuberthost(s) immediately.
2212b15cb3dSCy SchubertOtherwise,
2222b15cb3dSCy Schubert<code>ntpq</code>
2232b15cb3dSCy Schubertwill attempt to read
2242b15cb3dSCy Schubertinteractive format commands from the standard input.
225*052d159aSCy Schubert</p>
226*052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
227*052d159aSCy 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">
228*052d159aSCy Schubert</td></tr>
229*052d159aSCy 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">
230*052d159aSCy Schubert</td></tr>
231*052d159aSCy 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">
232*052d159aSCy Schubert</td></tr>
233*052d159aSCy 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">
234*052d159aSCy Schubert</td></tr>
235*052d159aSCy 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">
236*052d159aSCy Schubert</td></tr>
237*052d159aSCy 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">
238*052d159aSCy Schubert</td></tr>
239*052d159aSCy 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">
240*052d159aSCy Schubert</td></tr>
241*052d159aSCy 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">
242*052d159aSCy Schubert</td></tr>
243*052d159aSCy 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">
244*052d159aSCy Schubert</td></tr>
245*052d159aSCy 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">
246*052d159aSCy Schubert</td></tr>
247*052d159aSCy 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">
248*052d159aSCy Schubert</td></tr>
249*052d159aSCy 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">
250*052d159aSCy Schubert</td></tr>
251*052d159aSCy Schubert</table>
2522b15cb3dSCy Schubert
253*052d159aSCy Schubert<a name="Internal-Commands-1"></a>
254*052d159aSCy Schubert<h4 class="subsection">1.1.1 Internal Commands</h4>
2552b15cb3dSCy Schubert
2562b15cb3dSCy Schubert<p>Interactive format commands consist of a keyword followed by zero
2572b15cb3dSCy Schubertto four arguments.
2582b15cb3dSCy SchubertOnly enough characters of the full keyword to
2592b15cb3dSCy Schubertuniquely identify the command need be typed.
260*052d159aSCy Schubert</p>
2612b15cb3dSCy Schubert<p>A
2622b15cb3dSCy Schubertnumber of interactive format commands are executed entirely within
2632b15cb3dSCy Schubertthe
2642b15cb3dSCy Schubert<code>ntpq</code>
26509100258SXin LIutility itself and do not result in NTP
2662b15cb3dSCy Schubertrequests being sent to a server.
2672b15cb3dSCy SchubertThese are described following.
268*052d159aSCy Schubert</p><dl compact="compact">
269*052d159aSCy Schubert<dt><code>?</code> <code>[<kbd>command</kbd>]</code></dt>
270*052d159aSCy Schubert<dt><code>help</code> <code>[<kbd>command</kbd>]</code></dt>
271*052d159aSCy Schubert<dd><p>A
272*052d159aSCy Schubert&lsquo;?&rsquo;
27309100258SXin LIby itself will print a list of all the commands
27409100258SXin LIknown to
2752b15cb3dSCy Schubert<code>ntpq</code>
2762b15cb3dSCy SchubertA
277*052d159aSCy Schubert&lsquo;?&rsquo;
27809100258SXin LIfollowed by a command name will print function and usage
2792b15cb3dSCy Schubertinformation about the command.
280*052d159aSCy Schubert</p></dd>
281*052d159aSCy Schubert<dt><code>addvars</code> <kbd>name</kbd><code>[=<kbd>value</kbd>]</code><code>[,...]</code></dt>
282*052d159aSCy Schubert<dt><code>rmvars</code> <kbd>name</kbd><code>[,...]</code></dt>
283*052d159aSCy Schubert<dt><code>clearvars</code></dt>
284*052d159aSCy Schubert<dt><code>showvars</code></dt>
285*052d159aSCy Schubert<dd><p>The arguments to this command consist of a list of
2862b15cb3dSCy Schubertitems of the form
287*052d159aSCy Schubert<kbd>name</kbd><code>[=<kbd>value</kbd>]</code>,
2882b15cb3dSCy Schubertwhere the
28909100258SXin LI.No = Ns Ar value
2902b15cb3dSCy Schubertis ignored, and can be omitted,
2912b15cb3dSCy Schubertin requests to the server to read variables.
2922b15cb3dSCy SchubertThe
2932b15cb3dSCy Schubert<code>ntpq</code>
29409100258SXin LIutility maintains an internal list in which data to be included in
29509100258SXin LImessages can be assembled, and displayed or set using the
2962b15cb3dSCy Schubert<code>readlist</code>
2972b15cb3dSCy Schubertand
2982b15cb3dSCy Schubert<code>writelist</code>
2992b15cb3dSCy Schubertcommands described below.
3002b15cb3dSCy SchubertThe
3012b15cb3dSCy Schubert<code>addvars</code>
3022b15cb3dSCy Schubertcommand allows variables and their optional values to be added to
3032b15cb3dSCy Schubertthe list.
3042b15cb3dSCy SchubertIf more than one variable is to be added, the list should
3052b15cb3dSCy Schubertbe comma-separated and not contain white space.
3062b15cb3dSCy SchubertThe
3072b15cb3dSCy Schubert<code>rmvars</code>
3082b15cb3dSCy Schubertcommand can be used to remove individual variables from the list,
3092b15cb3dSCy Schubertwhile the
31009100258SXin LI<code>clearvars</code>
3112b15cb3dSCy Schubertcommand removes all variables from the
3122b15cb3dSCy Schubertlist.
3132b15cb3dSCy SchubertThe
3142b15cb3dSCy Schubert<code>showvars</code>
3152b15cb3dSCy Schubertcommand displays the current list of optional variables.
316*052d159aSCy Schubert</p></dd>
317*052d159aSCy Schubert<dt><code>authenticate</code> <code>[<code>yes</code>|<code>no</code>]</code></dt>
318*052d159aSCy Schubert<dd><p>Normally
3192b15cb3dSCy Schubert<code>ntpq</code>
3202b15cb3dSCy Schubertdoes not authenticate requests unless
3212b15cb3dSCy Schubertthey are write requests.
3222b15cb3dSCy SchubertThe command
32309100258SXin LI<code>authenticate</code> <code>yes</code>
3242b15cb3dSCy Schubertcauses
3252b15cb3dSCy Schubert<code>ntpq</code>
3262b15cb3dSCy Schubertto send authentication with all requests it
3272b15cb3dSCy Schubertmakes.
3282b15cb3dSCy SchubertAuthenticated requests causes some servers to handle
32909100258SXin LIrequests slightly differently.
3302b15cb3dSCy SchubertThe command
33109100258SXin LI<code>authenticate</code>
3322b15cb3dSCy Schubertcauses
3332b15cb3dSCy Schubert<code>ntpq</code>
3342b15cb3dSCy Schubertto display whether or not
33509100258SXin LIit is currently authenticating requests.
336*052d159aSCy Schubert</p></dd>
337*052d159aSCy Schubert<dt><code>cooked</code></dt>
338*052d159aSCy Schubert<dd><p>Causes output from query commands to be &quot;cooked&quot;, so that
3392b15cb3dSCy Schubertvariables which are recognized by
3402b15cb3dSCy Schubert<code>ntpq</code>
3412b15cb3dSCy Schubertwill have their
3422b15cb3dSCy Schubertvalues reformatted for human consumption.
3432b15cb3dSCy SchubertVariables which
3442b15cb3dSCy Schubert<code>ntpq</code>
34509100258SXin LIcould not decode completely are
3462b15cb3dSCy Schubertmarked with a trailing
347*052d159aSCy Schubert&lsquo;?&rsquo;.
348*052d159aSCy Schubert</p></dd>
349*052d159aSCy Schubert<dt><code>debug</code> <code>[<code>more</code>|<code>less</code>|<code>off</code>]</code></dt>
350*052d159aSCy Schubert<dd><p>With no argument, displays the current debug level.
35109100258SXin LIOtherwise, the debugging level is changed as indicated.
352*052d159aSCy Schubert</p></dd>
353*052d159aSCy Schubert<dt><code>delay</code> <code>[<kbd>milliseconds</kbd>]</code></dt>
354*052d159aSCy Schubert<dd><p>Specify a time interval to be added to timestamps included in
3552b15cb3dSCy Schubertrequests which require authentication.
3562b15cb3dSCy SchubertThis is used to enable
3572b15cb3dSCy Schubert(unreliable) server reconfiguration over long delay network paths
3582b15cb3dSCy Schubertor between machines whose clocks are unsynchronized.
3592b15cb3dSCy SchubertActually the
3602b15cb3dSCy Schubertserver does not now require timestamps in authenticated requests,
3612b15cb3dSCy Schubertso this command may be obsolete.
36209100258SXin LIWithout any arguments, displays the current delay.
363*052d159aSCy Schubert</p></dd>
364*052d159aSCy Schubert<dt><code>drefid</code> <code>[<code>hash</code>|<code>ipv4</code>]</code></dt>
365*052d159aSCy Schubert<dd><p>Display refids as IPv4 or hash.
36609100258SXin LIWithout any arguments, displays whether refids are shown as IPv4
36709100258SXin LIaddresses or hashes.
368*052d159aSCy Schubert</p></dd>
369*052d159aSCy Schubert<dt><code>exit</code></dt>
370*052d159aSCy Schubert<dd><p>Exit
3712b15cb3dSCy Schubert<code>ntpq</code>
372*052d159aSCy Schubert</p></dd>
373*052d159aSCy Schubert<dt><code>host</code> <code>[<kbd>name</kbd>]</code></dt>
374*052d159aSCy Schubert<dd><p>Set the host to which future queries will be sent.
37509100258SXin LIThe
37609100258SXin LI<kbd>name</kbd>
3772b15cb3dSCy Schubertmay be either a host name or a numeric address.
37809100258SXin LIWithout any arguments, displays the current host.
379*052d159aSCy Schubert</p></dd>
380*052d159aSCy Schubert<dt><code>hostnames</code> <code>[<code>yes</code>|<code>no</code>]</code></dt>
381*052d159aSCy Schubert<dd><p>If
3822b15cb3dSCy Schubert<code>yes</code>
3832b15cb3dSCy Schubertis specified, host names are printed in
3842b15cb3dSCy Schubertinformation displays.
3852b15cb3dSCy SchubertIf
3862b15cb3dSCy Schubert<code>no</code>
3872b15cb3dSCy Schubertis specified, numeric
3882b15cb3dSCy Schubertaddresses are printed instead.
3892b15cb3dSCy SchubertThe default is
3902b15cb3dSCy Schubert<code>yes</code>,
3912b15cb3dSCy Schubertunless
3922b15cb3dSCy Schubertmodified using the command line
3932b15cb3dSCy Schubert<code>-n</code>
3942b15cb3dSCy Schubertswitch.
39509100258SXin LIWithout any arguments, displays whether host names or numeric addresses
39609100258SXin LIare shown.
397*052d159aSCy Schubert</p></dd>
398*052d159aSCy Schubert<dt><code>keyid</code> <code>[<kbd>keyid</kbd>]</code></dt>
399*052d159aSCy Schubert<dd><p>This command allows the specification of a key number to be
4002b15cb3dSCy Schubertused to authenticate configuration requests.
4012b15cb3dSCy SchubertThis must correspond
402276da39aSCy Schubertto the
403276da39aSCy Schubert<code>controlkey</code>
404276da39aSCy Schubertkey number the server has been configured to use for this
4052b15cb3dSCy Schubertpurpose.
40609100258SXin LIWithout any arguments, displays the current
40709100258SXin LI<kbd>keyid</kbd>.
408*052d159aSCy Schubert</p></dd>
409*052d159aSCy Schubert<dt><code>keytype</code> <code>[<kbd>digest</kbd>]</code></dt>
410*052d159aSCy Schubert<dd><p>Specify the digest algorithm to use for authenticating requests, with default
41109100258SXin LI<code>MD5</code>.
4122b15cb3dSCy SchubertIf
4132b15cb3dSCy Schubert<code>ntpq</code>
41409100258SXin LIwas built with OpenSSL support, and OpenSSL is installed,
41509100258SXin LI<kbd>digest</kbd>
41609100258SXin LIcan be any message digest algorithm supported by OpenSSL.
4172b15cb3dSCy SchubertIf no argument is given, the current
41809100258SXin LI<code>keytype</code> <kbd>digest</kbd>
41909100258SXin LIalgorithm used is displayed.
420*052d159aSCy Schubert</p></dd>
421*052d159aSCy Schubert<dt><code>ntpversion</code> <code>[<code>1</code>|<code>2</code>|<code>3</code>|<code>4</code>]</code></dt>
422*052d159aSCy Schubert<dd><p>Sets the NTP version number which
4232b15cb3dSCy Schubert<code>ntpq</code>
4242b15cb3dSCy Schubertclaims in
4252b15cb3dSCy Schubertpackets.
4262b15cb3dSCy SchubertDefaults to 3, and note that mode 6 control messages (and
427*052d159aSCy Schubertmodes, for that matter) didn&rsquo;t exist in NTP version 1.
4282b15cb3dSCy SchubertThere appear
4292b15cb3dSCy Schubertto be no servers left which demand version 1.
4302b15cb3dSCy SchubertWith no argument, displays the current NTP version that will be used
4312b15cb3dSCy Schubertwhen communicating with servers.
432*052d159aSCy Schubert</p></dd>
433*052d159aSCy Schubert<dt><code>passwd</code></dt>
434*052d159aSCy Schubert<dd><p>This command prompts you to type in a password (which will not
4352b15cb3dSCy Schubertbe echoed) which will be used to authenticate configuration
4362b15cb3dSCy Schubertrequests.
4372b15cb3dSCy SchubertThe password must correspond to the key configured for
4382b15cb3dSCy Schubertuse by the NTP server for this purpose if such requests are to be
4392b15cb3dSCy Schubertsuccessful.
440*052d159aSCy Schubert</p></dd>
441*052d159aSCy Schubert<dt><code>poll</code> <code>[<kbd>n</kbd>]</code> <code>[<code>verbose</code>]</code></dt>
442*052d159aSCy Schubert<dd><p>Poll an NTP server in client mode
4432b15cb3dSCy Schubert<kbd>n</kbd>
44409100258SXin LItimes.
44509100258SXin LIPoll not implemented yet.
446*052d159aSCy Schubert</p></dd>
447*052d159aSCy Schubert<dt><code>quit</code></dt>
448*052d159aSCy Schubert<dd><p>Exit
4492b15cb3dSCy Schubert<code>ntpq</code>
450*052d159aSCy Schubert</p></dd>
451*052d159aSCy Schubert<dt><code>raw</code></dt>
452*052d159aSCy Schubert<dd><p>Causes all output from query commands is printed as received
4532b15cb3dSCy Schubertfrom the remote server.
4542b15cb3dSCy SchubertThe only formating/interpretation done on
4552b15cb3dSCy Schubertthe data is to transform nonascii data into a printable (but barely
4562b15cb3dSCy Schubertunderstandable) form.
457*052d159aSCy Schubert</p></dd>
458*052d159aSCy Schubert<dt><code>timeout</code> <code>[<kbd>milliseconds</kbd>]</code></dt>
459*052d159aSCy Schubert<dd><p>Specify a timeout period for responses to server queries.
4602b15cb3dSCy SchubertThe
4612b15cb3dSCy Schubertdefault is about 5000 milliseconds.
46209100258SXin LIWithout any arguments, displays the current timeout period.
4632b15cb3dSCy SchubertNote that since
4642b15cb3dSCy Schubert<code>ntpq</code>
4652b15cb3dSCy Schubertretries each query once after a timeout, the total waiting time for
4662b15cb3dSCy Schuberta timeout will be twice the timeout value set.
467*052d159aSCy Schubert</p></dd>
468*052d159aSCy Schubert<dt><code>version</code></dt>
469*052d159aSCy Schubert<dd><p>Display the version of the
4702b15cb3dSCy Schubert<code>ntpq</code>
4712b15cb3dSCy Schubertprogram.
472*052d159aSCy Schubert</p></dd>
4732b15cb3dSCy Schubert</dl>
4742b15cb3dSCy Schubert
475*052d159aSCy Schubert<a name="Control-Message-Commands-1"></a>
476*052d159aSCy Schubert<h4 class="subsubsection">1.1.1.1 Control Message Commands</h4>
47709100258SXin LI<p>Association ids are used to identify system, peer and clock variables.
47809100258SXin LISystem variables are assigned an association id of zero and system name
47909100258SXin LIspace, while each association is assigned a nonzero association id and
48009100258SXin LIpeer namespace.
48109100258SXin LIMost control commands send a single message to the server and expect a
48209100258SXin LIsingle response message.
4832b15cb3dSCy SchubertThe exceptions are the
4842b15cb3dSCy Schubert<code>peers</code>
4852b15cb3dSCy Schubertcommand, which sends a series of messages,
4862b15cb3dSCy Schubertand the
4872b15cb3dSCy Schubert<code>mreadlist</code>
4882b15cb3dSCy Schubertand
4892b15cb3dSCy Schubert<code>mreadvar</code>
4902b15cb3dSCy Schubertcommands, which iterate over a range of associations.
491*052d159aSCy Schubert</p><dl compact="compact">
492*052d159aSCy Schubert<dt><code>apeers</code></dt>
493*052d159aSCy Schubert<dd><p>Display a list of peers in the form:
494*052d159aSCy Schubert</p><div class="example">
49509100258SXin LI<pre class="example">[tally]remote refid assid st t when pool reach delay offset jitter
496*052d159aSCy Schubert</pre></div>
49709100258SXin LI<p>where the output is just like the
49809100258SXin LI<code>peers</code>
49909100258SXin LIcommand except that the
50009100258SXin LI<code>refid</code>
50109100258SXin LIis displayed in hex format and the association number is also displayed.
502*052d159aSCy Schubert</p></dd>
503*052d159aSCy Schubert<dt><code>associations</code></dt>
504*052d159aSCy Schubert<dd><p>Display a list of mobilized associations in the form:
505*052d159aSCy Schubert</p><div class="example">
5062b15cb3dSCy Schubert<pre class="example">ind assid status conf reach auth condition last_event cnt
507*052d159aSCy Schubert</pre></div>
508*052d159aSCy Schubert<dl compact="compact">
509*052d159aSCy Schubert<dt>Sy Variable Ta Sy Description</dt>
510*052d159aSCy Schubert<dt><code>ind</code> <code>Ta</code> <code>index</code> <code>on</code> <code>this</code> <code>list</code></dt>
511*052d159aSCy Schubert<dt><code>assid</code> <code>Ta</code> <code>association</code> <code>id</code></dt>
512*052d159aSCy Schubert<dt><code>status</code> <code>Ta</code> <code>peer</code> <code>status</code> <code>word</code></dt>
513*052d159aSCy 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>
514*052d159aSCy 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>
515*052d159aSCy 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>
516*052d159aSCy 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>
517*052d159aSCy 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>
518*052d159aSCy 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>
519*052d159aSCy Schubert</dl>
520*052d159aSCy Schubert</dd>
521*052d159aSCy Schubert<dt><code>authinfo</code></dt>
522*052d159aSCy Schubert<dd><p>Display the authentication statistics counters:
52309100258SXin LItime since reset, stored keys, free keys, key lookups, keys not found,
52409100258SXin LIuncached keys, expired keys, encryptions, decryptions.
525*052d159aSCy Schubert</p></dd>
526*052d159aSCy Schubert<dt><code>clocklist</code> <code>[<kbd>associd</kbd>]</code></dt>
527*052d159aSCy Schubert<dt><code>cl</code> <code>[<kbd>associd</kbd>]</code></dt>
528*052d159aSCy Schubert<dd><p>Display all clock variables in the variable list for those associations
52909100258SXin LIsupporting a reference clock.
530*052d159aSCy Schubert</p></dd>
531*052d159aSCy Schubert<dt><code>clockvar</code> <code>[<kbd>associd</kbd>]</code> <code>[<kbd>name</kbd><code>[=<kbd>value</kbd>]</code>]</code><code>[,...]</code></dt>
532*052d159aSCy Schubert<dt><code>cv</code> <code>[<kbd>associd</kbd>]</code> <code>[<kbd>name</kbd><code>[=<kbd>value</kbd>]</code>]</code><code>[,...]</code></dt>
533*052d159aSCy Schubert<dd><p>Display a list of clock variables for those associations supporting a
53409100258SXin LIreference clock.
535*052d159aSCy Schubert</p></dd>
536*052d159aSCy Schubert<dt><code>:config</code> <kbd>configuration command line</kbd></dt>
537*052d159aSCy Schubert<dd><p>Send the remainder of the command line, including whitespace, to the
53809100258SXin LIserver as a run-time configuration command in the same format as a line
53909100258SXin LIin the configuration file.
54009100258SXin LIThis command is experimental until further notice and clarification.
54109100258SXin LIAuthentication is of course required.
542*052d159aSCy Schubert</p></dd>
543*052d159aSCy Schubert<dt><code>config-from-file</code> <kbd>filename</kbd></dt>
544*052d159aSCy Schubert<dd><p>Send each line of
5452b15cb3dSCy Schubert<kbd>filename</kbd>
54609100258SXin LIto the server as run-time configuration commands in the same format as
54709100258SXin LIlines in the configuration file.
54809100258SXin LIThis command is experimental until further notice and clarification.
54909100258SXin LIAuthentication is required.
550*052d159aSCy Schubert</p></dd>
551*052d159aSCy Schubert<dt><code>ifstats</code></dt>
552*052d159aSCy Schubert<dd><p>Display status and statistics counters for each local network interface address:
55309100258SXin LIinterface number, interface name and address or broadcast, drop, flag,
55409100258SXin LIttl, mc, received, sent, send failed, peers, uptime.
55509100258SXin LIAuthentication is required.
556*052d159aSCy Schubert</p></dd>
557*052d159aSCy Schubert<dt><code>iostats</code></dt>
558*052d159aSCy Schubert<dd><p>Display network and reference clock I/O statistics:
55909100258SXin LItime since reset, receive buffers, free receive buffers, used receive buffers,
56009100258SXin LIlow water refills, dropped packets, ignored packets, received packets,
56109100258SXin LIpackets sent, packet send failures, input wakeups, useful input wakeups.
562*052d159aSCy Schubert</p></dd>
563*052d159aSCy Schubert<dt><code>kerninfo</code></dt>
564*052d159aSCy Schubert<dd><p>Display kernel loop and PPS statistics:
56509100258SXin LIassocid, status, pll offset, pll frequency, maximum error,
56609100258SXin LIestimated error, kernel status, pll time constant, precision,
56709100258SXin LIfrequency tolerance, pps frequency, pps stability, pps jitter,
56809100258SXin LIcalibration interval, calibration cycles, jitter exceeded,
56909100258SXin LIstability exceeded, calibration errors.
57009100258SXin LIAs with other ntpq output, times are in milliseconds; very small values
57109100258SXin LImay be shown as exponentials.
57209100258SXin LIThe precision value displayed is in milliseconds as well, unlike the
57309100258SXin LIprecision system variable.
574*052d159aSCy Schubert</p></dd>
575*052d159aSCy Schubert<dt><code>lassociations</code></dt>
576*052d159aSCy Schubert<dd><p>Perform the same function as the associations command, except display
57709100258SXin LImobilized and unmobilized associations, including all clients.
578*052d159aSCy Schubert</p></dd>
579*052d159aSCy Schubert<dt><code>lopeers</code> <code>[<code>-4</code>|<code>-6</code>]</code></dt>
580*052d159aSCy Schubert<dd><p>Display a list of all peers and clients showing
58109100258SXin LI<code>dstadr</code>
58209100258SXin LI(associated with the given IP version).
583*052d159aSCy Schubert</p></dd>
584*052d159aSCy Schubert<dt><code>lpassociations</code></dt>
585*052d159aSCy Schubert<dd><p>Display the last obtained list of associations, including all clients.
586*052d159aSCy Schubert</p></dd>
587*052d159aSCy Schubert<dt><code>lpeers</code> <code>[<code>-4</code>|<code>-6</code>]</code></dt>
588*052d159aSCy Schubert<dd><p>Display a list of all peers and clients (associated with the given IP version).
589*052d159aSCy Schubert</p></dd>
590*052d159aSCy Schubert<dt><code>monstats</code></dt>
591*052d159aSCy Schubert<dd><p>Display monitor facility status, statistics, and limits:
59209100258SXin LIenabled, addresses, peak addresses, maximum addresses,
59309100258SXin LIreclaim above count, reclaim older than, kilobytes, maximum kilobytes.
594*052d159aSCy Schubert</p></dd>
595*052d159aSCy Schubert<dt><code>mreadlist</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd></dt>
596*052d159aSCy Schubert<dt><code>mrl</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd></dt>
597*052d159aSCy Schubert<dd><p>Perform the same function as the
59809100258SXin LI<code>readlist</code>
59909100258SXin LIcommand for a range of association ids.
600*052d159aSCy Schubert</p></dd>
601*052d159aSCy Schubert<dt><code>mreadvar</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd> <code>[<kbd>name</kbd>]</code><code>[,...]</code></dt>
602*052d159aSCy Schubert<dd><p>This range may be determined from the list displayed by any
60309100258SXin LIcommand showing associations.
604*052d159aSCy Schubert</p></dd>
605*052d159aSCy Schubert<dt><code>mrv</code> <kbd>associdlo</kbd> <kbd>associdhi</kbd> <code>[<kbd>name</kbd>]</code><code>[,...]</code></dt>
606*052d159aSCy Schubert<dd><p>Perform the same function as the
60709100258SXin LI<code>readvar</code>
60809100258SXin LIcommand for a range of association ids.
60909100258SXin LIThis range may be determined from the list displayed by any
61009100258SXin LIcommand showing associations.
611*052d159aSCy Schubert</p></dd>
612*052d159aSCy 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>
613*052d159aSCy Schubert<dd><p>Display traffic counts of the most recently seen source addresses
61409100258SXin LIcollected and maintained by the monitor facility.
6152b15cb3dSCy SchubertWith the exception of
61609100258SXin LI<code>sort</code>=<code>[-]</code><kbd>sortorder</kbd>,
6172b15cb3dSCy Schubertthe options filter the list returned by
61809100258SXin LI<code>ntpd(8)</code>.
6192b15cb3dSCy SchubertThe
6202b15cb3dSCy Schubert<code>limited</code>
6212b15cb3dSCy Schubertand
6222b15cb3dSCy Schubert<code>kod</code>
62309100258SXin LIoptions return only entries representing client addresses from which the
62409100258SXin LIlast packet received triggered either discarding or a KoD response.
6252b15cb3dSCy SchubertThe
6262b15cb3dSCy Schubert<code>mincount</code>=<kbd>count</kbd>
6272b15cb3dSCy Schubertoption filters entries representing less than
6282b15cb3dSCy Schubert<kbd>count</kbd>
6292b15cb3dSCy Schubertpackets.
6302b15cb3dSCy SchubertThe
6312b15cb3dSCy Schubert<code>laddr</code>=<kbd>localaddr</kbd>
6322b15cb3dSCy Schubertoption filters entries for packets received on any local address other than
6332b15cb3dSCy Schubert<kbd>localaddr</kbd>.
6342b15cb3dSCy Schubert<code>resany</code>=<kbd>hexmask</kbd>
6352b15cb3dSCy Schubertand
6362b15cb3dSCy Schubert<code>resall</code>=<kbd>hexmask</kbd>
6372b15cb3dSCy Schubertfilter entries containing none or less than all, respectively, of the bits in
6382b15cb3dSCy Schubert<kbd>hexmask</kbd>,
6392b15cb3dSCy Schubertwhich must begin with
6402b15cb3dSCy Schubert<code>0x</code>.
6412b15cb3dSCy SchubertThe
6422b15cb3dSCy Schubert<kbd>sortorder</kbd>
6432b15cb3dSCy Schubertdefaults to
6442b15cb3dSCy Schubert<code>lstint</code>
64509100258SXin LIand may be
6462b15cb3dSCy Schubert<code>addr</code>,
6472b15cb3dSCy Schubert<code>avgint</code>,
64809100258SXin LI<code>count</code>,
6492b15cb3dSCy Schubert<code>lstint</code>,
65009100258SXin LIor any of those preceded by
651*052d159aSCy Schubert&lsquo;-&rsquo;
65209100258SXin LIto reverse the sort order.
6532b15cb3dSCy SchubertThe output columns are:
654*052d159aSCy Schubert</p><dl compact="compact">
655*052d159aSCy Schubert<dt>Column</dt>
656*052d159aSCy Schubert<dd><p>Description
657*052d159aSCy Schubert</p></dd>
658*052d159aSCy Schubert<dt><code>lstint</code></dt>
659*052d159aSCy Schubert<dd><p>Interval in seconds between the receipt of the most recent packet from
66009100258SXin LIthis address and the completion of the retrieval of the MRU list by
6612b15cb3dSCy Schubert<code>ntpq</code>
662*052d159aSCy Schubert</p></dd>
663*052d159aSCy Schubert<dt><code>avgint</code></dt>
664*052d159aSCy Schubert<dd><p>Average interval in s between packets from this address.
665*052d159aSCy Schubert</p></dd>
666*052d159aSCy Schubert<dt><code>rstr</code></dt>
667*052d159aSCy Schubert<dd><p>Restriction flags associated with this address.
6682b15cb3dSCy SchubertMost are copied unchanged from the matching
6692b15cb3dSCy Schubert<code>restrict</code>
67009100258SXin LIcommand, however 0x400 (kod) and 0x20 (limited) flags are cleared unless
67109100258SXin LIthe last packet from this address triggered a rate control response.
672*052d159aSCy Schubert</p></dd>
673*052d159aSCy Schubert<dt><code>r</code></dt>
674*052d159aSCy Schubert<dd><p>Rate control indicator, either
6752b15cb3dSCy Schuberta period,
6762b15cb3dSCy Schubert<code>L</code>
6772b15cb3dSCy Schubertor
6782b15cb3dSCy Schubert<code>K</code>
6792b15cb3dSCy Schubertfor no rate control response,
6802b15cb3dSCy Schubertrate limiting by discarding, or rate limiting with a KoD response, respectively.
681*052d159aSCy Schubert</p></dd>
682*052d159aSCy Schubert<dt><code>m</code></dt>
683*052d159aSCy Schubert<dd><p>Packet mode.
684*052d159aSCy Schubert</p></dd>
685*052d159aSCy Schubert<dt><code>v</code></dt>
686*052d159aSCy Schubert<dd><p>Packet version number.
687*052d159aSCy Schubert</p></dd>
688*052d159aSCy Schubert<dt><code>count</code></dt>
689*052d159aSCy Schubert<dd><p>Packets received from this address.
690*052d159aSCy Schubert</p></dd>
691*052d159aSCy Schubert<dt><code>rport</code></dt>
692*052d159aSCy Schubert<dd><p>Source port of last packet from this address.
693*052d159aSCy Schubert</p></dd>
694*052d159aSCy Schubert<dt><code>remote</code> <code>address</code></dt>
695*052d159aSCy Schubert<dd><p>host or DNS name, numeric address, or address followed by
6962b15cb3dSCy Schubertclaimed DNS name which could not be verified in parentheses.
697*052d159aSCy Schubert</p></dd>
6982b15cb3dSCy Schubert</dl>
699*052d159aSCy Schubert</dd>
700*052d159aSCy Schubert<dt><code>opeers</code> <code>[<code>-4</code> | <code>-6</code>]</code></dt>
701*052d159aSCy Schubert<dd><p>Obtain and print the old-style list of all peers and clients showing
70209100258SXin LI<code>dstadr</code>
70309100258SXin LI(associated with the given IP version),
7042b15cb3dSCy Schubertrather than the
70509100258SXin LI<code>refid</code>.
706*052d159aSCy Schubert</p></dd>
707*052d159aSCy Schubert<dt><code>passociations</code></dt>
708*052d159aSCy Schubert<dd><p>Perform the same function as the
7092b15cb3dSCy Schubert<code>associations</code>
7102b15cb3dSCy Schubertcommand,
7112b15cb3dSCy Schubertexcept that it uses previously stored data rather than making a new query.
712*052d159aSCy Schubert</p></dd>
713*052d159aSCy Schubert<dt><code>peers</code></dt>
714*052d159aSCy Schubert<dd><p>Display a list of peers in the form:
715*052d159aSCy Schubert</p><div class="example">
7162b15cb3dSCy Schubert<pre class="example">[tally]remote refid st t when pool reach delay offset jitter
717*052d159aSCy Schubert</pre></div>
718*052d159aSCy Schubert<dl compact="compact">
719*052d159aSCy Schubert<dt>Variable</dt>
720*052d159aSCy Schubert<dd><p>Description
721*052d159aSCy Schubert</p></dd>
722*052d159aSCy Schubert<dt><code>[tally]</code></dt>
723*052d159aSCy Schubert<dd><p>single-character code indicating current value of the
7242b15cb3dSCy Schubert<code>select</code>
7252b15cb3dSCy Schubertfield of the
726*052d159aSCy Schubert.Lk decode.html#peer &quot;peer status word&quot;
727*052d159aSCy Schubert</p></dd>
728*052d159aSCy Schubert<dt><code>remote</code></dt>
729*052d159aSCy Schubert<dd><p>host name (or IP number) of peer.
7302b15cb3dSCy SchubertThe value displayed will be truncated to 15 characters unless the
73109100258SXin LI<code>ntpq</code>
7322b15cb3dSCy Schubert<code>-w</code>
73309100258SXin LIoption is given, in which case the full value will be displayed
73409100258SXin LIon the first line, and if too long,
73509100258SXin LIthe remaining data will be displayed on the next line.
736*052d159aSCy Schubert</p></dd>
737*052d159aSCy Schubert<dt><code>refid</code></dt>
738*052d159aSCy Schubert<dd><p>source IP address or
739*052d159aSCy Schubert.Lk decode.html#kiss &quot;&rsquo;kiss code&quot;
740*052d159aSCy Schubert</p></dd>
741*052d159aSCy Schubert<dt><code>st</code></dt>
742*052d159aSCy Schubert<dd><p>stratum: 0 for local reference clocks, 1 for servers with local
74309100258SXin LIreference clocks, ..., 16 for unsynchronized server clocks
744*052d159aSCy Schubert</p></dd>
745*052d159aSCy Schubert<dt><code>t</code></dt>
746*052d159aSCy Schubert<dd><p><code>u</code>:
7472b15cb3dSCy Schubertunicast or manycast client,
7482b15cb3dSCy Schubert<code>b</code>:
7492b15cb3dSCy Schubertbroadcast or multicast client,
75009100258SXin LI<code>p</code>:
75109100258SXin LIpool source,
7522b15cb3dSCy Schubert<code>l</code>:
7532b15cb3dSCy Schubertlocal (reference clock),
7542b15cb3dSCy Schubert<code>s</code>:
7552b15cb3dSCy Schubertsymmetric (peer),
7562b15cb3dSCy Schubert<code>A</code>:
7572b15cb3dSCy Schubertmanycast server,
7582b15cb3dSCy Schubert<code>B</code>:
7592b15cb3dSCy Schubertbroadcast server,
7602b15cb3dSCy Schubert<code>M</code>:
7612b15cb3dSCy Schubertmulticast server
762*052d159aSCy Schubert</p></dd>
763*052d159aSCy Schubert<dt><code>when</code></dt>
764*052d159aSCy Schubert<dd><p>time in seconds, minutes, hours, or days since the last packet
76509100258SXin LIwas received, or
766*052d159aSCy Schubert&lsquo;-&rsquo;
76709100258SXin LIif a packet has never been received
768*052d159aSCy Schubert</p></dd>
769*052d159aSCy Schubert<dt><code>poll</code></dt>
770*052d159aSCy Schubert<dd><p>poll interval (s)
771*052d159aSCy Schubert</p></dd>
772*052d159aSCy Schubert<dt><code>reach</code></dt>
773*052d159aSCy Schubert<dd><p>reach shift register (octal)
774*052d159aSCy Schubert</p></dd>
775*052d159aSCy Schubert<dt><code>delay</code></dt>
776*052d159aSCy Schubert<dd><p>roundtrip delay
777*052d159aSCy Schubert</p></dd>
778*052d159aSCy Schubert<dt><code>offset</code></dt>
779*052d159aSCy Schubert<dd><p>offset of server relative to this host
780*052d159aSCy Schubert</p></dd>
781*052d159aSCy Schubert<dt><code>jitter</code></dt>
782*052d159aSCy Schubert<dd><p>offset RMS error estimate.
783*052d159aSCy Schubert</p></dd>
7842b15cb3dSCy Schubert</dl>
785*052d159aSCy Schubert</dd>
786*052d159aSCy Schubert<dt><code>pstats</code> <kbd>associd</kbd></dt>
787*052d159aSCy Schubert<dd><p>Display the statistics for the peer with the given
78809100258SXin LI<kbd>associd</kbd>:
78909100258SXin LIassocid, status, remote host, local address, time last received,
79009100258SXin LItime until next send, reachability change, packets sent,
79109100258SXin LIpackets received, bad authentication, bogus origin, duplicate,
79209100258SXin LIbad dispersion, bad reference time, candidate order.
793*052d159aSCy Schubert</p></dd>
794*052d159aSCy Schubert<dt><code>readlist</code> <code>[<kbd>associd</kbd>]</code></dt>
795*052d159aSCy Schubert<dt><code>rl</code> <code>[<kbd>associd</kbd>]</code></dt>
796*052d159aSCy Schubert<dd><p>Display all system or peer variables.
79709100258SXin LIIf the
79809100258SXin LI<kbd>associd</kbd>
79909100258SXin LIis omitted, it is assumed to be zero.
800*052d159aSCy Schubert</p></dd>
801*052d159aSCy Schubert<dt><code>readvar</code> <code>[<kbd>associd</kbd> <kbd>name</kbd><code>[=<kbd>value</kbd>]</code> <code>[, ...]</code>]</code></dt>
802*052d159aSCy Schubert<dt><code>rv</code> <code>[<kbd>associd</kbd> <kbd>name</kbd><code>[=<kbd>value</kbd>]</code> <code>[, ...]</code>]</code></dt>
803*052d159aSCy Schubert<dd><p>Display the specified system or peer variables.
8042b15cb3dSCy SchubertIf
80509100258SXin LI<kbd>associd</kbd>
8062b15cb3dSCy Schubertis zero, the variables are from the
8072b15cb3dSCy Schubert<a href="#System-Variables">System Variables</a>
8082b15cb3dSCy Schubertname space, otherwise they are from the
8092b15cb3dSCy Schubert<a href="#Peer-Variables">Peer Variables</a>
8102b15cb3dSCy Schubertname space.
8112b15cb3dSCy SchubertThe
81209100258SXin LI<kbd>associd</kbd>
8132b15cb3dSCy Schubertis required, as the same name can occur in both spaces.
8142b15cb3dSCy SchubertIf no
8152b15cb3dSCy Schubert<kbd>name</kbd>
8162b15cb3dSCy Schubertis included, all operative variables in the name space are displayed.
81709100258SXin LIIn this case only, if the
81809100258SXin LI<kbd>associd</kbd>
81909100258SXin LIis omitted, it is assumed to be zero.
8202b15cb3dSCy SchubertMultiple names are specified with comma separators and without whitespace.
8212b15cb3dSCy SchubertNote that time values are represented in milliseconds
8222b15cb3dSCy Schubertand frequency values in parts-per-million (PPM).
8232b15cb3dSCy SchubertSome NTP timestamps are represented in the format
82409100258SXin LI<kbd>YYYY</kbd><kbd>MM</kbd> <kbd>DD</kbd> <kbd>TTTT</kbd>,
82509100258SXin LIwhere
82609100258SXin LI<kbd>YYYY</kbd>
82709100258SXin LIis the year,
82809100258SXin LI<kbd>MM</kbd>
82909100258SXin LIthe month of year,
83009100258SXin LI<kbd>DD</kbd>
83109100258SXin LIthe day of month and
83209100258SXin LI<kbd>TTTT</kbd>
83309100258SXin LIthe time of day.
834*052d159aSCy Schubert</p></dd>
835*052d159aSCy Schubert<dt><code>reslist</code></dt>
836*052d159aSCy Schubert<dd><p>Display the access control (restrict) list for
8372b15cb3dSCy Schubert<code>ntpq</code>
83809100258SXin LIAuthentication is required.
839*052d159aSCy Schubert</p></dd>
840*052d159aSCy Schubert<dt><code>saveconfig</code> <kbd>filename</kbd></dt>
841*052d159aSCy Schubert<dd><p>Save the current configuration,
84209100258SXin LIincluding any runtime modifications made by
8432b15cb3dSCy Schubert<code>:config</code>
8442b15cb3dSCy Schubertor
8452b15cb3dSCy Schubert<code>config-from-file</code>,
84609100258SXin LIto the NTP server host file
8472b15cb3dSCy Schubert<kbd>filename</kbd>.
8482b15cb3dSCy SchubertThis command will be rejected by the server unless
849*052d159aSCy Schubert.Lk miscopt.html#saveconfigdir &quot;saveconfigdir&quot;
8502b15cb3dSCy Schubertappears in the
85109100258SXin LI<code>ntpd(8)</code>
8522b15cb3dSCy Schubertconfiguration file.
8532b15cb3dSCy Schubert<kbd>filename</kbd>
8542b15cb3dSCy Schubertcan use
85509100258SXin LI<code>date(1)</code>
85609100258SXin LIformat specifiers to substitute the current date and time, for
85709100258SXin LIexample,
858*052d159aSCy Schubert</p><div class="example">
859*052d159aSCy Schubert<pre class="example"><code>saveconfig</code> <samp>ntp-%Y%m%d-%H%M%S.conf</samp>.
860*052d159aSCy Schubert</pre></div>
86109100258SXin LI<p>The filename used is stored in system variable
8622b15cb3dSCy Schubert<code>savedconfig</code>.
8632b15cb3dSCy SchubertAuthentication is required.
864*052d159aSCy Schubert</p></dd>
865*052d159aSCy Schubert<dt><code>sysinfo</code></dt>
866*052d159aSCy Schubert<dd><p>Display system operational summary:
86709100258SXin LIassocid, status, system peer, system peer mode, leap indicator,
86809100258SXin LIstratum, log2 precision, root delay, root dispersion,
86909100258SXin LIreference id, reference time, system jitter, clock jitter,
87009100258SXin LIclock wander, broadcast delay, symm. auth. delay.
871*052d159aSCy Schubert</p></dd>
872*052d159aSCy Schubert<dt><code>sysstats</code></dt>
873*052d159aSCy Schubert<dd><p>Display system uptime and packet counts maintained in the
87409100258SXin LIprotocol module:
87509100258SXin LIuptime, sysstats reset, packets received, current version,
87609100258SXin LIolder version, bad length or format, authentication failed,
87709100258SXin LIdeclined, restricted, rate limited, KoD responses,
87809100258SXin LIprocessed for time.
879*052d159aSCy Schubert</p></dd>
880*052d159aSCy Schubert<dt><code>timerstats</code></dt>
881*052d159aSCy Schubert<dd><p>Display interval timer counters:
88209100258SXin LItime since reset, timer overruns, calls to transmit.
883*052d159aSCy Schubert</p></dd>
884*052d159aSCy Schubert<dt><code>writelist</code> <kbd>associd</kbd></dt>
885*052d159aSCy Schubert<dd><p>Set all system or peer variables included in the variable list.
886*052d159aSCy Schubert</p></dd>
887*052d159aSCy Schubert<dt><code>writevar</code> <kbd>associd</kbd> <kbd>name</kbd>=<kbd>value</kbd> <code>[, ...]</code></dt>
888*052d159aSCy Schubert<dd><p>Set the specified variables in the variable list.
8892b15cb3dSCy SchubertIf the
89009100258SXin LI<kbd>associd</kbd>
8912b15cb3dSCy Schubertis zero, the variables are from the
8922b15cb3dSCy Schubert<a href="#System-Variables">System Variables</a>
8932b15cb3dSCy Schubertname space, otherwise they are from the
8942b15cb3dSCy Schubert<a href="#Peer-Variables">Peer Variables</a>
8952b15cb3dSCy Schubertname space.
8962b15cb3dSCy SchubertThe
89709100258SXin LI<kbd>associd</kbd>
8982b15cb3dSCy Schubertis required, as the same name can occur in both spaces.
89909100258SXin LIAuthentication is required.
900*052d159aSCy Schubert</p></dd>
9012b15cb3dSCy Schubert</dl>
9022b15cb3dSCy Schubert
903*052d159aSCy Schubert<a name="Status-Words-and-Kiss-Codes-1"></a>
904*052d159aSCy Schubert<h4 class="subsubsection">1.1.1.2 Status Words and Kiss Codes</h4>
9052b15cb3dSCy Schubert<p>The current state of the operating program is shown
9062b15cb3dSCy Schubertin a set of status words
9072b15cb3dSCy Schubertmaintained by the system.
9082b15cb3dSCy SchubertStatus information is also available on a per-association basis.
90909100258SXin LIThese words are displayed by the
91009100258SXin LI<code>readlist</code>
9112b15cb3dSCy Schubertand
91209100258SXin LI<code>associations</code>
9132b15cb3dSCy Schubertcommands both in hexadecimal and in decoded short tip strings.
9142b15cb3dSCy SchubertThe codes, tips and short explanations are documented on the
915*052d159aSCy Schubert.Lk decode.html &quot;Event Messages and Status Words&quot;
9162b15cb3dSCy Schubertpage.
9172b15cb3dSCy SchubertThe page also includes a list of system and peer messages,
9182b15cb3dSCy Schubertthe code for the latest of which is included in the status word.
919*052d159aSCy Schubert</p>
9202b15cb3dSCy Schubert<p>Information resulting from protocol machine state transitions
9212b15cb3dSCy Schubertis displayed using an informal set of ASCII strings called
922*052d159aSCy Schubert.Lk decode.html#kiss &quot;kiss codes&quot; .
923*052d159aSCy SchubertThe original purpose was for kiss-o&rsquo;-death (KoD) packets
9242b15cb3dSCy Schubertsent by the server to advise the client of an unusual condition.
9252b15cb3dSCy SchubertThey are now displayed, when appropriate,
9262b15cb3dSCy Schubertin the reference identifier field in various billboards.
927*052d159aSCy Schubert</p>
928*052d159aSCy Schubert<a name="System-Variables-1"></a>
929*052d159aSCy Schubert<h4 class="subsubsection">1.1.1.3 System Variables</h4>
9302b15cb3dSCy Schubert<p>The following system variables appear in the
93109100258SXin LI<code>readlist</code>
9322b15cb3dSCy Schubertbillboard.
9332b15cb3dSCy SchubertNot all variables are displayed in some configurations.
934*052d159aSCy Schubert</p>
935*052d159aSCy Schubert<dl compact="compact">
936*052d159aSCy Schubert<dt>Variable</dt>
937*052d159aSCy Schubert<dd><p>Description
938*052d159aSCy Schubert</p></dd>
939*052d159aSCy Schubert<dt><code>status</code></dt>
940*052d159aSCy Schubert<dd><p>.Lk decode.html#sys &quot;system status word&quot;
941*052d159aSCy Schubert</p></dd>
942*052d159aSCy Schubert<dt><code>version</code></dt>
943*052d159aSCy Schubert<dd><p>NTP software version and build time
944*052d159aSCy Schubert</p></dd>
945*052d159aSCy Schubert<dt><code>processor</code></dt>
946*052d159aSCy Schubert<dd><p>hardware platform and version
947*052d159aSCy Schubert</p></dd>
948*052d159aSCy Schubert<dt><code>system</code></dt>
949*052d159aSCy Schubert<dd><p>operating system and version
950*052d159aSCy Schubert</p></dd>
951*052d159aSCy Schubert<dt><code>leap</code></dt>
952*052d159aSCy Schubert<dd><p>leap warning indicator (0-3)
953*052d159aSCy Schubert</p></dd>
954*052d159aSCy Schubert<dt><code>stratum</code></dt>
955*052d159aSCy Schubert<dd><p>stratum (1-15)
956*052d159aSCy Schubert</p></dd>
957*052d159aSCy Schubert<dt><code>precision</code></dt>
958*052d159aSCy Schubert<dd><p>precision (log2 s)
959*052d159aSCy Schubert</p></dd>
960*052d159aSCy Schubert<dt><code>rootdelay</code></dt>
961*052d159aSCy Schubert<dd><p>total roundtrip delay to the primary reference clock
962*052d159aSCy Schubert</p></dd>
963*052d159aSCy Schubert<dt><code>rootdisp</code></dt>
964*052d159aSCy Schubert<dd><p>total dispersion to the primary reference clock
965*052d159aSCy Schubert</p></dd>
966*052d159aSCy Schubert<dt><code>refid</code></dt>
967*052d159aSCy Schubert<dd><p>reference id or
968*052d159aSCy Schubert.Lk decode.html#kiss &quot;kiss code&quot;
969*052d159aSCy Schubert</p></dd>
970*052d159aSCy Schubert<dt><code>reftime</code></dt>
971*052d159aSCy Schubert<dd><p>reference time
972*052d159aSCy Schubert</p></dd>
973*052d159aSCy Schubert<dt><code>clock</code></dt>
974*052d159aSCy Schubert<dd><p>date and time of day
975*052d159aSCy Schubert</p></dd>
976*052d159aSCy Schubert<dt><code>peer</code></dt>
977*052d159aSCy Schubert<dd><p>system peer association id
978*052d159aSCy Schubert</p></dd>
979*052d159aSCy Schubert<dt><code>tc</code></dt>
980*052d159aSCy Schubert<dd><p>time constant and poll exponent (log2 s) (3-17)
981*052d159aSCy Schubert</p></dd>
982*052d159aSCy Schubert<dt><code>mintc</code></dt>
983*052d159aSCy Schubert<dd><p>minimum time constant (log2 s) (3-10)
984*052d159aSCy Schubert</p></dd>
985*052d159aSCy Schubert<dt><code>offset</code></dt>
986*052d159aSCy Schubert<dd><p>combined offset of server relative to this host
987*052d159aSCy Schubert</p></dd>
988*052d159aSCy Schubert<dt><code>frequency</code></dt>
989*052d159aSCy Schubert<dd><p>frequency drift (PPM) relative to hardware clock
990*052d159aSCy Schubert</p></dd>
991*052d159aSCy Schubert<dt><code>sys_jitter</code></dt>
992*052d159aSCy Schubert<dd><p>combined system jitter
993*052d159aSCy Schubert</p></dd>
994*052d159aSCy Schubert<dt><code>clk_wander</code></dt>
995*052d159aSCy Schubert<dd><p>clock frequency wander (PPM)
996*052d159aSCy Schubert</p></dd>
997*052d159aSCy Schubert<dt><code>clk_jitter</code></dt>
998*052d159aSCy Schubert<dd><p>clock jitter
999*052d159aSCy Schubert</p></dd>
1000*052d159aSCy Schubert<dt><code>tai</code></dt>
1001*052d159aSCy Schubert<dd><p>TAI-UTC offset (s)
1002*052d159aSCy Schubert</p></dd>
1003*052d159aSCy Schubert<dt><code>leapsec</code></dt>
1004*052d159aSCy Schubert<dd><p>NTP seconds when the next leap second is/was inserted
1005*052d159aSCy Schubert</p></dd>
1006*052d159aSCy Schubert<dt><code>expire</code></dt>
1007*052d159aSCy Schubert<dd><p>NTP seconds when the NIST leapseconds file expires
1008*052d159aSCy Schubert</p></dd>
10092b15cb3dSCy Schubert</dl>
1010*052d159aSCy Schubert<p>The jitter and wander statistics are exponentially-weighted RMS averages.
10112b15cb3dSCy SchubertThe system jitter is defined in the NTPv4 specification;
10122b15cb3dSCy Schubertthe clock jitter statistic is computed by the clock discipline module.
1013*052d159aSCy Schubert</p>
10142b15cb3dSCy Schubert<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
10152b15cb3dSCy Schubertadditional system variables are displayed,
10162b15cb3dSCy Schubertincluding some or all of the following,
10172b15cb3dSCy Schubertdepending on the particular Autokey dance:
1018*052d159aSCy Schubert</p><dl compact="compact">
1019*052d159aSCy Schubert<dt>Variable</dt>
1020*052d159aSCy Schubert<dd><p>Description
1021*052d159aSCy Schubert</p></dd>
1022*052d159aSCy Schubert<dt><code>host</code></dt>
1023*052d159aSCy Schubert<dd><p>Autokey host name for this host
1024*052d159aSCy Schubert</p></dd>
1025*052d159aSCy Schubert<dt><code>ident</code></dt>
1026*052d159aSCy Schubert<dd><p>Autokey group name for this host
1027*052d159aSCy Schubert</p></dd>
1028*052d159aSCy Schubert<dt><code>flags</code></dt>
1029*052d159aSCy Schubert<dd><p>host flags  (see Autokey specification)
1030*052d159aSCy Schubert</p></dd>
1031*052d159aSCy Schubert<dt><code>digest</code></dt>
1032*052d159aSCy Schubert<dd><p>OpenSSL message digest algorithm
1033*052d159aSCy Schubert</p></dd>
1034*052d159aSCy Schubert<dt><code>signature</code></dt>
1035*052d159aSCy Schubert<dd><p>OpenSSL digest/signature scheme
1036*052d159aSCy Schubert</p></dd>
1037*052d159aSCy Schubert<dt><code>update</code></dt>
1038*052d159aSCy Schubert<dd><p>NTP seconds at last signature update
1039*052d159aSCy Schubert</p></dd>
1040*052d159aSCy Schubert<dt><code>cert</code></dt>
1041*052d159aSCy Schubert<dd><p>certificate subject, issuer and certificate flags
1042*052d159aSCy Schubert</p></dd>
1043*052d159aSCy Schubert<dt><code>until</code></dt>
1044*052d159aSCy Schubert<dd><p>NTP seconds when the certificate expires
1045*052d159aSCy Schubert</p></dd>
10462b15cb3dSCy Schubert</dl>
1047*052d159aSCy Schubert<a name="Peer-Variables-1"></a>
1048*052d159aSCy Schubert<h4 class="subsubsection">1.1.1.4 Peer Variables</h4>
10492b15cb3dSCy Schubert<p>The following peer variables appear in the
105009100258SXin LI<code>readlist</code>
10512b15cb3dSCy Schubertbillboard for each association.
10522b15cb3dSCy SchubertNot all variables are displayed in some configurations.
1053*052d159aSCy Schubert</p>
1054*052d159aSCy Schubert<dl compact="compact">
1055*052d159aSCy Schubert<dt>Variable</dt>
1056*052d159aSCy Schubert<dd><p>Description
1057*052d159aSCy Schubert</p></dd>
1058*052d159aSCy Schubert<dt><code>associd</code></dt>
1059*052d159aSCy Schubert<dd><p>association id
1060*052d159aSCy Schubert</p></dd>
1061*052d159aSCy Schubert<dt><code>status</code></dt>
1062*052d159aSCy Schubert<dd><p>.Lk decode.html#peer &quot;peer status word&quot;
1063*052d159aSCy Schubert</p></dd>
1064*052d159aSCy Schubert<dt><code>srcadr</code></dt>
1065*052d159aSCy Schubert<dd><p>source (remote) IP address
1066*052d159aSCy Schubert</p></dd>
1067*052d159aSCy Schubert<dt><code>srcport</code></dt>
1068*052d159aSCy Schubert<dd><p>source (remote) port
1069*052d159aSCy Schubert</p></dd>
1070*052d159aSCy Schubert<dt><code>dstadr</code></dt>
1071*052d159aSCy Schubert<dd><p>destination (local) IP address
1072*052d159aSCy Schubert</p></dd>
1073*052d159aSCy Schubert<dt><code>dstport</code></dt>
1074*052d159aSCy Schubert<dd><p>destination (local) port
1075*052d159aSCy Schubert</p></dd>
1076*052d159aSCy Schubert<dt><code>leap</code></dt>
1077*052d159aSCy Schubert<dd><p>leap indicator (0-3)
1078*052d159aSCy Schubert</p></dd>
1079*052d159aSCy Schubert<dt><code>stratum</code></dt>
1080*052d159aSCy Schubert<dd><p>stratum (0-15)
1081*052d159aSCy Schubert</p></dd>
1082*052d159aSCy Schubert<dt><code>precision</code></dt>
1083*052d159aSCy Schubert<dd><p>precision (log2 s)
1084*052d159aSCy Schubert</p></dd>
1085*052d159aSCy Schubert<dt><code>rootdelay</code></dt>
1086*052d159aSCy Schubert<dd><p>total roundtrip delay to the primary reference clock
1087*052d159aSCy Schubert</p></dd>
1088*052d159aSCy Schubert<dt><code>rootdisp</code></dt>
1089*052d159aSCy Schubert<dd><p>total root dispersion to the primary reference clock
1090*052d159aSCy Schubert</p></dd>
1091*052d159aSCy Schubert<dt><code>refid</code></dt>
1092*052d159aSCy Schubert<dd><p>reference id or
1093*052d159aSCy Schubert.Lk decode.html#kiss &quot;kiss code&quot;
1094*052d159aSCy Schubert</p></dd>
1095*052d159aSCy Schubert<dt><code>reftime</code></dt>
1096*052d159aSCy Schubert<dd><p>reference time
1097*052d159aSCy Schubert</p></dd>
1098*052d159aSCy Schubert<dt><code>rec</code></dt>
1099*052d159aSCy Schubert<dd><p>last packet received time
1100*052d159aSCy Schubert</p></dd>
1101*052d159aSCy Schubert<dt><code>reach</code></dt>
1102*052d159aSCy Schubert<dd><p>reach register (octal)
1103*052d159aSCy Schubert</p></dd>
1104*052d159aSCy Schubert<dt><code>unreach</code></dt>
1105*052d159aSCy Schubert<dd><p>unreach counter
1106*052d159aSCy Schubert</p></dd>
1107*052d159aSCy Schubert<dt><code>hmode</code></dt>
1108*052d159aSCy Schubert<dd><p>host mode (1-6)
1109*052d159aSCy Schubert</p></dd>
1110*052d159aSCy Schubert<dt><code>pmode</code></dt>
1111*052d159aSCy Schubert<dd><p>peer mode (1-5)
1112*052d159aSCy Schubert</p></dd>
1113*052d159aSCy Schubert<dt><code>hpoll</code></dt>
1114*052d159aSCy Schubert<dd><p>host poll exponent (log2 s) (3-17)
1115*052d159aSCy Schubert</p></dd>
1116*052d159aSCy Schubert<dt><code>ppoll</code></dt>
1117*052d159aSCy Schubert<dd><p>peer poll exponent (log2 s) (3-17)
1118*052d159aSCy Schubert</p></dd>
1119*052d159aSCy Schubert<dt><code>headway</code></dt>
1120*052d159aSCy Schubert<dd><p>headway (see
1121*052d159aSCy Schubert.Lk rate.html &quot;Rate Management and the Kiss-o&rsquo;-Death Packet&quot; )
1122*052d159aSCy Schubert</p></dd>
1123*052d159aSCy Schubert<dt><code>flash</code></dt>
1124*052d159aSCy Schubert<dd><p>.Lk decode.html#flash &quot;flash status word&quot;
1125*052d159aSCy Schubert</p></dd>
1126*052d159aSCy Schubert<dt><code>keyid</code></dt>
1127*052d159aSCy Schubert<dd><p>symmetric key id
1128*052d159aSCy Schubert</p></dd>
1129*052d159aSCy Schubert<dt><code>offset</code></dt>
1130*052d159aSCy Schubert<dd><p>filter offset
1131*052d159aSCy Schubert</p></dd>
1132*052d159aSCy Schubert<dt><code>delay</code></dt>
1133*052d159aSCy Schubert<dd><p>filter delay
1134*052d159aSCy Schubert</p></dd>
1135*052d159aSCy Schubert<dt><code>dispersion</code></dt>
1136*052d159aSCy Schubert<dd><p>filter dispersion
1137*052d159aSCy Schubert</p></dd>
1138*052d159aSCy Schubert<dt><code>jitter</code></dt>
1139*052d159aSCy Schubert<dd><p>filter jitter
1140*052d159aSCy Schubert</p></dd>
1141*052d159aSCy Schubert<dt><code>bias</code></dt>
1142*052d159aSCy Schubert<dd><p>unicast/broadcast bias
1143*052d159aSCy Schubert</p></dd>
1144*052d159aSCy Schubert<dt><code>xleave</code></dt>
1145*052d159aSCy Schubert<dd><p>interleave delay (see
1146*052d159aSCy Schubert.Lk xleave.html &quot;NTP Interleaved Modes&quot; )
1147*052d159aSCy Schubert</p></dd>
11482b15cb3dSCy Schubert</dl>
1149*052d159aSCy Schubert<p>The
11502b15cb3dSCy Schubert<code>bias</code>
11512b15cb3dSCy Schubertvariable is calculated when the first broadcast packet is received
11522b15cb3dSCy Schubertafter the calibration volley.
115309100258SXin LIIt represents the offset of the broadcast subgraph relative to the
115409100258SXin LIunicast subgraph.
11552b15cb3dSCy SchubertThe
11562b15cb3dSCy Schubert<code>xleave</code>
11572b15cb3dSCy Schubertvariable appears only for the interleaved symmetric and interleaved modes.
11582b15cb3dSCy SchubertIt represents the internal queuing, buffering and transmission delays
11592b15cb3dSCy Schubertfor the preceding packet.
1160*052d159aSCy Schubert</p>
11612b15cb3dSCy Schubert<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
11622b15cb3dSCy Schubertadditional peer variables are displayed, including the following:
1163*052d159aSCy Schubert</p><dl compact="compact">
1164*052d159aSCy Schubert<dt>Variable</dt>
1165*052d159aSCy Schubert<dd><p>Description
1166*052d159aSCy Schubert</p></dd>
1167*052d159aSCy Schubert<dt><code>flags</code></dt>
1168*052d159aSCy Schubert<dd><p>peer flags (see Autokey specification)
1169*052d159aSCy Schubert</p></dd>
1170*052d159aSCy Schubert<dt><code>host</code></dt>
1171*052d159aSCy Schubert<dd><p>Autokey server name
1172*052d159aSCy Schubert</p></dd>
1173*052d159aSCy Schubert<dt><code>flags</code></dt>
1174*052d159aSCy Schubert<dd><p>peer flags (see Autokey specification)
1175*052d159aSCy Schubert</p></dd>
1176*052d159aSCy Schubert<dt><code>signature</code></dt>
1177*052d159aSCy Schubert<dd><p>OpenSSL digest/signature scheme
1178*052d159aSCy Schubert</p></dd>
1179*052d159aSCy Schubert<dt><code>initsequence</code></dt>
1180*052d159aSCy Schubert<dd><p>initial key id
1181*052d159aSCy Schubert</p></dd>
1182*052d159aSCy Schubert<dt><code>initkey</code></dt>
1183*052d159aSCy Schubert<dd><p>initial key index
1184*052d159aSCy Schubert</p></dd>
1185*052d159aSCy Schubert<dt><code>timestamp</code></dt>
1186*052d159aSCy Schubert<dd><p>Autokey signature timestamp
1187*052d159aSCy Schubert</p></dd>
1188*052d159aSCy Schubert<dt><code>ident</code></dt>
1189*052d159aSCy Schubert<dd><p>Autokey group name for this association
1190*052d159aSCy Schubert</p></dd>
11912b15cb3dSCy Schubert</dl>
11922b15cb3dSCy Schubert
1193*052d159aSCy Schubert<a name="Clock-Variables-1"></a>
1194*052d159aSCy Schubert<h4 class="subsubsection">1.1.1.5 Clock Variables</h4>
11952b15cb3dSCy Schubert<p>The following clock variables appear in the
119609100258SXin LI<code>clocklist</code>
11972b15cb3dSCy Schubertbillboard for each association with a reference clock.
11982b15cb3dSCy SchubertNot all variables are displayed in some configurations.
1199*052d159aSCy Schubert</p><dl compact="compact">
1200*052d159aSCy Schubert<dt>Variable</dt>
1201*052d159aSCy Schubert<dd><p>Description
1202*052d159aSCy Schubert</p></dd>
1203*052d159aSCy Schubert<dt><code>associd</code></dt>
1204*052d159aSCy Schubert<dd><p>association id
1205*052d159aSCy Schubert</p></dd>
1206*052d159aSCy Schubert<dt><code>status</code></dt>
1207*052d159aSCy Schubert<dd><p>.Lk decode.html#clock &quot;clock status word&quot;
1208*052d159aSCy Schubert</p></dd>
1209*052d159aSCy Schubert<dt><code>device</code></dt>
1210*052d159aSCy Schubert<dd><p>device description
1211*052d159aSCy Schubert</p></dd>
1212*052d159aSCy Schubert<dt><code>timecode</code></dt>
1213*052d159aSCy Schubert<dd><p>ASCII time code string (specific to device)
1214*052d159aSCy Schubert</p></dd>
1215*052d159aSCy Schubert<dt><code>poll</code></dt>
1216*052d159aSCy Schubert<dd><p>poll messages sent
1217*052d159aSCy Schubert</p></dd>
1218*052d159aSCy Schubert<dt><code>noreply</code></dt>
1219*052d159aSCy Schubert<dd><p>no reply
1220*052d159aSCy Schubert</p></dd>
1221*052d159aSCy Schubert<dt><code>badformat</code></dt>
1222*052d159aSCy Schubert<dd><p>bad format
1223*052d159aSCy Schubert</p></dd>
1224*052d159aSCy Schubert<dt><code>baddata</code></dt>
1225*052d159aSCy Schubert<dd><p>bad date or time
1226*052d159aSCy Schubert</p></dd>
1227*052d159aSCy Schubert<dt><code>fudgetime1</code></dt>
1228*052d159aSCy Schubert<dd><p>fudge time 1
1229*052d159aSCy Schubert</p></dd>
1230*052d159aSCy Schubert<dt><code>fudgetime2</code></dt>
1231*052d159aSCy Schubert<dd><p>fudge time 2
1232*052d159aSCy Schubert</p></dd>
1233*052d159aSCy Schubert<dt><code>stratum</code></dt>
1234*052d159aSCy Schubert<dd><p>driver stratum
1235*052d159aSCy Schubert</p></dd>
1236*052d159aSCy Schubert<dt><code>refid</code></dt>
1237*052d159aSCy Schubert<dd><p>driver reference id
1238*052d159aSCy Schubert</p></dd>
1239*052d159aSCy Schubert<dt><code>flags</code></dt>
1240*052d159aSCy Schubert<dd><p>driver flags
1241*052d159aSCy Schubert</p></dd>
12422b15cb3dSCy Schubert</dl>
12432b15cb3dSCy Schubert
12442b15cb3dSCy Schubert<p>This section was generated by <strong>AutoGen</strong>,
12452b15cb3dSCy Schubertusing the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpq</code> program.
12462b15cb3dSCy SchubertThis software is released under the NTP license, &lt;http://ntp.org/license&gt;.
1247*052d159aSCy Schubert</p>
1248*052d159aSCy Schubert<table class="menu" border="0" cellspacing="0">
1249*052d159aSCy 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>)
1250*052d159aSCy Schubert</td></tr>
1251*052d159aSCy 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)
1252*052d159aSCy Schubert</td></tr>
1253*052d159aSCy 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)
1254*052d159aSCy Schubert</td></tr>
1255*052d159aSCy 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)
1256*052d159aSCy Schubert</td></tr>
1257*052d159aSCy 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)
1258*052d159aSCy Schubert</td></tr>
1259*052d159aSCy 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)
1260*052d159aSCy Schubert</td></tr>
1261*052d159aSCy 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
1262*052d159aSCy Schubert</td></tr>
1263*052d159aSCy 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)
1264*052d159aSCy Schubert</td></tr>
1265*052d159aSCy 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)
1266*052d159aSCy Schubert</td></tr>
1267*052d159aSCy 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)
1268*052d159aSCy Schubert</td></tr>
1269*052d159aSCy 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
1270*052d159aSCy Schubert</td></tr>
1271*052d159aSCy 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
1272*052d159aSCy Schubert</td></tr>
1273*052d159aSCy Schubert</table>
12742b15cb3dSCy Schubert
1275*052d159aSCy Schubert<hr>
1276*052d159aSCy Schubert<a name="ntpq-usage"></a>
1277*052d159aSCy Schubert<div class="header">
1278*052d159aSCy Schubert<p>
1279*052d159aSCy 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>
12802b15cb3dSCy Schubert</div>
1281*052d159aSCy Schubert<a name="ntpq-help_002fusage-_0028_002d_002dhelp_0029"></a>
1282*052d159aSCy Schubert<h4 class="subsection">1.1.2 ntpq help/usage (<samp>--help</samp>)</h4>
1283*052d159aSCy Schubert<a name="index-ntpq-help"></a>
12842b15cb3dSCy Schubert
1285*052d159aSCy Schubert<p>This is the automatically generated usage text for ntpq.
1286*052d159aSCy Schubert</p>
12872b15cb3dSCy Schubert<p>The text printed is the same whether selected with the <code>help</code> option
1288*052d159aSCy Schubert(<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
12892b15cb3dSCy Schubertthe usage text by passing it through a pager program.
12902b15cb3dSCy Schubert<code>more-help</code> is disabled on platforms without a working
12912b15cb3dSCy Schubert<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
1292*052d159aSCy Schubertused to select the program, defaulting to <samp>more</samp>.  Both will exit
12932b15cb3dSCy Schubertwith a status code of 0.
1294*052d159aSCy Schubert</p>
1295*052d159aSCy Schubert<div class="example">
1296*052d159aSCy Schubert<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p12
12972b15cb3dSCy SchubertUsage:  ntpq [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
12982b15cb3dSCy Schubert  Flg Arg Option-Name    Description
129909100258SXin LI   -4 no  ipv4           Force IPv4 name resolution
13002b15cb3dSCy Schubert                                - prohibits the option 'ipv6'
130109100258SXin LI   -6 no  ipv6           Force IPv6 name resolution
13022b15cb3dSCy Schubert                                - prohibits the option 'ipv4'
13032b15cb3dSCy Schubert   -c Str command        run a command and exit
13042b15cb3dSCy Schubert                                - may appear multiple times
13052b15cb3dSCy Schubert   -d no  debug-level    Increase debug verbosity level
13062b15cb3dSCy Schubert                                - may appear multiple times
13072b15cb3dSCy Schubert   -D Num set-debug-level Set the debug verbosity level
13082b15cb3dSCy Schubert                                - may appear multiple times
13092b15cb3dSCy Schubert   -i no  interactive    Force ntpq to operate in interactive mode
13102b15cb3dSCy Schubert                                - prohibits these options:
13112b15cb3dSCy Schubert                                command
13122b15cb3dSCy Schubert                                peers
13132b15cb3dSCy Schubert   -n no  numeric        numeric host addresses
13142b15cb3dSCy Schubert      no  old-rv         Always output status line with readvar
13152b15cb3dSCy Schubert   -p no  peers          Print a list of the peers
13162b15cb3dSCy Schubert                                - prohibits the option 'interactive'
13174990d495SXin LI   -r KWd refid          Set default display type for S2+ refids
13182b15cb3dSCy Schubert   -w no  wide           Display the full 'remote' value
13192b15cb3dSCy Schubert      opt version        output version information and exit
13202b15cb3dSCy Schubert   -? no  help           display extended usage information and exit
13212b15cb3dSCy Schubert   -! no  more-help      extended usage information passed thru pager
13222b15cb3dSCy Schubert   -&gt; opt save-opts      save the option state to a config file
13232b15cb3dSCy Schubert   -&lt; Str load-opts      load options from a config file
13242b15cb3dSCy Schubert                                - disabled as '--no-load-opts'
13252b15cb3dSCy Schubert                                - may appear multiple times
13262b15cb3dSCy Schubert
13272b15cb3dSCy SchubertOptions are specified by doubled hyphens and their name or by a single
13282b15cb3dSCy Schuberthyphen and the flag character.
13292b15cb3dSCy Schubert
13302b15cb3dSCy SchubertThe following option preset mechanisms are supported:
13312b15cb3dSCy Schubert - reading file $HOME/.ntprc
13322b15cb3dSCy Schubert - reading file ./.ntprc
13332b15cb3dSCy Schubert - examining environment variables named NTPQ_*
13342b15cb3dSCy Schubert
1335*052d159aSCy SchubertThe valid &quot;refid&quot; option keywords are:
13364990d495SXin LI  hash ipv4
13374990d495SXin LI  or an integer from 0 through 1
13384990d495SXin LI
13392b15cb3dSCy SchubertPlease send bug reports to:  &lt;http://bugs.ntp.org, bugs@ntp.org&gt;
1340*052d159aSCy Schubert</pre></div>
1341*052d159aSCy Schubert
1342*052d159aSCy Schubert<hr>
1343*052d159aSCy Schubert<a name="ntpq-ipv4"></a>
1344*052d159aSCy Schubert<div class="header">
1345*052d159aSCy Schubert<p>
1346*052d159aSCy 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>
13472b15cb3dSCy Schubert</div>
1348*052d159aSCy Schubert<a name="ipv4-option-_0028_002d4_0029"></a>
1349*052d159aSCy Schubert<h4 class="subsection">1.1.3 ipv4 option (-4)</h4>
1350*052d159aSCy Schubert<a name="index-ntpq_002dipv4"></a>
13512b15cb3dSCy Schubert
1352*052d159aSCy Schubert<p>This is the &ldquo;force ipv4 name resolution&rdquo; option.
1353*052d159aSCy Schubert</p>
1354*052d159aSCy Schubert<p>This option has some usage constraints.  It:
1355*052d159aSCy Schubert</p><ul>
13562b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
13572b15cb3dSCy Schubertipv6.
1358*052d159aSCy Schubert</li></ul>
13592b15cb3dSCy Schubert
136009100258SXin LI<p>Force resolution of following host names on the command line
13612b15cb3dSCy Schubertto the IPv4 namespace.
1362*052d159aSCy Schubert</p><hr>
1363*052d159aSCy Schubert<a name="ntpq-ipv6"></a>
1364*052d159aSCy Schubert<div class="header">
1365*052d159aSCy Schubert<p>
1366*052d159aSCy 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>
13672b15cb3dSCy Schubert</div>
1368*052d159aSCy Schubert<a name="ipv6-option-_0028_002d6_0029"></a>
1369*052d159aSCy Schubert<h4 class="subsection">1.1.4 ipv6 option (-6)</h4>
1370*052d159aSCy Schubert<a name="index-ntpq_002dipv6"></a>
13712b15cb3dSCy Schubert
1372*052d159aSCy Schubert<p>This is the &ldquo;force ipv6 name resolution&rdquo; option.
1373*052d159aSCy Schubert</p>
1374*052d159aSCy Schubert<p>This option has some usage constraints.  It:
1375*052d159aSCy Schubert</p><ul>
13762b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
13772b15cb3dSCy Schubertipv4.
1378*052d159aSCy Schubert</li></ul>
13792b15cb3dSCy Schubert
138009100258SXin LI<p>Force resolution of following host names on the command line
13812b15cb3dSCy Schubertto the IPv6 namespace.
1382*052d159aSCy Schubert</p><hr>
1383*052d159aSCy Schubert<a name="ntpq-command"></a>
1384*052d159aSCy Schubert<div class="header">
1385*052d159aSCy Schubert<p>
1386*052d159aSCy 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>
13872b15cb3dSCy Schubert</div>
1388*052d159aSCy Schubert<a name="command-option-_0028_002dc_0029"></a>
1389*052d159aSCy Schubert<h4 class="subsection">1.1.5 command option (-c)</h4>
1390*052d159aSCy Schubert<a name="index-ntpq_002dcommand"></a>
13912b15cb3dSCy Schubert
1392*052d159aSCy Schubert<p>This is the &ldquo;run a command and exit&rdquo; option.
1393*052d159aSCy SchubertThis option takes a string argument <samp>cmd</samp>.
1394*052d159aSCy Schubert</p>
1395*052d159aSCy Schubert<p>This option has some usage constraints.  It:
1396*052d159aSCy Schubert</p><ul>
13972b15cb3dSCy Schubert<li> may appear an unlimited number of times.
1398*052d159aSCy Schubert</li></ul>
13992b15cb3dSCy Schubert
14002b15cb3dSCy Schubert<p>The following argument is interpreted as an interactive format command
14012b15cb3dSCy Schubertand is added to the list of commands to be executed on the specified
14022b15cb3dSCy Schuberthost(s).
1403*052d159aSCy Schubert</p><hr>
1404*052d159aSCy Schubert<a name="ntpq-interactive"></a>
1405*052d159aSCy Schubert<div class="header">
1406*052d159aSCy Schubert<p>
1407*052d159aSCy 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>
14082b15cb3dSCy Schubert</div>
1409*052d159aSCy Schubert<a name="interactive-option-_0028_002di_0029"></a>
1410*052d159aSCy Schubert<h4 class="subsection">1.1.6 interactive option (-i)</h4>
1411*052d159aSCy Schubert<a name="index-ntpq_002dinteractive"></a>
14122b15cb3dSCy Schubert
1413*052d159aSCy Schubert<p>This is the &ldquo;force ntpq to operate in interactive mode&rdquo; option.
1414*052d159aSCy Schubert</p>
1415*052d159aSCy Schubert<p>This option has some usage constraints.  It:
1416*052d159aSCy Schubert</p><ul>
14172b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
14182b15cb3dSCy Schubertcommand, peers.
1419*052d159aSCy Schubert</li></ul>
14202b15cb3dSCy Schubert
14212b15cb3dSCy Schubert<p>Force <code>ntpq</code> to operate in interactive mode.
14222b15cb3dSCy SchubertPrompts will be written to the standard output and
14232b15cb3dSCy Schubertcommands read from the standard input.
1424*052d159aSCy Schubert</p><hr>
1425*052d159aSCy Schubert<a name="ntpq-numeric"></a>
1426*052d159aSCy Schubert<div class="header">
1427*052d159aSCy Schubert<p>
1428*052d159aSCy 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>
14292b15cb3dSCy Schubert</div>
1430*052d159aSCy Schubert<a name="numeric-option-_0028_002dn_0029"></a>
1431*052d159aSCy Schubert<h4 class="subsection">1.1.7 numeric option (-n)</h4>
1432*052d159aSCy Schubert<a name="index-ntpq_002dnumeric"></a>
14332b15cb3dSCy Schubert
1434*052d159aSCy Schubert<p>This is the &ldquo;numeric host addresses&rdquo; option.
14352b15cb3dSCy SchubertOutput all host addresses in dotted-quad numeric format rather than
14362b15cb3dSCy Schubertconverting to the canonical host names.
1437*052d159aSCy Schubert</p><hr>
1438*052d159aSCy Schubert<a name="ntpq-old_002drv"></a>
1439*052d159aSCy Schubert<div class="header">
1440*052d159aSCy Schubert<p>
1441*052d159aSCy 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>
14422b15cb3dSCy Schubert</div>
1443*052d159aSCy Schubert<a name="old_002drv-option"></a>
1444*052d159aSCy Schubert<h4 class="subsection">1.1.8 old-rv option</h4>
1445*052d159aSCy Schubert<a name="index-ntpq_002dold_002drv"></a>
14462b15cb3dSCy Schubert
1447*052d159aSCy Schubert<p>This is the &ldquo;always output status line with readvar&rdquo; option.
14482b15cb3dSCy SchubertBy default, <code>ntpq</code> now suppresses the <code>associd=...</code>
14492b15cb3dSCy Schubertline that precedes the output of <code>readvar</code>
14502b15cb3dSCy Schubert(alias <code>rv</code>) when a single variable is requested, such as
1451*052d159aSCy Schubert<code>ntpq -c &quot;rv 0 offset&quot;</code>.
14522b15cb3dSCy SchubertThis option causes <code>ntpq</code> to include both lines of output
14532b15cb3dSCy Schubertfor a single-variable <code>readvar</code>.
14542b15cb3dSCy SchubertUsing an environment variable to
14552b15cb3dSCy Schubertpreset this option in a script will enable both older and
14562b15cb3dSCy Schubertnewer <code>ntpq</code> to behave identically in this regard.
1457*052d159aSCy Schubert</p><hr>
1458*052d159aSCy Schubert<a name="ntpq-peers"></a>
1459*052d159aSCy Schubert<div class="header">
1460*052d159aSCy Schubert<p>
1461*052d159aSCy 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>
14622b15cb3dSCy Schubert</div>
1463*052d159aSCy Schubert<a name="peers-option-_0028_002dp_0029"></a>
1464*052d159aSCy Schubert<h4 class="subsection">1.1.9 peers option (-p)</h4>
1465*052d159aSCy Schubert<a name="index-ntpq_002dpeers"></a>
14662b15cb3dSCy Schubert
1467*052d159aSCy Schubert<p>This is the &ldquo;print a list of the peers&rdquo; option.
1468*052d159aSCy Schubert</p>
1469*052d159aSCy Schubert<p>This option has some usage constraints.  It:
1470*052d159aSCy Schubert</p><ul>
14712b15cb3dSCy Schubert<li> must not appear in combination with any of the following options:
14722b15cb3dSCy Schubertinteractive.
1473*052d159aSCy Schubert</li></ul>
14742b15cb3dSCy Schubert
14752b15cb3dSCy Schubert<p>Print a list of the peers known to the server as well as a summary
1476*052d159aSCy Schubertof their state. This is equivalent to the &rsquo;peers&rsquo; interactive command.
1477*052d159aSCy Schubert</p><hr>
1478*052d159aSCy Schubert<a name="ntpq-refid"></a>
1479*052d159aSCy Schubert<div class="header">
1480*052d159aSCy Schubert<p>
1481*052d159aSCy SchubertNext: <a href="#ntpq-wide" accesskey="n" rel="next">ntpq wide</a>, Previous: <a href="#ntpq-peers" accesskey="p" rel="prev">ntpq peers</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
14822b15cb3dSCy Schubert</div>
1483*052d159aSCy Schubert<a name="refid-option-_0028_002dr_0029"></a>
1484*052d159aSCy Schubert<h4 class="subsection">1.1.10 refid option (-r)</h4>
1485*052d159aSCy Schubert<a name="index-ntpq_002drefid"></a>
14862b15cb3dSCy Schubert
1487*052d159aSCy Schubert<p>This is the &ldquo;set default display type for s2+ refids&rdquo; option.
14884990d495SXin LIThis option takes a keyword argument.
1489*052d159aSCy Schubert</p>
1490*052d159aSCy Schubert<p>This option has some usage constraints.  It:
1491*052d159aSCy Schubert</p><ul>
14924990d495SXin LI<li> This option takes a keyword as its argument.
14934990d495SXin LIThe argument sets an enumeration value that can be tested by comparing the option value macro (OPT_VALUE_REFID).
14944990d495SXin LIThe available keywords are:
1495*052d159aSCy Schubert<div class="example">
14964990d495SXin LI<pre class="example">    hash ipv4
1497*052d159aSCy Schubert</pre></div>
1498*052d159aSCy Schubert
1499*052d159aSCy Schubert<p>or their numeric equivalent.</p></li></ul>
15004990d495SXin LI
15014990d495SXin LI<p>Set the default display format for S2+ refids.
1502*052d159aSCy Schubert</p><hr>
1503*052d159aSCy Schubert<a name="ntpq-wide"></a>
1504*052d159aSCy Schubert<div class="header">
1505*052d159aSCy Schubert<p>
1506*052d159aSCy SchubertNext: <a href="#ntpq-config" accesskey="n" rel="next">ntpq config</a>, Previous: <a href="#ntpq-refid" accesskey="p" rel="prev">ntpq refid</a>, Up: <a href="#ntpq-Invocation" accesskey="u" rel="up">ntpq Invocation</a> &nbsp; </p>
15074990d495SXin LI</div>
1508*052d159aSCy Schubert<a name="wide-option-_0028_002dw_0029"></a>
1509*052d159aSCy Schubert<h4 class="subsection">1.1.11 wide option (-w)</h4>
1510*052d159aSCy Schubert<a name="index-ntpq_002dwide"></a>
15114990d495SXin LI
1512*052d159aSCy Schubert<p>This is the &ldquo;display the full &rsquo;remote&rsquo; value&rdquo; option.
1513*052d159aSCy SchubertDisplay the full value of the &rsquo;remote&rsquo; value.  If this requires
15142b15cb3dSCy Schubertmore than 15 characters, display the full value, emit a newline,
15152b15cb3dSCy Schubertand continue the data display properly indented on the next line.
1516*052d159aSCy Schubert</p>
15172b15cb3dSCy Schubert
1518*052d159aSCy Schubert<hr>
1519*052d159aSCy Schubert<a name="ntpq-config"></a>
1520*052d159aSCy Schubert<div class="header">
1521*052d159aSCy Schubert<p>
1522*052d159aSCy 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>
15232b15cb3dSCy Schubert</div>
1524*052d159aSCy Schubert<a name="presetting_002fconfiguring-ntpq"></a>
1525*052d159aSCy Schubert<h4 class="subsection">1.1.12 presetting/configuring ntpq</h4>
15262b15cb3dSCy Schubert
15272b15cb3dSCy Schubert<p>Any option that is not marked as <i>not presettable</i> may be preset by
1528*052d159aSCy 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
15292b15cb3dSCy Schubertthe options listed above in upper case and segmented with underscores.
15302b15cb3dSCy SchubertThe <code>NTPQ</code> variable will be tokenized and parsed like
15312b15cb3dSCy Schubertthe command line.  The remaining variables are tested for existence and their
15322b15cb3dSCy Schubertvalues are treated like option arguments.
1533*052d159aSCy Schubert</p>
15342b15cb3dSCy Schubert
1535*052d159aSCy Schubert<p><code>libopts</code> will search in 2 places for configuration files:
1536*052d159aSCy Schubert</p><ul>
15372b15cb3dSCy Schubert<li> $HOME
1538*052d159aSCy Schubert</li><li> $PWD
1539*052d159aSCy Schubert</li></ul>
1540*052d159aSCy Schubert<p>The environment variables <code>HOME</code>, and <code>PWD</code>
1541*052d159aSCy Schubertare expanded and replaced when <samp>ntpq</samp> runs.
15422b15cb3dSCy SchubertFor any of these that are plain files, they are simply processed.
1543*052d159aSCy SchubertFor any that are directories, then a file named <samp>.ntprc</samp> is searched for
15442b15cb3dSCy Schubertwithin that directory and processed.
1545*052d159aSCy Schubert</p>
15462b15cb3dSCy Schubert<p>Configuration files may be in a wide variety of formats.
15472b15cb3dSCy SchubertThe basic format is an option name followed by a value (argument) on the
15482b15cb3dSCy Schubertsame line.  Values may be separated from the option name with a colon,
15492b15cb3dSCy Schubertequal sign or simply white space.  Values may be continued across multiple
15502b15cb3dSCy Schubertlines by escaping the newline with a backslash.
1551*052d159aSCy Schubert</p>
15522b15cb3dSCy Schubert<p>Multiple programs may also share the same initialization file.
15532b15cb3dSCy SchubertCommon options are collected at the top, followed by program specific
15542b15cb3dSCy Schubertsegments.  The segments are separated by lines like:
1555*052d159aSCy Schubert</p><div class="example">
15562b15cb3dSCy Schubert<pre class="example">[NTPQ]
1557*052d159aSCy Schubert</pre></div>
1558*052d159aSCy Schubert<p>or by
1559*052d159aSCy Schubert</p><div class="example">
15602b15cb3dSCy Schubert<pre class="example">&lt;?program ntpq&gt;
1561*052d159aSCy Schubert</pre></div>
1562*052d159aSCy Schubert<p>Do not mix these styles within one configuration file.
1563*052d159aSCy Schubert</p>
15642b15cb3dSCy Schubert<p>Compound values and carefully constructed string values may also be
15652b15cb3dSCy Schubertspecified using XML syntax:
1566*052d159aSCy Schubert</p><div class="example">
15672b15cb3dSCy Schubert<pre class="example">&lt;option-name&gt;
15682b15cb3dSCy Schubert   &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
15692b15cb3dSCy Schubert&lt;/option-name&gt;
1570*052d159aSCy Schubert</pre></div>
1571*052d159aSCy Schubert<p>yielding an <code>option-name.sub-opt</code> string value of
1572*052d159aSCy Schubert</p><div class="example">
1573*052d159aSCy Schubert<pre class="example">&quot;...&lt;...&gt;...&quot;
1574*052d159aSCy Schubert</pre></div>
15752b15cb3dSCy Schubert<p><code>AutoOpts</code> does not track suboptions.  You simply note that it is a
15762b15cb3dSCy Schuberthierarchicly valued option.  <code>AutoOpts</code> does provide a means for searching
15772b15cb3dSCy Schubertthe associated name/value pair list (see: optionFindValue).
1578*052d159aSCy Schubert</p>
15792b15cb3dSCy Schubert<p>The command line options relating to configuration and/or usage help are:
1580*052d159aSCy Schubert</p>
1581*052d159aSCy Schubert<a name="version-_0028_002d_0029"></a>
1582*052d159aSCy Schubert<h4 class="subsubheading">version (-)</h4>
15832b15cb3dSCy Schubert
15842b15cb3dSCy Schubert<p>Print the program version to standard out, optionally with licensing
15852b15cb3dSCy Schubertinformation, then exit 0.  The optional argument specifies how much licensing
15862b15cb3dSCy Schubertdetail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument.
15872b15cb3dSCy SchubertOnly the first letter of the argument is examined:
1588*052d159aSCy Schubert</p>
1589*052d159aSCy Schubert<dl compact="compact">
1590*052d159aSCy Schubert<dt>&lsquo;<samp>version</samp>&rsquo;</dt>
1591*052d159aSCy Schubert<dd><p>Only print the version.  This is the default.
1592*052d159aSCy Schubert</p></dd>
1593*052d159aSCy Schubert<dt>&lsquo;<samp>copyright</samp>&rsquo;</dt>
1594*052d159aSCy Schubert<dd><p>Name the copyright usage licensing terms.
1595*052d159aSCy Schubert</p></dd>
1596*052d159aSCy Schubert<dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
1597*052d159aSCy Schubert<dd><p>Print the full copyright usage licensing terms.
1598*052d159aSCy Schubert</p></dd>
15992b15cb3dSCy Schubert</dl>
16002b15cb3dSCy Schubert
1601*052d159aSCy Schubert<hr>
1602*052d159aSCy Schubert<a name="ntpq-exit-status"></a>
1603*052d159aSCy Schubert<div class="header">
1604*052d159aSCy Schubert<p>
1605*052d159aSCy 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>
16062b15cb3dSCy Schubert</div>
1607*052d159aSCy Schubert<a name="ntpq-exit-status-1"></a>
1608*052d159aSCy Schubert<h4 class="subsection">1.1.13 ntpq exit status</h4>
16092b15cb3dSCy Schubert
16102b15cb3dSCy Schubert<p>One of the following exit values will be returned:
1611*052d159aSCy Schubert</p><dl compact="compact">
1612*052d159aSCy Schubert<dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
1613*052d159aSCy Schubert<dd><p>Successful program execution.
1614*052d159aSCy Schubert</p></dd>
1615*052d159aSCy Schubert<dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
1616*052d159aSCy Schubert<dd><p>The operation failed or the command syntax was not valid.
1617*052d159aSCy Schubert</p></dd>
1618*052d159aSCy Schubert<dt>&lsquo;<samp>66 (EX_NOINPUT)</samp>&rsquo;</dt>
1619*052d159aSCy Schubert<dd><p>A specified configuration file could not be loaded.
1620*052d159aSCy Schubert</p></dd>
1621*052d159aSCy Schubert<dt>&lsquo;<samp>70 (EX_SOFTWARE)</samp>&rsquo;</dt>
1622*052d159aSCy Schubert<dd><p>libopts had an internal operational error.  Please report
16232b15cb3dSCy Schubertit to autogen-users@lists.sourceforge.net.  Thank you.
1624*052d159aSCy Schubert</p></dd>
16252b15cb3dSCy Schubert</dl>
16262b15cb3dSCy Schubert
1627*052d159aSCy Schubert<hr>
1628*052d159aSCy Schubert<a name="Usage"></a>
1629*052d159aSCy Schubert<div class="header">
1630*052d159aSCy Schubert<p>
1631*052d159aSCy 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>
16322b15cb3dSCy Schubert</div>
1633*052d159aSCy Schubert<a name="Usage-1"></a>
1634*052d159aSCy Schubert<h3 class="section">1.2 Usage</h3>
16352b15cb3dSCy Schubert
1636*052d159aSCy Schubert<table>
1637*052d159aSCy 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>
1638*052d159aSCy 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>
1639*052d159aSCy 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>
1640*052d159aSCy 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>
1641*052d159aSCy 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>
1642*052d159aSCy 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>
1643*052d159aSCy 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>
1644*052d159aSCy 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>
1645*052d159aSCy 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>
1646*052d159aSCy Schubert</table>
16472b15cb3dSCy Schubert
1648*052d159aSCy Schubert<hr>
1649*052d159aSCy Schubert<a name="Internal-Commands"></a>
1650*052d159aSCy Schubert<div class="header">
1651*052d159aSCy Schubert<p>
1652*052d159aSCy 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>
16532b15cb3dSCy Schubert</div>
1654*052d159aSCy Schubert<a name="Internal-Commands-2"></a>
1655*052d159aSCy Schubert<h3 class="section">1.3 Internal Commands</h3>
16562b15cb3dSCy Schubert
16572b15cb3dSCy 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.
1658*052d159aSCy Schubert</p>
1659*052d159aSCy Schubert<dl compact="compact">
1660*052d159aSCy Schubert<dt><code><a name="help"></a><code>? [</code><kbd>command_keyword</kbd><code>]</code></code></dt>
1661*052d159aSCy Schubert<dt><code><code>help [</code><kbd>command_keyword</kbd><code>]</code></code></dt>
1662*052d159aSCy 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.
1663*052d159aSCy Schubert</p>
1664*052d159aSCy Schubert</dd>
1665*052d159aSCy Schubert<dt><code><a name="addvars"></a>&gt;<code>addvars <kbd>name</kbd> [ = <kbd>value</kbd>] [...]</code></code></dt>
1666*052d159aSCy Schubert<dt><code><code>rmvars <kbd>name</kbd> [...]</code></code></dt>
1667*052d159aSCy Schubert<dt><code><code>clearvars</code>&lt;/dt&gt;</code></dt>
1668*052d159aSCy Schubert<dd><p>The arguments to these commands consist of a list of items of the form
1669*052d159aSCy Schubert<code><kbd>name</kbd> = <kbd>value</kbd></code>, where the <code>= <kbd>value</kbd></code> is ignored,
16702b15cb3dSCy Schubertand can be omitted in read requests.
16712b15cb3dSCy Schubert<code>ntpq</code> maintains an internal list in which data to be included
16722b15cb3dSCy Schubertin control messages can be assembled, and sent using the <code>readlist</code>
16732b15cb3dSCy Schubertand <code>writelist</code> commands described below.
16742b15cb3dSCy SchubertThe <code>addvars</code> command allows variables and optional values
16752b15cb3dSCy Schubertto be added to the list.
16762b15cb3dSCy SchubertIf more than one variable is to be added
16772b15cb3dSCy Schubertthe list should be comma-separated and not contain white space.
16782b15cb3dSCy SchubertThe <code>rmvars</code> command can be used to remove individual variables
16792b15cb3dSCy Schubertfrom the list,
16802b15cb3dSCy Schubertwhile the <code>clearlist</code> command removes all variables from the list.
1681*052d159aSCy Schubert</p>
1682*052d159aSCy Schubert</dd>
1683*052d159aSCy Schubert<dt><code><a name="cooked"></a><code>cooked</code></code></dt>
1684*052d159aSCy Schubert<dd><p>Display server messages in prettyprint format.
1685*052d159aSCy Schubert</p>
1686*052d159aSCy Schubert</dd>
1687*052d159aSCy Schubert<dt><code><a name="debug"></a><code>debug more | less | off</code></code></dt>
1688*052d159aSCy Schubert<dd><p>Turns internal query program debugging on and off.
1689*052d159aSCy Schubert</p>
1690*052d159aSCy Schubert</dd>
1691*052d159aSCy Schubert<dt><code><a name="delay"></a><code>delay <kbd>milliseconds</kbd></code></code></dt>
1692*052d159aSCy 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.
1693*052d159aSCy Schubert</p>
1694*052d159aSCy Schubert</dd>
1695*052d159aSCy Schubert<dt><code><a name="host"></a><code>host <kbd>name</kbd></code></code></dt>
1696*052d159aSCy Schubert<dd><p>Set the host to which future queries will be sent.
16972b15cb3dSCy SchubertThe name may be either a DNS name or a numeric address.
1698*052d159aSCy Schubert</p>
1699*052d159aSCy Schubert</dd>
1700*052d159aSCy Schubert<dt><code><a name="hostnames"></a><code>hostnames [yes | no]</code></code></dt>
1701*052d159aSCy Schubert<dd><p>If <code>yes</code> is specified, host names are printed in information displays.
17022b15cb3dSCy SchubertIf <code>no</code> is specified, numeric addresses are printed instead.
17032b15cb3dSCy SchubertThe default is <code>yes</code>,
17042b15cb3dSCy Schubertunless modified using the command line <code>-n</code> switch.
1705*052d159aSCy Schubert</p>
1706*052d159aSCy Schubert</dd>
1707*052d159aSCy Schubert<dt><code><a name="keyid"></a><code>keyid <kbd>keyid</kbd></code></code></dt>
1708*052d159aSCy Schubert<dd><p>This command specifies the key number to be used
17092b15cb3dSCy Schubertto authenticate configuration requests.
17102b15cb3dSCy SchubertThis must correspond to a key ID configured in <code>ntp.conf</code> for this purpose.
1711*052d159aSCy Schubert</p>
1712*052d159aSCy Schubert</dd>
1713*052d159aSCy Schubert<dt><code><a name="keytype"></a><code>keytype</code></code></dt>
1714*052d159aSCy Schubert<dd><p>Specify the digest algorithm to use for authenticated requests,
17152b15cb3dSCy Schubertwith default <code>MD5</code>.
17162b15cb3dSCy SchubertIf the OpenSSL library is installed,
17172b15cb3dSCy Schubertdigest can be be any message digest algorithm supported by the library.
171809100258SXin 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>.
1719*052d159aSCy Schubert</p>
1720*052d159aSCy Schubert</dd>
1721*052d159aSCy Schubert<dt><code><a name="ntpversion"></a><code>ntpversion 1 | 2 | 3 | 4</code></code></dt>
1722*052d159aSCy Schubert<dd><p>Sets the NTP version number which <code>ntpq</code> claims in packets.
17232b15cb3dSCy SchubertDefaults to 2.
17242b15cb3dSCy SchubertNote that mode-6 control messages (and modes, for that matter)
1725*052d159aSCy Schubertdidn&rsquo;t exist in NTP version 1.
1726*052d159aSCy Schubert</p>
1727*052d159aSCy Schubert</dd>
1728*052d159aSCy Schubert<dt><code><a name="passwd"></a><code>passwd</code></code></dt>
1729*052d159aSCy Schubert<dd><p>This command prompts for a password to authenticate requests.
17302b15cb3dSCy SchubertThe password must correspond to the key ID configured in <code>ntp.conf</code> for this purpose.
1731*052d159aSCy Schubert</p>
1732*052d159aSCy Schubert</dd>
1733*052d159aSCy Schubert<dt><code><a name="quit"></a><code>quit</code></code></dt>
1734*052d159aSCy Schubert<dd><p>Exit <code>ntpq</code>.
1735*052d159aSCy Schubert</p>
1736*052d159aSCy Schubert</dd>
1737*052d159aSCy Schubert<dt><code><a name="raw"></a><code>raw</code></code></dt>
1738*052d159aSCy Schubert<dd><p>Display server messages as received and without reformatting.
1739*052d159aSCy Schubert</p>
1740*052d159aSCy Schubert</dd>
1741*052d159aSCy Schubert<dt><code><a name="timeout"></a><code>timeout <kbd>milliseconds</kbd></code></code></dt>
1742*052d159aSCy Schubert<dd><p>Specify a timeout period for responses to server queries.
17432b15cb3dSCy SchubertThe default is about 5000 milliseconds.
17442b15cb3dSCy SchubertNote that since <code>ntpq</code> retries each query once after a timeout
17452b15cb3dSCy Schubertthe total waiting time for a timeout will be twice the timeout value set.
1746*052d159aSCy Schubert</p>
1747*052d159aSCy Schubert</dd>
17482b15cb3dSCy Schubert</dl>
17492b15cb3dSCy Schubert
1750*052d159aSCy Schubert<hr>
1751*052d159aSCy Schubert<a name="Control-Message-Commands"></a>
1752*052d159aSCy Schubert<div class="header">
1753*052d159aSCy Schubert<p>
1754*052d159aSCy 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>
17552b15cb3dSCy Schubert</div>
1756*052d159aSCy Schubert<a name="Control-Message-Commands-2"></a>
1757*052d159aSCy Schubert<h3 class="section">1.4 Control Message Commands</h3>
17582b15cb3dSCy Schubert
17592b15cb3dSCy Schubert<p>Association IDs are used to identify system, peer and clock variables.
17602b15cb3dSCy SchubertSystem variables are assigned an association ID of zero and system name space,
17612b15cb3dSCy Schubertwhile each association is assigned a nonzero association ID and peer namespace.
17622b15cb3dSCy SchubertMost control commands send a single mode-6 message to the server
17632b15cb3dSCy Schubertand expect a single response message.
17642b15cb3dSCy SchubertThe exceptions are the <code>peers</code> command,
17652b15cb3dSCy Schubertwhich sends a series of messages,
17662b15cb3dSCy Schubertand the <code>mreadlist</code> and <code>mreadvar</code> commands,
17672b15cb3dSCy Schubertwhich iterate over a range of associations.
1768*052d159aSCy Schubert</p>
1769*052d159aSCy Schubert<a name="as"></a><dl compact="compact">
1770*052d159aSCy Schubert<dt><code><code>associations</code></code></dt>
1771*052d159aSCy Schubert<dd><p>Display a list of mobilized associations in the form:
17722b15cb3dSCy Schubert<br>
17732b15cb3dSCy Schubert<code>ind assid status conf reach auth condition last_event cnt</code>
1774*052d159aSCy Schubert</p>
1775*052d159aSCy Schubert<table>
1776*052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="40%">Description</th></tr></thead>
1777*052d159aSCy Schubert<tr><td width="10%"><code>ind</code></td><td width="40%">index on this list</td></tr>
1778*052d159aSCy Schubert<tr><td width="10%"><code>assid</code></td><td width="40%">association ID</td></tr>
1779*052d159aSCy Schubert<tr><td width="10%"><code>status</code></td><td width="40%"><a href="decode.html#peer">peer status word</a></td></tr>
1780*052d159aSCy Schubert<tr><td width="10%"><code>conf</code></td><td width="40%"><code>yes</code>: persistent, <code>no</code>: ephemeral</td></tr>
1781*052d159aSCy Schubert<tr><td width="10%"><code>reach</code></td><td width="40%"><code>yes</code>: reachable, <code>no</code>: unreachable</td></tr>
1782*052d159aSCy 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>
1783*052d159aSCy 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>
1784*052d159aSCy 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>
1785*052d159aSCy Schubert<tr><td width="10%"><code>cnt</code>
1786*052d159aSCy Schubertevent count (see the <code>count</code> field of the <a href="decode.html#peer">peer status word</a>)</td></tr>
1787*052d159aSCy Schubert</table>
17882b15cb3dSCy Schubert
1789*052d159aSCy Schubert</dd>
1790*052d159aSCy Schubert<dt><code><a name="cv"></a>clockvar <kbd>assocID</kbd> [<kbd>name</kbd> [ = <kbd>value</kbd> [...]] [...]]</code></dt>
1791*052d159aSCy Schubert<dt><code>cv <kbd>assocID</kbd> [<kbd>name</kbd> [ = <kbd>value</kbd> [...] ][...]]</code></dt>
1792*052d159aSCy Schubert<dd><p>Display a list of &lsquo;clock variables&rsquo; for those associations supporting a reference clock.
1793*052d159aSCy Schubert</p>
1794*052d159aSCy Schubert</dd>
1795*052d159aSCy Schubert<dt><code><a name="g_t_003aconfig"></a>:config [...]</code></dt>
1796*052d159aSCy Schubert<dd><p>Send the remainder of the command line, including whitespace, to the server
17972b15cb3dSCy Schubertas a run-time configuration command in the same format
17982b15cb3dSCy Schubertas the configuration file.
17992b15cb3dSCy SchubertThis command is experimental until further notice and clarification.
18002b15cb3dSCy SchubertAuthentication is of course required.
1801*052d159aSCy Schubert</p>
1802*052d159aSCy Schubert</dd>
1803*052d159aSCy Schubert<dt><code><a name="config_002dfrom_002dfile"></a>config-from-file <kbd>filename</kbd></code></dt>
1804*052d159aSCy Schubert<dd><p>Send the each line of <kbd>filename</kbd> to the server as
18052b15cb3dSCy Schubertrun-time configuration commands in the same format as the configuration file.
18062b15cb3dSCy SchubertThis command is experimental until further notice and clarification.
18072b15cb3dSCy SchubertAuthentication is required.
1808*052d159aSCy Schubert</p>
1809*052d159aSCy Schubert</dd>
1810*052d159aSCy Schubert<dt><code><a name="ifstats"></a>ifstats</code></dt>
1811*052d159aSCy Schubert<dd><p>Display statistics for each local network address.
18122b15cb3dSCy SchubertAuthentication is required.
1813*052d159aSCy Schubert</p>
1814*052d159aSCy Schubert</dd>
1815*052d159aSCy Schubert<dt><code><a name="iostats"></a>iostats</code></dt>
1816*052d159aSCy Schubert<dd><p>Display network and reference clock I/O statistics.
1817*052d159aSCy Schubert</p>
1818*052d159aSCy Schubert</dd>
1819*052d159aSCy Schubert<dt><code><a name="kerninfo"></a>kerninfo</code></dt>
1820*052d159aSCy Schubert<dd><p>Display kernel loop and PPS statistics.
18212b15cb3dSCy SchubertAs with other ntpq output, times are in milliseconds.
18222b15cb3dSCy SchubertThe precision value displayed is in milliseconds as well,
18232b15cb3dSCy Schubertunlike the precision system variable.
1824*052d159aSCy Schubert</p>
1825*052d159aSCy Schubert</dd>
1826*052d159aSCy Schubert<dt><code><a name="lassoc"></a>lassociations</code></dt>
1827*052d159aSCy Schubert<dd><p>Perform the same function as the associations command,
18282b15cb3dSCy Schubertexcept display mobilized and unmobilized associations.
1829*052d159aSCy Schubert</p>
1830*052d159aSCy Schubert</dd>
1831*052d159aSCy Schubert<dt><code><a name="monstats"></a>monstats</code></dt>
1832*052d159aSCy Schubert<dd><p>Display monitor facility statistics.
1833*052d159aSCy Schubert</p>
1834*052d159aSCy Schubert</dd>
1835*052d159aSCy Schubert<dt><code><a name="mrulist"></a>mrulist [limited | kod | mincount=<kbd>count</kbd> | laddr=<kbd>localaddr</kbd> | sort=<kbd>sortorder</kbd> | resany=<kbd>hexmask</kbd> | resall=<kbd>hexmask</kbd>]</code></dt>
1836*052d159aSCy Schubert<dd><p>Obtain and print traffic counts collected and maintained by
18372b15cb3dSCy Schubertthe monitor facility.
1838*052d159aSCy SchubertWith the exception of <code>sort=<kbd>sortorder</kbd></code>,
18392b15cb3dSCy Schubertthe options filter the list returned by <code>ntpd</code>.
18402b15cb3dSCy SchubertThe <code>limited</code> and <code>kod</code> options return only entries
18412b15cb3dSCy Schubertrepresenting client addresses from which the last packet received
18422b15cb3dSCy Schuberttriggered either discarding or a KoD response.
1843*052d159aSCy SchubertThe <code>mincount=<kbd>count</kbd></code> option filters entries representing
1844*052d159aSCy Schubertless than <code><kbd>count</kbd></code> packets.
1845*052d159aSCy SchubertThe <code>laddr=<kbd>localaddr</kbd></code> option filters entries for packets
1846*052d159aSCy Schubertreceived on any local address other than <code><kbd>localaddr</kbd></code>.
1847*052d159aSCy Schubert<code>resany=<kbd>hexmask</kbd></code> and <code>resall=<kbd>hexmask</kbd></code>
18482b15cb3dSCy Schubertfilter entries containing none or less than all, respectively,
1849*052d159aSCy Schubertof the bits in <code><kbd>hexmask</kbd></code>, which must begin with <code>0x</code>.
18502b15cb3dSCy Schubert<br>
1851*052d159aSCy SchubertThe <code><kbd>sortorder</kbd></code> defaults to <code>lstint</code> and may be any of
18522b15cb3dSCy Schubert<code>addr</code>, <code>count</code>, <code>avgint</code>, <code>lstint</code>, or
18532b15cb3dSCy Schubertany of those preceded by a minus sign (hyphen) to reverse the sort order.
18542b15cb3dSCy SchubertThe output columns are:
1855*052d159aSCy Schubert</p>
1856*052d159aSCy Schubert<table>
1857*052d159aSCy Schubert<thead><tr><th width="10%">Column</th><th width="40%">Description</th></tr></thead>
1858*052d159aSCy 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
1859*052d159aSCy Schubertaddress and the completion of the retrieval of the MRU list by <code>ntpq</code></td></tr>
1860*052d159aSCy Schubert<tr><td width="10%"><code>avgint</code></td><td width="40%">Average interval in s between packets from this address.</td></tr>
1861*052d159aSCy Schubert<tr><td width="10%"><code>rstr</code></td><td width="40%">Restriction flags associated with this address.
18622b15cb3dSCy SchubertMost are copied unchanged from the matching <code>restrict</code> command,
18632b15cb3dSCy Schuberthowever 0x400 (kod) and 0x20 (limited) flags are cleared unless
1864*052d159aSCy Schubertthe last packet from this address triggered a rate control response.</td></tr>
1865*052d159aSCy 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
18662b15cb3dSCy Schubertno rate control response, rate limiting by discarding, or
1867*052d159aSCy Schubertrate limiting with a KoD response, respectively.</td></tr>
1868*052d159aSCy Schubert<tr><td width="10%"><code>m</code></td><td width="40%">Packet mode.</td></tr>
1869*052d159aSCy Schubert<tr><td width="10%"><code>v</code></td><td width="40%">Packet version number.</td></tr>
1870*052d159aSCy Schubert<tr><td width="10%"><code>count</code></td><td width="40%">Packets received from this address.</td></tr>
1871*052d159aSCy Schubert<tr><td width="10%"><code>rport</code></td><td width="40%">Source port of last packet from this address.</td></tr>
1872*052d159aSCy 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
1873*052d159aSCy Schubertcould not be verified in parentheses.</td></tr>
1874*052d159aSCy Schubert</table>
18752b15cb3dSCy Schubert
1876*052d159aSCy Schubert</dd>
1877*052d159aSCy Schubert<dt><code><a name="mreadvar"></a><code>mreadvar <kbd>assocID</kbd> <kbd>assocID</kbd> [ <kbd>variable_name</kbd> [ = <kbd>value</kbd>[ ... ]</code></code></dt>
1878*052d159aSCy Schubert<dt><code><a name="mrv"></a><code>mrv <kbd>assocID</kbd> <kbd>assocID</kbd> [ <kbd>variable_name</kbd> [ = <kbd>value</kbd>[ ... ]</code></code></dt>
1879*052d159aSCy Schubert<dd><p>Perform the same function as the <code>readvar</code> command,
18802b15cb3dSCy Schubertexcept for a range of association IDs.
18812b15cb3dSCy SchubertThis range is determined from the association list cached by
18822b15cb3dSCy Schubertthe most recent <code>associations</code> command.
1883*052d159aSCy Schubert</p>
1884*052d159aSCy Schubert</dd>
1885*052d159aSCy Schubert<dt><code><a name="passoc"></a><code>passociations</code></code></dt>
1886*052d159aSCy Schubert<dd><p>Perform the same function as the <code>associations command</code>, except that
18872b15cb3dSCy Schubertit uses previously stored data rather than making a new query.
1888*052d159aSCy Schubert</p>
1889*052d159aSCy Schubert</dd>
1890*052d159aSCy Schubert<dt><code><a name="pe"></a><code>peers</code></code></dt>
1891*052d159aSCy Schubert<dd><p>Display a list of peers in the form:
18922b15cb3dSCy Schubert<br>
18932b15cb3dSCy Schubert<code>[tally]remote refid st t when pool reach delay offset jitter</code>
1894*052d159aSCy Schubert</p>
1895*052d159aSCy Schubert<table>
1896*052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
1897*052d159aSCy Schubert<tr><td width="10%"><code>[tally]</code></td><td width="20%">single-character code indicating current value of the <code>select</code> field
1898*052d159aSCy Schubertof the <a href="decode.html#peer">peer status word</a>.</td></tr>
1899*052d159aSCy Schubert<tr><td width="10%"><code>remote</code></td><td width="20%">host name (or IP number) of peer</td></tr>
1900*052d159aSCy 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>
1901*052d159aSCy Schubert<tr><td width="10%"><code>st</code></td><td width="20%">stratum</td></tr>
1902*052d159aSCy Schubert<tr><td width="10%"><code>t</code></td><td width="20%"><code>u</code>: unicast or manycast client,
19032b15cb3dSCy Schubert<code>b</code>: broadcast or multicast client,
19042b15cb3dSCy Schubert<code>l</code>: local (reference clock),
19052b15cb3dSCy Schubert<code>s</code>: symmetric (peer),
19062b15cb3dSCy Schubert<code>A</code>: manycast server,
19072b15cb3dSCy Schubert<code>B</code>: broadcast server,
1908*052d159aSCy Schubert<code>M</code>: multicast server.</td></tr>
1909*052d159aSCy Schubert<tr><td width="10%"><code>when</code></td><td width="20%">sec/min/hr since last received packet</td></tr>
1910*052d159aSCy Schubert<tr><td width="10%"><code>poll</code></td><td width="20%">poll interval (log(2) s)</td></tr>
1911*052d159aSCy Schubert<tr><td width="10%"><code>reach</code></td><td width="20%">reach shift register (octal)</td></tr>
1912*052d159aSCy Schubert<tr><td width="10%"><code>delay</code></td><td width="20%">roundtrip delay</td></tr>
1913*052d159aSCy Schubert<tr><td width="10%"><code>offset</code></td><td width="20%">offset of server relative to this host</td></tr>
1914*052d159aSCy Schubert<tr><td width="10%"><code>jitter</code></td><td width="20%">jitter</td></tr>
1915*052d159aSCy Schubert</table>
19162b15cb3dSCy Schubert
1917*052d159aSCy Schubert</dd>
1918*052d159aSCy Schubert<dt><code><a name="rv"></a>readvar <kbd>assocID</kbd> <kbd>name</kbd> [ = <kbd>value</kbd> ] [,...]</code></dt>
1919*052d159aSCy Schubert<dt><code>rv <kbd>assocID</kbd> [ <kbd>name</kbd> ] [,...]</code></dt>
1920*052d159aSCy Schubert<dd><p>Display the specified variables.
1921*052d159aSCy SchubertIf <code><kbd>assocID</kbd></code> is zero,
1922*052d159aSCy Schubertthe variables are from the &lsquo;system variables&rsquo; name space,
1923*052d159aSCy Schubertotherwise they are from the &lsquo;peer variables&rsquo; name space.
19242b15cb3dSCy SchubertThe <kbd>assocID</kbd> is required, as the same name can occur in both spaces.
19252b15cb3dSCy SchubertIf no <kbd>name</kbd> is included,
19262b15cb3dSCy Schubertall operative variables in the name space are displayed.
1927*052d159aSCy SchubertIn this case only, if the <code><kbd>assocID</kbd></code> is omitted, it is assumed zero.
19282b15cb3dSCy SchubertMultiple names are specified with comma separators and without whitespace.
19292b15cb3dSCy SchubertNote that time values are represented in milliseconds and
19302b15cb3dSCy Schubertfrequency values in parts-per-million (PPM).
19312b15cb3dSCy SchubertSome NTP timestamps are represented in the format YYYYMMDDTTTT,
19322b15cb3dSCy Schubertwhere YYYY is the year, MM the month of year, DD the day of month and
19332b15cb3dSCy SchubertTTTT the time of day.
1934*052d159aSCy Schubert</p>
1935*052d159aSCy Schubert</dd>
1936*052d159aSCy Schubert<dt><code><a name="saveconfig"></a><code>saveconfig <kbd>filename</kbd></code></code></dt>
1937*052d159aSCy Schubert<dd><p>Write the current configuration, including any runtime modifications
19382b15cb3dSCy Schubertgiven with <code>:config</code> or <code>config-from-file</code>,
1939*052d159aSCy Schubertto the ntpd host&rsquo;s file <kbd>filename</kbd>.
19402b15cb3dSCy SchubertThis command will be rejected by the server unless
19412b15cb3dSCy Schubert<a href="miscopt.html#saveconfigdir">saveconfigdir</a>
19422b15cb3dSCy Schubertappears in the <code>ntpd</code> configuration file.
19432b15cb3dSCy Schubert<kbd>filename</kbd> can use <code>strftime()</code> format specifiers
19442b15cb3dSCy Schubertto substitute the current date and time, for example,
19452b15cb3dSCy Schubert<code>saveconfig ntp-%Y%m%d-%H%M%S.conf</code>.
19462b15cb3dSCy SchubertThe filename used is stored in system variable <code>savedconfig</code>.
19472b15cb3dSCy SchubertAuthentication is required.
1948*052d159aSCy Schubert</p>
1949*052d159aSCy Schubert</dd>
1950*052d159aSCy Schubert<dt><code><a name="writevar"></a>writevar <kbd>assocID</kbd> <kbd>name</kbd> = <kbd>value</kbd> [,...]</code></dt>
1951*052d159aSCy Schubert<dd><p>Write the specified variables.
1952*052d159aSCy SchubertIf the <code><kbd>assocID</kbd></code> is zero, the variables are from the
1953*052d159aSCy Schubert&lsquo;system variables&rsquo; name space, otherwise they are from the
1954*052d159aSCy Schubert&lsquo;peer variables&rsquo; name	space.
1955*052d159aSCy SchubertThe <code><kbd>assocID</kbd></code> is required,
19562b15cb3dSCy Schubertas the same name can occur in both spaces.
1957*052d159aSCy Schubert</p>
1958*052d159aSCy Schubert</dd>
1959*052d159aSCy Schubert<dt><code><a name="sysinfo"></a><code>sysinfo</code></code></dt>
1960*052d159aSCy Schubert<dd><p>Display operational summary.
1961*052d159aSCy Schubert</p>
1962*052d159aSCy Schubert</dd>
1963*052d159aSCy Schubert<dt><code><a name="sysstats"></a><code>sysstats</code></code></dt>
1964*052d159aSCy Schubert<dd><p>Print statistics counters maintained in the protocol module.
1965*052d159aSCy Schubert</p>
1966*052d159aSCy Schubert</dd>
19672b15cb3dSCy Schubert</dl>
19682b15cb3dSCy Schubert
1969*052d159aSCy Schubert<hr>
1970*052d159aSCy Schubert<a name="Status-Words-and-Kiss-Codes"></a>
1971*052d159aSCy Schubert<div class="header">
1972*052d159aSCy Schubert<p>
1973*052d159aSCy 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>
19742b15cb3dSCy Schubert</div>
1975*052d159aSCy Schubert<a name="Status-Words-and-Kiss-Codes-2"></a>
1976*052d159aSCy Schubert<h3 class="section">1.5 Status Words and Kiss Codes</h3>
19772b15cb3dSCy Schubert
19782b15cb3dSCy Schubert<p>The current state of the operating program is shown
19792b15cb3dSCy Schubertin a set of status words maintained by the system
19802b15cb3dSCy Schubertand each association separately.
19812b15cb3dSCy SchubertThese words are displayed in the <code>rv</code> and <code>as</code> commands
19822b15cb3dSCy Schubertboth in hexadecimal and decoded short tip strings.
19832b15cb3dSCy SchubertThe codes, tips and short explanations are on the
19842b15cb3dSCy Schubert<a href="decode.html">Event Messages and Status Words</a> page.
19852b15cb3dSCy SchubertThe page also includes a list of system and peer messages,
19862b15cb3dSCy Schubertthe code for the latest of which is included in the status word.
1987*052d159aSCy Schubert</p>
19882b15cb3dSCy Schubert<p>Information resulting from protocol machine state transitions
19892b15cb3dSCy Schubertis displayed using an informal set of ASCII strings called
19902b15cb3dSCy Schubert<a href="decode.html#kiss">kiss codes</a>.
1991*052d159aSCy SchubertThe original purpose was for kiss-o&rsquo;-death (KoD) packets sent
19922b15cb3dSCy Schubertby the server to advise the client of an unusual condition.
19932b15cb3dSCy SchubertThey are now displayed, when appropriate,
19942b15cb3dSCy Schubertin the reference identifier field in various billboards.
1995*052d159aSCy Schubert</p>
1996*052d159aSCy Schubert<hr>
1997*052d159aSCy Schubert<a name="System-Variables"></a>
1998*052d159aSCy Schubert<div class="header">
1999*052d159aSCy Schubert<p>
2000*052d159aSCy 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>
20012b15cb3dSCy Schubert</div>
2002*052d159aSCy Schubert<a name="System-Variables-2"></a>
2003*052d159aSCy Schubert<h3 class="section">1.6 System Variables</h3>
20042b15cb3dSCy Schubert
20052b15cb3dSCy Schubert<p>The following system variables appear in the <code>rv</code> billboard.
20062b15cb3dSCy SchubertNot all variables are displayed in some configurations.
2007*052d159aSCy Schubert</p>
2008*052d159aSCy Schubert<table>
2009*052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2010*052d159aSCy Schubert<tr><td width="10%"><code>status</code></td><td width="20%"><a href="decode.html#sys">system status word</a></td></tr>
2011*052d159aSCy Schubert<tr><td width="10%"><code>version</code></td><td width="20%">NTP software version and build time</td></tr>
2012*052d159aSCy Schubert<tr><td width="10%"><code>processor</code></td><td width="20%">hardware platform and version</td></tr>
2013*052d159aSCy Schubert<tr><td width="10%"><code>system</code></td><td width="20%">operating system and version</td></tr>
2014*052d159aSCy Schubert<tr><td width="10%"><code>leap</code></td><td width="20%">leap warning indicator (0-3)</td></tr>
2015*052d159aSCy Schubert<tr><td width="10%"><code>stratum</code></td><td width="20%">stratum (1-15)</td></tr>
2016*052d159aSCy Schubert<tr><td width="10%"><code>precision</code></td><td width="20%">precision (log(2) s)</td></tr>
2017*052d159aSCy Schubert<tr><td width="10%"><code>rootdelay</code></td><td width="20%">total roundtrip delay to the primary reference clock</td></tr>
2018*052d159aSCy Schubert<tr><td width="10%"><code>rootdisp</code></td><td width="20%">total dispersion to the primary reference clock</td></tr>
2019*052d159aSCy Schubert<tr><td width="10%"><code>peer</code></td><td width="20%">system peer association ID</td></tr>
2020*052d159aSCy Schubert<tr><td width="10%"><code>tc</code>
2021*052d159aSCy Schuberttime constant and poll exponent (log(2) s) (3-17)</td></tr>
2022*052d159aSCy Schubert<tr><td width="10%"><code>mintc</code>
2023*052d159aSCy Schubertminimum time constant (log(2) s) (3-10)</td></tr>
2024*052d159aSCy Schubert<tr><td width="10%"><code>clock</code></td><td width="20%">date and time of day</td></tr>
2025*052d159aSCy Schubert<tr><td width="10%"><code>refid</code>
2026*052d159aSCy Schubertreference ID or <a href="decode.html#kiss">kiss code</a></td></tr>
2027*052d159aSCy Schubert<tr><td width="10%"><code>reftime</code></td><td width="20%">reference time</td></tr>
2028*052d159aSCy Schubert<tr><td width="10%"><code>offset</code></td><td width="20%">combined offset of server relative to this host</td></tr>
2029*052d159aSCy Schubert<tr><td width="10%"><code>sys_jitter</code></td><td width="20%">combined system jitter</td></tr>
2030*052d159aSCy Schubert<tr><td width="10%"><code>frequency</code></td><td width="20%">frequency offset (PPM) relative to hardware clock</td></tr>
2031*052d159aSCy Schubert<tr><td width="10%"><code>clk_wander</code></td><td width="20%">clock frequency wander (PPM)</td></tr>
2032*052d159aSCy Schubert<tr><td width="10%"><code>clk_jitter</code></td><td width="20%">clock jitter</td></tr>
2033*052d159aSCy Schubert<tr><td width="10%"><code>tai</code></td><td width="20%">TAI-UTC offset (s)</td></tr>
2034*052d159aSCy Schubert<tr><td width="10%"><code>leapsec</code></td><td width="20%">NTP seconds when the next leap second is/was inserted</td></tr>
2035*052d159aSCy Schubert<tr><td width="10%"><code>expire</code></td><td width="20%">NTP seconds when the NIST leapseconds file expires</td></tr>
2036*052d159aSCy Schubert</table>
20372b15cb3dSCy Schubert
20382b15cb3dSCy Schubert<p>The jitter and wander statistics are exponentially-weighted RMS averages.
20392b15cb3dSCy SchubertThe system jitter is defined in the NTPv4 specification;
20402b15cb3dSCy Schubertthe clock jitter statistic is computed by the clock discipline module.
2041*052d159aSCy Schubert</p>
20422b15cb3dSCy Schubert<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
20432b15cb3dSCy Schubertadditional system variables are displayed, including some or all of the
20442b15cb3dSCy Schubertfollowing, depending on the particular Autokey dance:
2045*052d159aSCy Schubert</p>
2046*052d159aSCy Schubert<table>
2047*052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2048*052d159aSCy Schubert<tr><td width="10%"><code>host</code></td><td width="20%">Autokey host name for this host</td></tr>
2049*052d159aSCy Schubert<tr><td width="10%"><code>ident</code></td><td width="20%">Autokey group name for this host</td></tr>
2050*052d159aSCy Schubert<tr><td width="10%"><code>flags</code></td><td width="20%">host flags  (see Autokey specification)</td></tr>
2051*052d159aSCy Schubert<tr><td width="10%"><code>digest</code></td><td width="20%">OpenSSL message digest algorithm</td></tr>
2052*052d159aSCy Schubert<tr><td width="10%"><code>signature</code></td><td width="20%">OpenSSL digest/signature scheme</td></tr>
2053*052d159aSCy Schubert<tr><td width="10%"><code>update</code></td><td width="20%">NTP seconds at last signature update</td></tr>
2054*052d159aSCy Schubert<tr><td width="10%"><code>cert</code></td><td width="20%">certificate subject, issuer and certificate flags</td></tr>
2055*052d159aSCy Schubert<tr><td width="10%"><code>until</code></td><td width="20%">NTP seconds when the certificate expires</td></tr>
2056*052d159aSCy Schubert</table>
20572b15cb3dSCy Schubert
2058*052d159aSCy Schubert<hr>
2059*052d159aSCy Schubert<a name="Peer-Variables"></a>
2060*052d159aSCy Schubert<div class="header">
2061*052d159aSCy Schubert<p>
2062*052d159aSCy 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>
20632b15cb3dSCy Schubert</div>
2064*052d159aSCy Schubert<a name="Peer-Variables-2"></a>
2065*052d159aSCy Schubert<h3 class="section">1.7 Peer Variables</h3>
20662b15cb3dSCy Schubert
20672b15cb3dSCy Schubert<p>The following peer variables appear in the <code>rv</code> billboard
20682b15cb3dSCy Schubertfor each association.
20692b15cb3dSCy SchubertNot all variables are displayed in some configurations.
2070*052d159aSCy Schubert</p>
2071*052d159aSCy Schubert<table>
2072*052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2073*052d159aSCy Schubert<tr><td width="10%"><code>associd</code></td><td width="20%">association ID</td></tr>
2074*052d159aSCy Schubert<tr><td width="10%"><code>status</code></td><td width="20%"><a href="decode.html#peer">peer status word</a></td></tr>
2075*052d159aSCy Schubert<tr><td width="10%"><code>srcadr</code>
2076*052d159aSCy Schubert<p><code>srcport</code>
2077*052d159aSCy Schubert</p></td><td width="20%">source (remote) IP address and port</td></tr>
2078*052d159aSCy Schubert<tr><td width="10%"><code>dstadr</code>
2079*052d159aSCy Schubert<p><code>dstport</code>
2080*052d159aSCy Schubert</p></td><td width="20%">destination (local) IP address and port</td></tr>
2081*052d159aSCy Schubert<tr><td width="10%"><code>leap</code></td><td width="20%">leap indicator (0-3)</td></tr>
2082*052d159aSCy Schubert<tr><td width="10%"><code>stratum</code></td><td width="20%">stratum (0-15)</td></tr>
2083*052d159aSCy Schubert<tr><td width="10%"><code>precision</code></td><td width="20%">precision (log(2) s)</td></tr>
2084*052d159aSCy Schubert<tr><td width="10%"><code>rootdelay</code></td><td width="20%">total roundtrip delay to the primary reference clock</td></tr>
2085*052d159aSCy Schubert<tr><td width="10%"><code>rootdisp</code></td><td width="20%">total root dispersion to the primary reference clock</td></tr>
2086*052d159aSCy 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>
2087*052d159aSCy Schubert<tr><td width="10%"><code>reftime</code></td><td width="20%">reference time</td></tr>
2088*052d159aSCy Schubert<tr><td width="10%"><code>reach</code></td><td width="20%">reach register (octal)</td></tr>
2089*052d159aSCy Schubert<tr><td width="10%"><code>unreach</code></td><td width="20%">unreach counter</td></tr>
2090*052d159aSCy Schubert<tr><td width="10%"><code>hmode</code></td><td width="20%">host mode (1-6)</td></tr>
2091*052d159aSCy Schubert<tr><td width="10%"><code>pmode</code></td><td width="20%">peer mode (1-5)</td></tr>
2092*052d159aSCy Schubert<tr><td width="10%"><code>hpoll</code></td><td width="20%">host poll exponent (log(2) s) (3-17)</td></tr>
2093*052d159aSCy Schubert<tr><td width="10%"><code>ppoll</code></td><td width="20%">peer poll exponent (log(2) s) (3-17)</td></tr>
2094*052d159aSCy 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>
2095*052d159aSCy Schubert<tr><td width="10%"><code>flash</code></td><td width="20%"><a href="decode.html#flash">flash status word</a></td></tr>
2096*052d159aSCy Schubert<tr><td width="10%"><code>offset</code></td><td width="20%">filter offset</td></tr>
2097*052d159aSCy Schubert<tr><td width="10%"><code>delay</code></td><td width="20%">filter delay</td></tr>
2098*052d159aSCy Schubert<tr><td width="10%"><code>dispersion</code></td><td width="20%">filter dispersion</td></tr>
2099*052d159aSCy Schubert<tr><td width="10%"><code>jitter</code></td><td width="20%">filter jitter</td></tr>
2100*052d159aSCy Schubert<tr><td width="10%"><code>ident</code></td><td width="20%">Autokey group name for this association</td></tr>
2101*052d159aSCy Schubert<tr><td width="10%"><code>bias</code></td><td width="20%">unicast/broadcast bias</td></tr>
2102*052d159aSCy 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>
2103*052d159aSCy Schubert</table>
21042b15cb3dSCy Schubert
21052b15cb3dSCy Schubert<p>The bias variable is calculated when the first broadcast packet is received
21062b15cb3dSCy Schubertafter the calibration volley.  It represents the offset of the broadcast
21072b15cb3dSCy Schubertsubgraph relative to the unicast subgraph.  The xleave variable appears
21082b15cb3dSCy Schubertonly the interleaved symmetric and interleaved modes.  It represents
21092b15cb3dSCy Schubertthe internal queuing, buffering and transmission delays for the preceding
21102b15cb3dSCy Schubertpacket.
2111*052d159aSCy Schubert</p>
21122b15cb3dSCy Schubert<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
21132b15cb3dSCy Schubertadditional peer variables are displayed, including the following:
2114*052d159aSCy Schubert</p>
2115*052d159aSCy Schubert<table>
2116*052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2117*052d159aSCy Schubert<tr><td width="10%"><code>flags</code></td><td width="20%">peer flags (see Autokey specification)</td></tr>
2118*052d159aSCy Schubert<tr><td width="10%"><code>host</code></td><td width="20%">Autokey server name</td></tr>
2119*052d159aSCy Schubert<tr><td width="10%"><code>flags</code></td><td width="20%">peer flags (see Autokey specification)</td></tr>
2120*052d159aSCy Schubert<tr><td width="10%"><code>signature</code></td><td width="20%">OpenSSL digest/signature scheme</td></tr>
2121*052d159aSCy Schubert<tr><td width="10%"><code>initsequence</code></td><td width="20%">initial key ID</td></tr>
2122*052d159aSCy Schubert<tr><td width="10%"><code>initkey</code></td><td width="20%">initial key index</td></tr>
2123*052d159aSCy Schubert<tr><td width="10%"><code>timestamp</code></td><td width="20%">Autokey signature timestamp</td></tr>
2124*052d159aSCy Schubert</table>
21252b15cb3dSCy Schubert
2126*052d159aSCy Schubert<hr>
2127*052d159aSCy Schubert<a name="Clock-Variables"></a>
2128*052d159aSCy Schubert<div class="header">
2129*052d159aSCy Schubert<p>
2130*052d159aSCy SchubertPrevious: <a href="#Peer-Variables" accesskey="p" rel="prev">Peer Variables</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
21312b15cb3dSCy Schubert</div>
2132*052d159aSCy Schubert<a name="Clock-Variables-2"></a>
2133*052d159aSCy Schubert<h3 class="section">1.8 Clock Variables</h3>
21342b15cb3dSCy Schubert
21352b15cb3dSCy 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.
2136*052d159aSCy Schubert</p>
2137*052d159aSCy Schubert<table>
2138*052d159aSCy Schubert<thead><tr><th width="10%">Variable</th><th width="20%">Description</th></tr></thead>
2139*052d159aSCy Schubert<tr><td width="10%"><code>associd</code></td><td width="20%">association ID</td></tr>
2140*052d159aSCy Schubert<tr><td width="10%"><code>status</code></td><td width="20%"><a href="decode.html#clock">clock status word</a></td></tr>
2141*052d159aSCy Schubert<tr><td width="10%"><code>device</code></td><td width="20%">device description</td></tr>
2142*052d159aSCy Schubert<tr><td width="10%"><code>timecode</code></td><td width="20%">ASCII time code string (specific to device)</td></tr>
2143*052d159aSCy Schubert<tr><td width="10%"><code>poll</code></td><td width="20%">poll messages sent</td></tr>
2144*052d159aSCy Schubert<tr><td width="10%"><code>noreply</code></td><td width="20%">no reply</td></tr>
2145*052d159aSCy Schubert<tr><td width="10%"><code>badformat</code></td><td width="20%">bad format</td></tr>
2146*052d159aSCy Schubert<tr><td width="10%"><code>baddata</code></td><td width="20%">bad date or time</td></tr>
2147*052d159aSCy Schubert<tr><td width="10%"><code>fudgetime1</code></td><td width="20%">fudge time 1</td></tr>
2148*052d159aSCy Schubert<tr><td width="10%"><code>fudgetime2</code></td><td width="20%">fudge time 2</td></tr>
2149*052d159aSCy Schubert<tr><td width="10%"><code>stratum</code></td><td width="20%">driver stratum</td></tr>
2150*052d159aSCy Schubert<tr><td width="10%"><code>refid</code></td><td width="20%">driver reference ID</td></tr>
2151*052d159aSCy Schubert<tr><td width="10%"><code>flags</code></td><td width="20%">driver flags</td></tr>
2152*052d159aSCy Schubert</table>
2153*052d159aSCy Schubert<hr>
21542b15cb3dSCy Schubert
21552b15cb3dSCy Schubert
21562b15cb3dSCy Schubert
2157*052d159aSCy Schubert</body>
2158*052d159aSCy Schubert</html>
2159