</head>
<body>
- <h3><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</h3>
+ <h3><tt>ntpd</tt> - Network Time Protocol (NTP) Daemon</h3>
<img src="pic/wingdorothy.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>The Wizard of Oz</i>, L. Frank Baum</a>
<p>You need help from the monkeys.</p>
- <p>Last update: <!-- #BeginDate format:En1m -->18-jun-09 19:45<!-- #EndDate --></p>
+ <p>Last update: <!-- #BeginDate format:En1m -->14-oct-09 22:23<!-- #EndDate --></p>
<br clear="left">
<h4>Related Links</h4>
<script type="text/javascript" language="javascript" src="scripts/command.txt"></script>
<li class="inline"><a href="#notes">Additional Features</a></li>
<li class="inline"><a href="#cmd">Command Line Options</a></li>
<li class="inline"><a href="#cfg">The Configuration File</a></li>
- <li class="inline"><a href="#files">Files</a>
+ <li class="inline"><a href="#files">Files</a></li>
</ul>
<hr>
<h4 id="synop">Synopsis</h4>
<p>The <tt>ntpd</tt> program normally operates continuously while adjusting the time and frequency, but in some cases it may not be practical to run it continuously. With the <tt>-q</tt> option <tt>ntpd</tt> operates as in continous mode, but exits just after setting the clock for the first time. Most applications will probably want to specify the <tt>iburst</tt> option with the <tt>server</tt> command. With this option a volley of messages is exchanged to groom the data and set the clock in about 10 s. If nothing is heard after a few minutes, the daemon times out and exits.</p>
<h4 id="poll">Poll Interval Control</h4>
<p>NTP uses an intricate heuristic algorithm to automatically control the poll interval for maximum accuracy consistent with minimum network overhead. The algorithm measures the incidental offset and jitter to determine the best poll interval. When <tt>ntpd</tt> starts, the interval is the default minimum 64 s. Under normal conditions when the clock discipline has stabilized, the interval increases in steps to the default maximum 1024 s. In addition, should a server become unreachable after some time, the interval increases in steps to the maximum in order to reduce network overhead.</p>
- <p>The default poll interval range is suitable for most conditions, but can be changed using options on the <a href="confopt.html">Server Options</a> and <a href="miscopt.html">Miscellaneous Options</a> pages. However, when using maximum intervals much larger than the default, the residual clock frequency error must be small enough for the discipline loop to capture and correct. The capture range is 500 PPM with a 64-s interval decreasing by a factor of two for each interval doubling. At a 36-hr interval, for example, the capture range is only 0.24 PPM.</p>
+ <p>The default poll interval range is suitable for most conditions, but can be changed using options on the <a href="confopt.html">Server Options</a> and <a href="miscopt.html">Miscellaneous Options</a> pages. However, when using maximum intervals much larger than the default, the residual clock frequency error must be small enough for the discipline loop to capture and correct. The capture range is 500 PPM with a 64-s interval decreasing by a factor of two for each interval doubling. At a 36-hr interval, for example, the capture range is only 0.24 PPM.</p>
<h4 id="huff">The huff-n'-puff Filter</h4>
<p>In scenarios where a considerable amount of data are to be downloaded or uploaded over telephone modems, timekeeping quality can be seriously degraded. This occurs because the differential delays on the two directions of transmission can be quite large. In many cases the apparent time errors are so large as to exceed the step threshold and a step correction can occur during and after the data transfer.</p>
<p>The huff-n'-puff filter is designed to correct the apparent time offset in these cases. It depends on knowledge of the propagation delay when no other traffic is present, such as during other than work hours. The filter remembers the minimum delay over the most recent interval measured usually in hours. Under conditions of severe delay, the filter corrects the apparent offset using the sign of the offset and the difference between the apparent delay and minimum delay. The name of the filter reflects the negative (huff) and positive (puff) correction, which depends on the sign of the offset. The filter is activated by the <tt>tinker huffpuff</tt> command, as described in the <a href="miscopt.html">Miscellaneous Options</a> page.</p>
<p>When <tt>ntpd</tt> starts it looks at the value of <tt>umask</tt>, and if zero <tt>ntpd</tt> will set the <tt>umask</tt> to <tt>022</tt>.</p>
<h4 id="cmd">Command Line Options</h4>
<dl>
- <dt><tt>-a</tt>
- <dd>Require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the same operation as the <tt>enable auth</tt> command and is the default.<dt><tt>-A</tt>
- <dd>Do not require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the same operation as the <tt>disable auth</tt> command and almost never a good idea.<dt><tt>-b</tt>
- <dd>Enable the client to synchronize to broadcast servers.
- <dt><tt>-c <i>conffile</i></tt>
- <dd>Specify the name and path of the configuration file, default <tt>/etc/ntp.conf</tt>.
- <dt><tt>-d</tt>
- <dd>Specify debugging mode. This option may occur more than once, with each occurrence indicating greater detail of display.
- <dt><tt>-D <i>level</i></tt>
- <dd>Specify debugging level directly.
- <dt><tt>-f <i>driftfile</i></tt>
- <dd>Specify the name and path of the frequency file, default <tt>/etc/ntp.drift</tt>. This is the same operation as the <tt>driftfile <i>driftfile</i></tt> command.<dt><tt>-g</tt>
- <dd>Normally, <tt>ntpd</tt> exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, <tt>ntpd</tt> will exit with a message to the system log. This option can be used with the <tt>-q</tt> and <tt>-x</tt> options. See the <tt>tinker</tt> command for other options.
- <dt><tt>-i <i>jaildir</i></tt>
- <dd>Chroot the server to the directory <i><tt>jaildir</tt></i>. This option also implies that the server attempts to drop root privileges at startup (otherwise, chroot gives very little additional security), and it is only available if the OS supports to run the server without full root privileges. You may need to also specify a <tt>-u</tt> option.
- <dt id="--interface"><tt>-I [<i>address</i> | <i>interface name</i>]</tt>
- <dd>Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file <a href="miscopt.html#interface">interface</a> command, which is more versatile.
- <dt><tt>-k <i>keyfile</i></tt>
- <dd>Specify the name and path of the symmetric key file, default <tt>/etc/ntp.keys</tt>. This is the same operation as the <tt>keys <i>keyfile</i></tt> command.
- <dt><tt>-l <i>logfile</i></tt>
- <dd>Specify the name and path of the log file. The default is the system log file. This is the same operation as the <tt>logfile <i>logfile</i></tt> command.
- <dt id="--novirtualips"><tt>-L</tt>
- <dd>Do not listen to virtual interfaces, defined as those with names containing a colon. This option is deprecated. Please consider using the configuration file <a href="miscopt.html#interface">interface</a> command, which is more versatile.
- <dt><tt>-M</tt>
- <dd>Raise scheduler precision to its maximum (1 msec) using timeBeginPeriod. (Windows only)
- <dt><tt>-n</tt>
- <dd>Don't fork.
- <dt><tt>-N</tt>
- <dd>To the extent permitted by the operating system, run the <tt>ntpd</tt> at the highest priority.
- <dt><tt>-p <i>pidfile</i></tt>
- <dd>Specify the name and path of the file used to record the <tt>ntpd</tt> process ID. This is the same operation as the <tt>pidfile <i>pidfile</i></tt> command.<dt><tt>-P <i>priority</i></tt>
- <dd>To the extent permitted by the operating system, run the <tt>ntpd</tt> at the specified priority.
- <dt><tt>-q</tt>
- <dd>Exit the <tt>ntpd</tt> just after the first time the clock is set. This behavior mimics that of the <tt>ntpdate</tt> program, which is to be retired. The <tt>-g</tt> and <tt>-x</tt> options can be used with this option. Note: The kernel time discipline is disabled with this option.
- <dt><tt>-r <i>broadcastdelay</i></tt>
- <dd>Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
- <dt><tt>-s <i>statsdir</i></tt>
- <dd>Specify the directory path for files created by the statistics facility. This is the same operation as the <tt>statsdir <i>statsdir</i></tt> command.<dt><tt>-t <i>key</i></tt>
- <dd>Add a key number to the trusted key list. This option can occur more than once. This is the same operation as the <tt>trustedkey <i>key</i></tt> command. <dt><tt>-u <i>user[:group]</i> </tt>
- <dd>Specify a user, and optionally a group, to switch to. This option is only available if the OS supports running the server without full root privileges. Currently, this option is supported under NetBSD (configure with <tt>--enable-clockctl</tt>) and Linux (configure with --<tt>enable-linuxcaps</tt>).<dt><tt>-U <i>interface update interval</i></tt>
+ <dt><tt>-a</tt></dt>
+ <dd>Require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the same operation as the <tt>enable auth</tt> command and is the default.</dd>
+ <dt><tt>-A</tt></dt>
+ <dd>Do not require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the same operation as the <tt>disable auth</tt> command and almost never a good idea.</dd>
+ <dt><tt>-b</tt></dt>
+ <dd>Enable the client to synchronize to broadcast servers.</dd>
+ <dt><tt>-c <i>conffile</i></tt></dt>
+ <dd>Specify the name and path of the configuration file, default <tt>/etc/ntp.conf</tt>.</dd>
+ <dt><tt>-d</tt></dt>
+ <dd>Specify debugging mode. This option may occur more than once, with each occurrence indicating greater detail of display.</dd>
+ <dt><tt>-D <i>level</i></tt></dt>
+ <dd>Specify debugging level directly.</dd>
+ <dt><tt>-f <i>driftfile</i></tt></dt>
+ <dd>Specify the name and path of the frequency file, default <tt>/etc/ntp.drift</tt>. This is the same operation as the <tt>driftfile <i>driftfile</i></tt> command.</dd>
+ <dt><tt>-g</tt></dt>
+ <dd>Normally, <tt>ntpd</tt> exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, <tt>ntpd</tt> will exit with a message to the system log. This option can be used with the <tt>-q</tt> and <tt>-x</tt> options. See the <tt>tinker</tt> command for other options.</dd>
+ <dt><tt>-i <i>jaildir</i></tt></dt>
+ <dd>Chroot the server to the directory <i><tt>jaildir</tt></i>. This option also implies that the server attempts to drop root privileges at startup (otherwise, chroot gives very little additional security), and it is only available if the OS supports to run the server without full root privileges. You may need to also specify a <tt>-u</tt> option.</dd>
+ <dt id="--interface"><tt>-I [<i>address</i> | <i>interface name</i>]</tt></dt>
+ <dd>Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file <a href="miscopt.html#interface">interface</a> command, which is more versatile.</dd>
+ <dt><tt>-k <i>keyfile</i></tt></dt>
+ <dd>Specify the name and path of the symmetric key file, default <tt>/etc/ntp.keys</tt>. This is the same operation as the <tt>keys <i>keyfile</i></tt> command.</dd>
+ <dt><tt>-l <i>logfile</i></tt></dt>
+ <dd>Specify the name and path of the log file. The default is the system log file. This is the same operation as the <tt>logfile <i>logfile</i></tt> command.</dd>
+ <dt id="--novirtualips"><tt>-L</tt></dt>
+ <dd>Do not listen to virtual interfaces, defined as those with names containing a colon. This option is deprecated. Please consider using the configuration file <a href="miscopt.html#interface">interface</a> command, which is more versatile.</dd>
+ <dt><tt>-M</tt></dt>
+ <dd>Raise scheduler precision to its maximum (1 msec) using timeBeginPeriod. (Windows only)</dd>
+ <dt><tt>-n</tt></dt>
+ <dd>Don't fork.</dd>
+ <dt><tt>-N</tt></dt>
+ <dd>To the extent permitted by the operating system, run the <tt>ntpd</tt> at the highest priority.</dd>
+ <dt><tt>-p <i>pidfile</i></tt></dt>
+ <dd>Specify the name and path of the file used to record the <tt>ntpd</tt> process ID. This is the same operation as the <tt>pidfile <i>pidfile</i></tt> command.</dd>
+ <dt><tt>-P <i>priority</i></tt></dt>
+ <dd>To the extent permitted by the operating system, run the <tt>ntpd</tt> at the specified priority.</dd>
+ <dt><tt>-q</tt></dt>
+ <dd>Exit the <tt>ntpd</tt> just after the first time the clock is set. This behavior mimics that of the <tt>ntpdate</tt> program, which is to be retired. The <tt>-g</tt> and <tt>-x</tt> options can be used with this option. Note: The kernel time discipline is disabled with this option.</dd>
+ <dt><tt>-r <i>broadcastdelay</i></tt></dt>
+ <dd>Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.</dd>
+ <dt><tt>-s <i>statsdir</i></tt></dt>
+ <dd>Specify the directory path for files created by the statistics facility. This is the same operation as the <tt>statsdir <i>statsdir</i></tt> command.</dd>
+ <dt><tt>-t <i>key</i></tt></dt>
+ <dd>Add a key number to the trusted key list. This option can occur more than once. This is the same operation as the <tt>trustedkey <i>key</i></tt> command.</dd>
+ <dt><tt>-u <i>user[:group]</i> </tt></dt>
+ <dd>Specify a user, and optionally a group, to switch to. This option is only available if the OS supports running the server without full root privileges. Currently, this option is supported under NetBSD (configure with <tt>--enable-clockctl</tt>) and Linux (configure with --<tt>enable-linuxcaps</tt>).</dd>
+ <dt><tt>-U <i>interface update interval</i></tt></dt>
<dd>Number of seconds to wait between interface list scans to pick up new and delete network interface. Set to 0 to disable dynamic interface list updating. The default is to scan every 5 minutes.</dd>
- <dt><tt>-v <i>variable</i></tt>
- <dt><tt>-V <i>variable</i></tt>
- <dd>Add a system variable listed by default.
- <dt><tt>-x</tt>
- <dd>Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold. This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s. Thus, an adjustment as much as 600 s will take almost 14 days to complete. This option can be used with the <tt>-g</tt> and <tt>-q</tt> options. See the <tt>tinker</tt> command for other options. Note: The kernel time discipline is disabled with this option.
- <dt><tt>--pccfreq <i>frequency</i></tt>
- <dd>Substitute processor cycle counter for QueryPerformanceCounter unconditionally using the given frequency (in Hz). <tt>--pccfreq</tt> can be used on systems which do not use the PCC to implement QueryPerformanceCounter and have a fixed PCC frequency. The frequency specified must be accurate within 0.5 percent. <tt>--usepcc</tt> is equivalent on many systems and should be tried first, as it does not require determining the frequency of the processor cycle counter. For x86-compatible processors, the PCC is also referred to as <tt>RDTSC</tt>, which is the assembly-language instruction to retrieve the current value. (Windows only)
- <dt><tt>--usepcc</tt>
- <dd>Substitute processor cycle counter for QueryPerformanceCounter if they appear equivalent. This option should be used only if the PCC frequency is fixed. Power-saving functionality on many laptops varies the PCC frequency. (Windows only)
- </dl>
+ <dt><tt>-v <i>variable</i></tt></dt>
+ <dt><tt>-V <i>variable</i></tt></dt>
+ <dd>Add a system variable listed by default.</dd>
+ <dt><tt>-x</tt></dt>
+ <dd>Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold. This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s. Thus, an adjustment as much as 600 s will take almost 14 days to complete. This option can be used with the <tt>-g</tt> and <tt>-q</tt> options. See the <tt>tinker</tt> command for other options. Note: The kernel time discipline is disabled with this option.</dd>
+ <dt><tt>--pccfreq <i>frequency</i></tt></dt>
+ <dd>Substitute processor cycle counter for QueryPerformanceCounter unconditionally
+ using the given frequency (in Hz). <tt>--pccfreq</tt> can be used on systems
+ which do not use the PCC to implement QueryPerformanceCounter
+ and have a fixed PCC frequency. The frequency specified must
+ be accurate within 0.5 percent. <tt>--usepcc</tt> is equivalent on many systems and should
+ be tried first, as it does not require determining the frequency
+ of the processor cycle counter. For x86-compatible processors, the PCC is
+ also referred to as <tt>RDTSC</tt>, which is the assembly-language instruction to retrieve
+ the current value. (Windows only)</dd>
+ <dt><tt>--usepcc</tt></dt>
+ <dd>Substitute processor cycle counter for QueryPerformanceCounter if they
+ appear equivalent. This option should be used only if the PCC
+ frequency is fixed. Power-saving functionality on many laptops varies the
+ PCC frequency. (Windows only)</dd>
+ </dl>
<h4 id="cfg">The Configuration File</h4>
<p>Ordinarily, <tt>ntpd</tt> reads the <tt>ntp.conf</tt> configuration file at startup in order to determine the synchronization sources and operating modes. It is also possible to specify a working, although limited, configuration entirely on the command line, obviating the need for a configuration file. This may be particularly useful when the local host is to be configured as a broadcast client, with servers determined by listening to broadcasts at run time.</p>
<p>Usually, the configuration file is installed as<tt>/etc/ntp.conf</tt>, but could be installed elsewhere (see the <tt>-c <i>conffile</i></tt> command line option). The file format is similar to other Unix configuration files - comments begin with a <tt>#</tt> character and extend to the end of the line; blank lines are ignored.</p>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>ntpq - standard NTP query program</title>
<link href="scripts/style.css" type="text/css" rel="stylesheet">
- </head>
+</head>
<body>
<h3><tt>ntpq</tt> - standard NTP query program</h3>
<img src="pic/bustardfly.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
<p>A typical NTP monitoring packet</p>
- <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61"></csobj><csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="223">July 5, 2008</csobj></p>
- <br clear="left">
+ <p>Last update:
+ <!-- #BeginDate format:En2m -->15-Oct-2009 1:09<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
<h4>More Help</h4>
<script type="text/javascript" language="javascript" src="scripts/manual.txt"></script>
<hr>
<h4>Synopsis</h4>
<tt>ntpq [-inp] [-c <i>command</i>] [<i>host</i>] [...]</tt>
<h4>Description</h4>
- <p>The <tt>ntpq</tt> utility program is used to monitor NTP daemon <tt>ntpd</tt> operations and determine performance. It uses the standard NTP mode 6 control message formats defined in Appendix B of the NTPv3 specification RFC1305. The same formats are used in NTPv4, although some of the variables have changed and new ones added. The description on this page is for the NTPv4 variables.</p>
+ <p>The <tt>ntpq</tt> utility program is used to monitor NTP daemon <tt>ntpd</tt> operations
+ and determine performance. It uses the standard NTP mode 6 control
+ message formats defined in Appendix B of the NTPv3 specification
+ RFC1305. The same formats are used in NTPv4, although some of the
+ variable names have changed and new ones added. The description
+ on this page is for the NTPv4 variables.</p>
<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 <tt>ntpq</tt> can also obtain and print a list of peers in a common format by sending multiple queries to the server.</p>
<p>If one or more request options is included on the command line when <tt>ntpq</tt> 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, <tt>ntpq</tt> 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. <tt>ntpq</tt> will prompt for commands if the standard input is a terminal device.</p>
<p><tt>ntpq</tt> 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. <tt>ntpq</tt> makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.</p>
<p>For examples and usage, see the <a href="debug.html">NTP Debugging Techniques</a> page.</p>
<p>Command line options are described following. Specifying a command line option other than <tt>-i</tt> or <tt>-n</tt> will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, <tt>ntpq</tt> will attempt to read interactive format commands from the standard input.</p>
<dl>
- <dt><tt>-4</tt>
- <dd>Force DNS resolution of following host names on the command line to the IPv4 namespace.
- <dt><tt>-6</tt>
- <dd>Force DNS resolution of following host names on the command line to the IPv6 namespace.
- <dt><tt>-c</tt>
- <dd>The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). Multiple <tt>-c</tt> options may be given.
- <dt><tt>-d</tt>
- <dd>Turn on debugging mode.
- <dt><tt>-i</tt>
- <dd>Force <tt>ntpq</tt> to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input.
- <dt><tt>-n</tt>
- <dd>Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names.
- <dt><tt>-p</tt>
- <dd>Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the <tt>peers</tt> interactive command.
- <dt><tt>--old-rv</tt>
- <dd>When querying a single variable, such as <tt>ntpq -c 'rv 0 version'</tt>, precede the requested variable with a status line.
+ <dt><tt>-4</tt></dt>
+ <dd>Force DNS resolution of following host names on the command line to the IPv4 namespace.</dd>
+ <dt><tt>-6</tt></dt>
+ <dd>Force DNS resolution of following host names on the command line to the IPv6 namespace.</dd>
+ <dt><tt>-c</tt></dt>
+ <dd>The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). Multiple <tt>-c</tt> options may be given.</dd>
+ <dt><tt>-d</tt></dt>
+ <dd>Turn on debugging mode.</dd>
+ <dt><tt>-i</tt></dt>
+ <dd>Force <tt>ntpq</tt> to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input.</dd>
+ <dt><tt>-n</tt></dt>
+ <dd>Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names.</dd>
+ <dt><tt>-p</tt></dt>
+ <dd>Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the <tt>peers</tt> interactive command.</dd>
</dl>
<h4>Internal Commands</h4>
<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 <tt>></tt>, followed by a file name, to the command line. A number of interactive format commands are executed entirely within the <tt>ntpq</tt> program itself and do not result in NTP mode-6 requests being sent to a server. These are described following.</p>
<dl>
<dt><tt>? [<i>command_keyword</i>]</tt><br>
- <tt>help [<i>command_keyword</i>]</tt>
- <dd>A <tt>?</tt> by itself will print a list of all the command keywords known to <tt>ntpq</tt>. A <tt>?</tt> followed by a command keyword will print function and usage information about the command.
+ <tt>help [<i>command_keyword</i>]</tt></dt>
+ <dd>A <tt>?</tt> by itself will print a list of all the command keywords known to <tt>ntpq</tt>. A <tt>?</tt> followed by a command keyword will print function and usage information about the command.</dd>
<dt><tt>addvars <i>name</i> [ = <i>value</i>] [...]</tt><br>
<tt>rmvars <i>name</i> [...]</tt><br>
- <tt>clearvars</tt>
- <dd>The arguments to this command consist of a list of items of the form <tt><i>name</i> = <i>value</i></tt>, where the <tt>= <i>value</i></tt> is ignored, and can be omitted in read requests. <tt>ntpq</tt> maintains an internal list in which data to be included in control messages can be assembled, and sent using the <tt>readlist</tt> and <tt>writelist</tt> commands described below. The <tt>addvars</tt> command allows variables and optional values to be added to the list. If more than one variable is to be added, the list should be comma-separated and not contain white space. The <tt>rmvars</tt> command can be used to remove individual variables from the list, while the <tt>clearlist</tt> command removes all variables from the list.
- <dt><tt>cooked</tt>
- <dd>Display server messages in prettyprint format.<dt><tt>debug more | less | off</tt>
- <dd>Turns internal query program debugging on and off.
- <dt><tt>delay <i>milliseconds</i></tt>
- <dd>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.
- <dt><tt>host <i>name</i></tt>
- <dd>Set the host to which future queries will be sent. The name may be either a DNS name or a numeric address.<dt><tt>hostnames [yes | no]</tt>
- <dd>If <tt>yes</tt> is specified, host names are printed in information displays. If <tt>no</tt> is specified, numeric addresses are printed instead. The default is <tt>yes</tt>, unless modified using the command line <tt>-n</tt> switch.
- <dt><tt>keyid <i>keyid</i></tt>
- <dd>This command specifies the key number to be used to authenticate configuration requests. This must correspond to a key number the server has been configured to use for this purpose.
- <dt><tt>ntpversion 1 | 2 | 3 | 4</tt>
- <dd>Sets the NTP version number which <tt>ntpq</tt> claims in packets. Defaults to 2, Note that mode-6 control messages (and modes, for that matter) didn't exist in NTP version 1.<dt><tt>passwd</tt>
- <dd>This command prompts for a password to authenticate configuration requests. The password must correspond to the key configured for NTP server for this purpose.<dt><tt>quit</tt>
- <dd>Exit <tt>ntpq</tt>.
- <dt><tt>raw</tt>
- <dd>Display server messages as received and without reformatting.<dt><tt>timeout <i>millseconds</i></tt>
- <dd>Specify a timeout period for responses to server queries. The default is about 5000 milliseconds. Note that since <tt>ntpq</tt> retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set.
+ <tt>clearvars</tt></dt>
+ <dd>The arguments to this command consist of a list of items of the form <tt><i>name</i> = <i>value</i></tt>, where the <tt>= <i>value</i></tt> is ignored, and can be omitted in read requests. <tt>ntpq</tt> maintains an internal list in which data to be included in control messages can be assembled, and sent using the <tt>readlist</tt> and <tt>writelist</tt> commands described below. The <tt>addvars</tt> command allows variables and optional values to be added to the list. If more than one variable is to be added, the list should be comma-separated and not contain white space. The <tt>rmvars</tt> command can be used to remove individual variables from the list, while the <tt>clearlist</tt> command removes all variables from the list.</dd>
+ <dt><tt>cooked</tt></dt>
+ <dd>Display server messages in prettyprint format.</dd>
+ <dt><tt>debug more | less | off</tt></dt>
+ <dd>Turns internal query program debugging on and off.</dd>
+ <dt><tt>delay <i>milliseconds</i></tt></dt>
+ <dd>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.</dd>
+ <dt><tt>host <i>name</i></tt></dt>
+ <dd>Set the host to which future queries will be sent. The name may be either a DNS name or a numeric address.</dd>
+ <dt><tt>hostnames [yes | no]</tt></dt>
+ <dd>If <tt>yes</tt> is specified, host names are printed in information displays. If <tt>no</tt> is specified, numeric addresses are printed instead. The default is <tt>yes</tt>, unless modified using the command line <tt>-n</tt> switch.</dd>
+ <dt><tt>keyid <i>keyid</i></tt></dt>
+ <dd>This command specifies the key number to be used to authenticate configuration requests. This must correspond to a key number the server has been configured to use for this purpose.</dd>
+ <dt><tt>ntpversion 1 | 2 | 3 | 4</tt></dt>
+ <dd>Sets the NTP version number which <tt>ntpq</tt> claims in packets. Defaults to 2, Note that mode-6 control messages (and modes, for that matter) didn't exist in NTP version 1.</dd>
+ <dt><tt>passwd</tt></dt>
+ <dd>This command prompts for a password to authenticate configuration requests. The password must correspond to the key configured for NTP server for this purpose.</dd>
+ <dt><tt>quit</tt></dt>
+ <dd>Exit <tt>ntpq</tt>.</dd>
+ <dt><tt>raw</tt></dt>
+ <dd>Display server messages as received and without reformatting.</dd>
+ <dt><tt>timeout <i>millseconds</i></tt></dt>
+ <dd>Specify a timeout period for responses to server queries. The default is about 5000 milliseconds. Note that since <tt>ntpq</tt> retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set.</dd>
</dl>
<h4>Control Message Commands</h4>
<p>Association IDs are used to identify system, peer and clock variables. System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace. Most control commands send a single mode-6 message to the server and expect a single response message. The exceptions are the <tt>peers</tt> command, which sends a series of messages, and the <tt>mreadlist</tt> and <tt>mreadvar</tt> commands, which iterate over a range of associations.</p>
<dl>
- <dt id="as"><tt>associations</tt>
- <dd>Display a list of mobilized associations in the form<dd><tt>ind assid status conf reach auth condition last_event cnt</tt>
+ <dt id="as"><tt>associations</tt></dt>
+ <dd>Display a list of mobilized associations in the form</dd>
+ <dd><tt>ind assid status conf reach auth condition last_event cnt</tt></dd>
<dd>
<table width="100%" border="1" cellspacing="2" cellpadding="2">
<tr>
<td>event count (see <a href="decode.html#peer">peer status word</a>)</td>
</tr>
</table>
- <dt><tt>clockvar [<i>assocID</i>] [<i>name</i> [ = <i>value</i> [...]] [...]</tt><br>
- <tt>cv [<i>assocID</i>] [<i>name</i> [ = <i>value</i> [...] ][...]</tt>
- <dd>Display a list of <a href="#clock">clock variables</a> for those assocations supporting a reference clock.
- <dt><tt>:config [...]</tt>
- <dd>Send the remainder of the command line, including whitespace, to the server as a run-time configuration command in the same format as the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
- <dt><tt>config-from-file <i>filename</i></tt>
- <dd>Send the each line of <i>filename</i> to the server as run-time configuration commands in the same format as the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
- <dt><tt>keyid</tt>
- <dd>Specify the key ID to use for write requests.<dt><tt>lassociations</tt>
- <dd>Perform the same function as the associations command, execept display mobilized and unmobilized associations.<dt><tt>mreadvar <i>assocID</i> <i>assocID</i> [ <i>variable_name</i> [ = <i>value</i>[ ... ]</tt><br>
- <tt>mrv <i>assocID</i> <i>assocID</i> [ <i>variable_name</i> [ = <i>value</i>[ ... ]</tt>
- <dd>Perform the same function as the <tt>readvar</tt> command, except for a range of association IDs. This range is determined from the association list cached by the most recent <tt>associations</tt> command.
- <dt><tt>passociations</tt>
- <dd>Perform the same function as the <tt>associations command</tt>, except that it uses previously stored data rather than making a new query.
- <dt><tt>passwd</tt>
- <dd>Specify the password to use for write requests.
- <dt id="pe"><tt>peers</tt>
- <dd>Display a list of associations in the form
- <dd><tt>ind assid status conf reach auth condition last_event cnt</tt>
+ </dd>
+ <dt><tt>clockvar <i>assocID</i> [<i>name</i> [ = <i>value</i> [...]] [...]</tt><br>
+ <tt>cv <i>assocID</i> [<i>name</i> [ = <i>value</i> [...] ][...]</tt></dt>
+ <dd>Display a list of <a href="#clock">clock variables</a> for those assocations supporting a reference clock.</dd>
+ <dt><tt>:config [...]</tt></dt>
+ <dd>Send the remainder of the command line, including whitespace, to the server as a run-time configuration command in the same format as the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.</dd>
+ <dt><tt>config-from-file <i>filename</i></tt></dt>
+ <dd>Send the each line of <i>filename</i> to the server as run-time configuration commands in the same format as the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.</dd>
+ <dt><tt>keyid</tt></dt>
+ <dd>Specify the key ID to use for write requests.</dd>
+ <dt><tt>lassociations</tt></dt>
+ <dd>Perform the same function as the associations command, execept display mobilized and unmobilized associations.</dd>
+ <dt><tt>mreadvar <i>assocID</i> <i>assocID</i> [ <i>variable_name</i> [ = <i>value</i>[ ... ]</tt><br>
+ <tt>mrv <i>assocID</i> <i>assocID</i> [ <i>variable_name</i> [ = <i>value</i>[ ... ]</tt></dt>
+ <dd>Perform the same function as the <tt>readvar</tt> command, except for a range of association IDs. This range is determined from the association list cached by the most recent <tt>associations</tt> command.</dd>
+ <dt><tt>passociations</tt></dt>
+ <dd>Perform the same function as the <tt>associations command</tt>, except that it uses previously stored data rather than making a new query.</dd>
+ <dt><tt>passwd</tt></dt>
+ <dd>Specify the password to use for write requests.</dd>
+ <dt id="pe"><tt>peers</tt></dt>
+ <dd>Display a list of associations in the form</dd>
+ <dd><tt>ind assid status conf reach auth condition last_event cnt</tt></dd>
<dd>
<table width="100%" border="1" cellspacing="2" cellpadding="2">
<tr>
<td>jitter</td>
</tr>
</table>
+ </dd>
<dt id="rv"><tt>readvar <i>assocID</i> <i>name</i> [ = <i>value</i> ] [,...]</tt><br>
- <tt>rv <i>assocID</i> [ <i>name</i> ] [,...]</tt>
- <dd>Display the specified variables. If the association ID is omitted or is given as zero, the variables are from the <a href="#system">system variables</a> name space, otherwise they are from the <a href="#peer">peer variables</a> name space. If no name is included, all operative variables in the name space are displayed. Multiple names are specified with comma separators and without whitespace. Note that time values are represented in milliseconds and frequency values in parts-per-million (PPM). Some NTP timestamps are represented in the format YYYYMMDDTTTT, where YYYY is the year, MM the month of year, DD the day of month and TTTT the time of day.
- <dt id="saveconfig"><tt>saveconfig <i>filename</i></tt>
- <dd>Write the current configuration, including any runtime modifications given with <tt>:config</tt> or <tt>config-from-file</tt>, to the ntpd host's file <i>filename</i>. This command will be rejected by the server unless <a href="miscopt.html#saveconfigdir">saveconfigdir</a> appears in the <tt>ntpd</tt> configuration file. <i>filename</i> can use strftime() format specifiers to substitute the current date and time, for example, <tt>saveconfig ntp-%Y%m%d-%H%M%S.conf</tt>. The filename used is stored in system variable <tt>savedconfig</tt>. Authentication is required.
- <dt><tt>writevar <i>assocID</i> <i>name</i> = <i>value</i> [,...]</tt>
- <dd>Write the specified variables. If the association ID is omitted or is given as zero, the variables are from the <a href="#system">system variables</a> name space, otherwise they are from the <a href="#peer">peer variables</a> name space.</dl>
- <h4 id="status">Status Words and Kiss Codes</h4>
+ <tt>rv <i>assocID</i> [ <i>name</i> ] [,...]</tt></dt>
+ <dd>Display the specified variables. If <tt><i>assocID</i></tt> is zero, the variables
+ are from the <a href="#system">system variables</a> name space, otherwise
+ they are from the <a href="#peer">peer variables</a> name space. The <tt><i>assocID</i></tt> is
+ required, as the same name can occur in both spaces. If no <tt><i>name</i></tt> is
+ included, all operative variables in the name space are displayed.
+ Multiple names are specified with comma separators and without whitespace.
+ Note that time values are represented in milliseconds and frequency
+ values in parts-per-million (PPM). Some NTP timestamps are represented in
+ the format YYYYMMDDTTTT, where YYYY is the year, MM the month of year, DD
+ the day of month and TTTT the time of day.</dd>
+ <dt id="saveconfig"><tt>saveconfig <i>filename</i></tt></dt>
+ <dd>Write the current configuration, including any runtime modifications given with <tt>:config</tt> or <tt>config-from-file</tt>, to the ntpd host's file <i>filename</i>. This command will be rejected by the server unless <a href="miscopt.html#saveconfigdir">saveconfigdir</a> appears in the <tt>ntpd</tt> configuration file. <i>filename</i> can use strftime() format specifiers to substitute the current date and time, for example, <tt>saveconfig ntp-%Y%m%d-%H%M%S.conf</tt>. The filename used is stored in system variable <tt>savedconfig</tt>. Authentication is required.</dd>
+ <dt><tt>writevar <i>assocID</i> <i>name</i> = <i>value</i> [,...]</tt></dt>
+ <dd>Write the specified variables. If the <tt><i>assocID</i></tt> is zero, the variables
+ are from the <a href="#system">system variables</a> name space, otherwise they are from the <a href="#peer">peer variables</a> name space. The <tt><i>assocID</i></tt> is required, as the same name can occur
+ in both spaces.</dd>
+ </dl>
+ <h4 id="status">Status Words and Kiss Codes</h4>
<p>The current state of the operating program is shown in a set of status words maintained by the system and each association separately. These words are displayed in the <tt>rv</tt> and <tt>as</tt> commands both in hexadecimal and decoded short tip strings. The codes, tips and short explanations are on the <a href="decode.html">Event Messages and Status Words</a> page. The page also includes a list of system and peer messages, the code for the latest of which is included in the status word.</p>
<p>Information resulting from protocol machine state transitions is displayed using an informal set of ASCII strings called <a href="decode.html#kiss">kiss codes</a>. The original purpose was for kiss-o'-death (KoD) packets sent by the server to advise the client of an unusual condition. They are now displayed, when appropriate, in the reference identifier field in various billboards.</p>
<h4 id="system">System Variables</h4>
<dl>
<dt>The jitter and wander statistics are exponentially-weighted RMS averages.
The system jitter is defined in the NTPv4 specification; the
- clock jitter statistic is computed by the clock discipline module.
- <dd> </dd>
+ clock jitter statistic is computed by the clock discipline module.</dt>
<dt>When the NTPv4 daemon is compiled with the OpenSSL software library, additional
system variables are displayed, including some or all of the following, depending
on the particular Autokey dance:</dt>
</dl>
-<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
<tr>
<td>Variable</td>
<td>Description</td>
<td>Autokey signature timestamp</td>
</tr>
</table>
- <h4>Clock Variables</h4>
+ <h4 id="clock">Clock Variables</h4>
<p>The following clock variables apear in the <tt>cv</tt> billboard for each association with a reference clock. Not all variables are displayed in some configurations.</p>
<table width="100%" border="1" cellspacing="2" cellpadding="2">
<tr>