ntpq.1ntpqman revision 280849
1.de1 NOP
2.  it 1 an-trap
3.  if \\n[.$] \,\\$*\/
4..
5.ie t \
6.ds B-Font [CB]
7.ds I-Font [CI]
8.ds R-Font [CR]
9.el \
10.ds B-Font B
11.ds I-Font I
12.ds R-Font R
13.TH ntpq 1ntpqman "04 Feb 2015" "4.2.8p1" "User Commands"
14.\"
15.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-oaaWVr/ag-CaaOUr)
16.\"
17.\" It has been AutoGen-ed February 4, 2015 at 02:43:13 AM by AutoGen 5.18.5pre4
18.\" From the definitions ntpq-opts.def
19.\" and the template file agman-cmd.tpl
20.SH NAME
21\f\*[B-Font]ntpq\fP
22\- standard NTP query program
23.SH SYNOPSIS
24\f\*[B-Font]ntpq\fP
25.\" Mixture of short (flag) options and long options
26[\f\*[B-Font]\-flags\f[]]
27[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
28[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
29[ host ...]
30.sp \n(Ppu
31.ne 2
32
33.SH DESCRIPTION
34The
35\f\*[B-Font]ntpq\fP
36utility program is used to query NTP servers which
37implement the standard NTP mode 6 control message formats defined
38in Appendix B of the NTPv3 specification RFC1305, requesting
39information about current state and/or changes in that state.
40The same formats are used in NTPv4, although some of the
41variables have changed and new ones added. The description on this
42page is for the NTPv4 variables.
43The program may be run either in interactive mode or controlled using
44command line arguments.
45Requests to read and write arbitrary
46variables can be assembled, with raw and pretty-printed output
47options being available.
48The
49\f\*[B-Font]ntpq\fP
50utility can also obtain and print a
51list of peers in a common format by sending multiple queries to the
52server.
53If one or more request options is included on the command line
54when
55\f\*[B-Font]ntpq\fP
56is executed, each of the requests will be sent
57to the NTP servers running on each of the hosts given as command
58line arguments, or on localhost by default.
59If no request options
60are given,
61\f\*[B-Font]ntpq\fP
62will attempt to read commands from the
63standard input and execute these on the NTP server running on the
64first host given on the command line, again defaulting to localhost
65when no other host is specified.
66The
67\f\*[B-Font]ntpq\fP
68utility will prompt for
69commands if the standard input is a terminal device.
70\f\*[B-Font]ntpq\fP
71uses NTP mode 6 packets to communicate with the
72NTP server, and hence can be used to query any compatible server on
73the network which permits it.
74Note that since NTP is a UDP protocol
75this communication will be somewhat unreliable, especially over
76large distances in terms of network topology.
77The
78\f\*[B-Font]ntpq\fP
79utility makes
80one attempt to retransmit requests, and will time requests out if
81the remote host is not heard from within a suitable timeout
82time.
83Specifying a
84command line option other than
85\f\*[B-Font]\-i\f[]
86or
87\f\*[B-Font]\-n\f[]
88will
89cause the specified query (queries) to be sent to the indicated
90host(s) immediately.
91Otherwise,
92\f\*[B-Font]ntpq\fP
93will attempt to read
94interactive format commands from the standard input.
95.SS "Internal Commands"
96Interactive format commands consist of a keyword followed by zero
97to four arguments.
98Only enough characters of the full keyword to
99uniquely identify the command need be typed.
100A
101number of interactive format commands are executed entirely within
102the
103\f\*[B-Font]ntpq\fP
104utility itself and do not result in NTP mode 6
105requests being sent to a server.
106These are described following.
107.TP 20
108.NOP \f\*[B-Font]?\f[] [\f\*[I-Font]command_keyword\f[]]
109.br
110.ns
111.TP 20
112.NOP \f\*[B-Font]help\f[] [\f\*[I-Font]command_keyword\f[]]
113A
114\[oq]\&?\[cq]
115by itself will print a list of all the command
116keywords known to this incarnation of
117\f\*[B-Font]ntpq\fP.
118A
119\[oq]\&?\[cq]
120followed by a command keyword will print function and usage
121information about the command.
122This command is probably a better
123source of information about
124\f\*[B-Font]ntpq\fP
125than this manual
126page.
127.br
128.ns
129.TP 20
130.NOP \f\*[B-Font]addvars\f[] \f\*[I-Font]variable_name\f[][\f\*[B-Font]=value\f[]] \f\*[B-Font]...\f[]
131.br
132.ns
133.TP 20
134.NOP \f\*[B-Font]rmvars\f[] \f\*[I-Font]variable_name\f[] \f\*[B-Font]...\f[]
135.br
136.ns
137.TP 20
138.NOP \f\*[B-Font]clearvars\f[]
139.br
140.ns
141.TP 20
142.NOP \f\*[B-Font]showvars\f[]
143The data carried by NTP mode 6 messages consists of a list of
144items of the form
145\[oq]variable_name=value\[cq],
146where the
147\[oq]=value\[cq]
148is ignored, and can be omitted,
149in requests to the server to read variables.
150The
151\f\*[B-Font]ntpq\fP
152utility maintains an internal list in which data to be included in control
153messages can be assembled, and sent using the
154\f\*[B-Font]readlist\f[]
155and
156\f\*[B-Font]writelist\f[]
157commands described below.
158The
159\f\*[B-Font]addvars\f[]
160command allows variables and their optional values to be added to
161the list.
162If more than one variable is to be added, the list should
163be comma-separated and not contain white space.
164The
165\f\*[B-Font]rmvars\f[]
166command can be used to remove individual variables from the list,
167while the
168\f\*[B-Font]clearlist\f[]
169command removes all variables from the
170list.
171The
172\f\*[B-Font]showvars\f[]
173command displays the current list of optional variables.
174.br
175.ns
176.TP 20
177.NOP \f\*[B-Font]authenticate\f[] [yes | no]
178Normally
179\f\*[B-Font]ntpq\fP
180does not authenticate requests unless
181they are write requests.
182The command
183\[oq]authenticate yes\[cq]
184causes
185\f\*[B-Font]ntpq\fP
186to send authentication with all requests it
187makes.
188Authenticated requests causes some servers to handle
189requests slightly differently, and can occasionally melt the CPU in
190fuzzballs if you turn authentication on before doing a
191\f\*[B-Font]peer\f[]
192display.
193The command
194\[oq]authenticate\[cq]
195causes
196\f\*[B-Font]ntpq\fP
197to display whether or not
198\f\*[B-Font]ntpq\fP
199is currently autheinticating requests.
200.br
201.ns
202.TP 20
203.NOP \f\*[B-Font]cooked\f[]
204Causes output from query commands to be "cooked", so that
205variables which are recognized by
206\f\*[B-Font]ntpq\fP
207will have their
208values reformatted for human consumption.
209Variables which
210\f\*[B-Font]ntpq\fP
211thinks should have a decodable value but didn't are
212marked with a trailing
213\[oq]\&?\[cq].
214.br
215.ns
216.TP 20
217.NOP \f\*[B-Font]debug\f[] [\f\*[B-Font]more\f[] | \f\*[B-Font]less\f[] | \f\*[B-Font]off\f[]]
218With no argument, displays the current debug level.
219Otherwise, the debug level is changed to the indicated level.
220.br
221.ns
222.TP 20
223.NOP \f\*[B-Font]delay\f[] \f\*[I-Font]milliseconds\f[]
224Specify a time interval to be added to timestamps included in
225requests which require authentication.
226This is used to enable
227(unreliable) server reconfiguration over long delay network paths
228or between machines whose clocks are unsynchronized.
229Actually the
230server does not now require timestamps in authenticated requests,
231so this command may be obsolete.
232.br
233.ns
234.TP 20
235.NOP \f\*[B-Font]exit\f[]
236Exit
237\f\*[B-Font]ntpq\fP.
238.br
239.ns
240.TP 20
241.NOP \f\*[B-Font]host\f[] \f\*[I-Font]hostname\f[]
242Set the host to which future queries will be sent.
243\f\*[I-Font]hostname\f[]
244may be either a host name or a numeric address.
245.br
246.ns
247.TP 20
248.NOP \f\*[B-Font]hostnames\f[] [\f\*[B-Font]yes\f[] | \f\*[B-Font]no\f[]]
249If
250\f\*[B-Font]yes\f[]
251is specified, host names are printed in
252information displays.
253If
254\f\*[B-Font]no\f[]
255is specified, numeric
256addresses are printed instead.
257The default is
258\f\*[B-Font]yes\f[],
259unless
260modified using the command line
261\f\*[B-Font]\-n\f[]
262switch.
263.br
264.ns
265.TP 20
266.NOP \f\*[B-Font]keyid\f[] \f\*[I-Font]keyid\f[]
267This command allows the specification of a key number to be
268used to authenticate configuration requests.
269This must correspond
270to a key number the server has been configured to use for this
271purpose.
272.br
273.ns
274.TP 20
275.NOP \f\*[B-Font]keytype\f[] [\f\*[B-Font]md5\f[] | \f\*[B-Font]OpenSSLDigestType\f[]]
276Specify the type of key to use for authenticating requests.
277\f\*[B-Font]md5\f[]
278is alway supported.
279If
280\f\*[B-Font]ntpq\fP
281was built with OpenSSL support,
282any digest type supported by OpenSSL can also be provided.
283If no argument is given, the current
284\f\*[B-Font]keytype\f[]
285is displayed.
286.br
287.ns
288.TP 20
289.NOP \f\*[B-Font]ntpversion\f[] [\f\*[B-Font]1\f[] | \f\*[B-Font]2\f[] | \f\*[B-Font]3\f[] | \f\*[B-Font]4\f[]]
290Sets the NTP version number which
291\f\*[B-Font]ntpq\fP
292claims in
293packets.
294Defaults to 3, and note that mode 6 control messages (and
295modes, for that matter) didn't exist in NTP version 1.
296There appear
297to be no servers left which demand version 1.
298With no argument, displays the current NTP version that will be used
299when communicating with servers.
300.br
301.ns
302.TP 20
303.NOP \f\*[B-Font]passwd\f[]
304This command prompts you to type in a password (which will not
305be echoed) which will be used to authenticate configuration
306requests.
307The password must correspond to the key configured for
308use by the NTP server for this purpose if such requests are to be
309successful.
310.\" Not yet implemented.
311.\" .It Ic poll
312.\" .Op Ar n
313.\" .Op Ic verbose
314.\" Poll an NTP server in client mode
315.\" .Ar n
316.\" times.
317.br
318.ns
319.TP 20
320.NOP \f\*[B-Font]quit\f[]
321Exit
322\f\*[B-Font]ntpq\fP.
323.br
324.ns
325.TP 20
326.NOP \f\*[B-Font]raw\f[]
327Causes all output from query commands is printed as received
328from the remote server.
329The only formating/interpretation done on
330the data is to transform nonascii data into a printable (but barely
331understandable) form.
332.br
333.ns
334.TP 20
335.NOP \f\*[B-Font]timeout\f[] \f\*[I-Font]milliseconds\f[]
336Specify a timeout period for responses to server queries.
337The
338default is about 5000 milliseconds.
339Note that since
340\f\*[B-Font]ntpq\fP
341retries each query once after a timeout, the total waiting time for
342a timeout will be twice the timeout value set.
343.br
344.ns
345.TP 20
346.NOP \f\*[B-Font]version\f[]
347Print the version of the
348\f\*[B-Font]ntpq\fP
349program.
350.PP
351.SS "Control Message Commands"
352Association IDs are used to identify system, peer and clock variables.
353System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
354Most control commands send a single mode-6 message to the server and expect a single response message.
355The exceptions are the
356\f[C]peers\f[]
357command, which sends a series of messages,
358and the
359\f[C]mreadlist\f[]
360and
361\f[C]mreadvar\f[]
362commands, which iterate over a range of associations.
363.TP 10
364.NOP \f\*[B-Font]associations\f[]
365Display a list of mobilized associations in the form:
366.Dl ind assid status conf reach auth condition last_event cnt
367.RS
368.IP \fB\(bu\fP 2
369.IP \fB\(bu\fP 2 \f[C]ind\f[] \f[C]Ta\f[] \f[C]index\f[] \f[C]on\f[] \f[C]this\f[] \f[C]list\f[]
370.IP \fB\(bu\fP 2 \f[C]assid\f[] \f[C]Ta\f[] \f[C]association\f[] \f[C]ID\f[]
371.IP \fB\(bu\fP 2 \f[C]status\f[] \f[C]Ta\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word\f[]
372.IP \fB\(bu\fP 2 \f[C]conf\f[] \f[C]Ta\f[] \f[C]yes\f[]: \f[C]persistent,\f[] \f[C]no\f[]: \f[C]ephemeral\f[]
373.IP \fB\(bu\fP 2 \f[C]reach\f[] \f[C]Ta\f[] \f[C]yes\f[]: \f[C]reachable,\f[] \f[C]no\f[]: \f[C]unreachable\f[]
374.IP \fB\(bu\fP 2 \f[C]auth\f[] \f[C]Ta\f[] \f[C]ok\f[], \f[C]yes\f[], \f[C]bad\f[] \f[C]and\f[] \f[C]none\f[]
375.IP \fB\(bu\fP 2 \f[C]condition\f[] \f[C]Ta\f[] \f[C]selection\f[] \f[C]status\f[] \f[C](see\f[] \f[C]the\f[] \f[C]select\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[]
376.IP \fB\(bu\fP 2 \f[C]last_event\f[] \f[C]Ta\f[] \f[C]event\f[] \f[C]report\f[] \f[C](see\f[] \f[C]the\f[] \f[C]event\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[]
377.IP \fB\(bu\fP 2 \f[C]cnt\f[] \f[C]Ta\f[] \f[C]event\f[] \f[C]count\f[] \f[C](see\f[] \f[C]the\f[] \f[C]count\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[]
378.RE
379.br
380.ns
381.TP 10
382.NOP \f\*[B-Font]authinfo\f[]
383Display the authentication statistics.
384.br
385.ns
386.TP 10
387.NOP \f\*[B-Font]clockvar\f[] \f\*[I-Font]assocID\f[] [\f\*[I-Font]name\f[][\f\*[B-Font]=\f[]\f\*[I-Font]value\f[]] [] ...]
388.br
389.ns
390.TP 10
391.NOP \f\*[B-Font]cv\f[] \f\*[I-Font]assocID\f[] [\f\*[I-Font]name\f[][\f\*[B-Font]=\f[]\f\*[I-Font]value\f[]] [] ...]
392Display a list of clock variables for those associations supporting a reference clock.
393.br
394.ns
395.TP 10
396.NOP \f\*[B-Font]:config\f[] [...]
397Send the remainder of the command line, including whitespace, to the server as a run-time configuration command in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
398.br
399.ns
400.TP 10
401.NOP \f\*[B-Font]config-from-file\f[] \f\*[I-Font]filename\f[]
402Send the each line of
403\f\*[I-Font]filename\f[]
404to the server as run-time configuration commands in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is required.
405.br
406.ns
407.TP 10
408.NOP \f\*[B-Font]ifstats\f[]
409Display statistics for each local network address. Authentication is required.
410.br
411.ns
412.TP 10
413.NOP \f\*[B-Font]iostats\f[]
414Display network and reference clock I/O statistics.
415.br
416.ns
417.TP 10
418.NOP \f\*[B-Font]kerninfo\f[]
419Display kernel loop and PPS statistics. As with other ntpq output, times are in milliseconds. The precision value displayed is in milliseconds as well, unlike the precision system variable.
420.br
421.ns
422.TP 10
423.NOP \f\*[B-Font]lassociations\f[]
424Perform the same function as the associations command, except display mobilized and unmobilized associations.
425.br
426.ns
427.TP 10
428.NOP \f\*[B-Font]lopeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]]
429Obtain and print a list of all peers and clients showing
430\f\*[I-Font]dstadr\f[]
431(associated with any given IP version).
432.br
433.ns
434.TP 10
435.NOP \f\*[B-Font]lpeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]]
436Print a peer spreadsheet for the appropriate IP version(s).
437\f\*[I-Font]dstadr\f[]
438(associated with any given IP version).
439.br
440.ns
441.TP 10
442.NOP \f\*[B-Font]monstats\f[]
443Display monitor facility statistics.
444.br
445.ns
446.TP 10
447.NOP \f\*[B-Font]mrulist\f[] [\f\*[B-Font]limited\f[] | \f\*[B-Font]kod\f[] | \f\*[B-Font]mincount\f[]=\f\*[I-Font]count\f[] | \f\*[B-Font]laddr\f[]=\f\*[I-Font]localaddr\f[] | \f\*[B-Font]sort\f[]=\f\*[I-Font]sortorder\f[] | \f\*[B-Font]resany\f[]=\f\*[I-Font]hexmask\f[] | \f\*[B-Font]resall\f[]=\f\*[I-Font]hexmask\f[]]
448Obtain and print traffic counts collected and maintained by the monitor facility.
449With the exception of
450\f\*[B-Font]sort\f[]=\f\*[I-Font]sortorder\f[],
451the options filter the list returned by
452\f\*[B-Font]ntpd.\f[]
453The
454\f\*[B-Font]limited\f[]
455and
456\f\*[B-Font]kod\f[]
457options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
458The
459\f\*[B-Font]mincount\f[]=\f\*[I-Font]count\f[]
460option filters entries representing less than
461\f\*[I-Font]count\f[]
462packets.
463The
464\f\*[B-Font]laddr\f[]=\f\*[I-Font]localaddr\f[]
465option filters entries for packets received on any local address other than
466\f\*[I-Font]localaddr\f[].
467\f\*[B-Font]resany\f[]=\f\*[I-Font]hexmask\f[]
468and
469\f\*[B-Font]resall\f[]=\f\*[I-Font]hexmask\f[]
470filter entries containing none or less than all, respectively, of the bits in
471\f\*[I-Font]hexmask\f[],
472which must begin with
473\f\*[B-Font]0x\f[].
474The
475\f\*[I-Font]sortorder\f[]
476defaults to
477\f\*[B-Font]lstint\f[]
478and may be any of
479\f\*[B-Font]addr\f[],
480\f\*[B-Font]count\f[],
481\f\*[B-Font]avgint\f[],
482\f\*[B-Font]lstint\f[],
483or any of those preceded by a minus sign (hyphen) to reverse the sort order.
484The output columns are:
485.RS
486.TP 10
487.NOP Column
488Description
489.br
490.ns
491.TP 10
492.NOP \f\*[B-Font]lstint\f[]
493Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
494\f\*[B-Font]ntpq\fP.
495.br
496.ns
497.TP 10
498.NOP \f\*[B-Font]avgint\f[]
499Average interval in s between packets from this address.
500.br
501.ns
502.TP 10
503.NOP \f\*[B-Font]rstr\f[]
504Restriction flags associated with this address.
505Most are copied unchanged from the matching
506\f\*[B-Font]restrict\f[]
507command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
508.br
509.ns
510.TP 10
511.NOP \f\*[B-Font]r\f[]
512Rate control indicator, either
513a period,
514\f\*[B-Font]L\f[]
515or
516\f\*[B-Font]K\f[]
517for no rate control response,
518rate limiting by discarding, or rate limiting with a KoD response, respectively.
519.br
520.ns
521.TP 10
522.NOP \f\*[B-Font]m\f[]
523Packet mode.
524.br
525.ns
526.TP 10
527.NOP \f\*[B-Font]v\f[]
528Packet version number.
529.br
530.ns
531.TP 10
532.NOP \f\*[B-Font]count\f[]
533Packets received from this address.
534.br
535.ns
536.TP 10
537.NOP \f\*[B-Font]rport\f[]
538Source port of last packet from this address.
539.br
540.ns
541.TP 10
542.NOP \f\*[B-Font]remote\f[] \f\*[B-Font]address\f[]
543DNS name, numeric address, or address followed by
544claimed DNS name which could not be verified in parentheses.
545.RE
546.br
547.ns
548.TP 10
549.NOP \f\*[B-Font]mreadvar\f[] \f\*[B-Font]assocID\f[] \f\*[B-Font]assocID\f[] [\f\*[I-Font]variable_name\f[][=\f\*[I-Font]value\f[]]] ...
550.br
551.ns
552.TP 10
553.NOP \f\*[B-Font]mrv\f[] \f\*[B-Font]assocID\f[] \f\*[B-Font]assocID\f[] [\f\*[I-Font]variable_name\f[][=\f\*[I-Font]value\f[]]] ...
554Perform the same function as the
555\f\*[B-Font]readvar\f[]
556command, except for a range of association IDs.
557This range is determined from the association list cached by the most recent
558\f\*[B-Font]associations\f[]
559command.
560.br
561.ns
562.TP 10
563.NOP \f\*[B-Font]opeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]]
564Obtain and print the old-style list of all peers and clients showing
565\f\*[I-Font]dstadr\f[]
566(associated with any given IP version),
567rather than the
568\f\*[I-Font]refid\f[].
569.br
570.ns
571.TP 10
572.NOP \f\*[B-Font]passociations\f[]
573Perform the same function as the
574\f\*[B-Font]associations\f[]
575command,
576except that it uses previously stored data rather than making a new query.
577.br
578.ns
579.TP 10
580.NOP \f\*[B-Font]peers\f[]
581Display a list of peers in the form:
582.Dl [tally]remote refid st t when pool reach delay offset jitter
583.RS
584.TP 10
585.NOP Variable
586Description
587.br
588.ns
589.TP 10
590.NOP \f\*[B-Font][tally]\f[]
591single-character code indicating current value of the
592\f\*[B-Font]select\f[]
593field of the
594.Lk decode.html#peer "peer status word"
595.br
596.ns
597.TP 10
598.NOP \f\*[B-Font]remote\f[]
599host name (or IP number) of peer.
600The value displayed will be truncated to 15 characters  unless the
601\f\*[B-Font]\-w\f[]
602flag is given, in which case the full value will be displayed
603on the first line,
604and the remaining data is displayed on the next line.
605.br
606.ns
607.TP 10
608.NOP \f\*[B-Font]refid\f[]
609association ID or
610.Lk decode.html#kiss "'kiss code"
611.br
612.ns
613.TP 10
614.NOP \f\*[B-Font]st\f[]
615stratum
616.br
617.ns
618.TP 10
619.NOP \f\*[B-Font]t\f[]
620\f\*[B-Font]u\f[]:
621unicast or manycast client,
622\f\*[B-Font]b\f[]:
623broadcast or multicast client,
624\f\*[B-Font]l\f[]:
625local (reference clock),
626\f\*[B-Font]s\f[]:
627symmetric (peer),
628\f\*[B-Font]A\f[]:
629manycast server,
630\f\*[B-Font]B\f[]:
631broadcast server,
632\f\*[B-Font]M\f[]:
633multicast server
634.br
635.ns
636.TP 10
637.NOP \f\*[B-Font]when\f[]
638sec/min/hr since last received packet
639.br
640.ns
641.TP 10
642.NOP \f\*[B-Font]poll\f[]
643poll interval (log2 s)
644.br
645.ns
646.TP 10
647.NOP \f\*[B-Font]reach\f[]
648reach shift register (octal)
649.br
650.ns
651.TP 10
652.NOP \f\*[B-Font]delay\f[]
653roundtrip delay
654.br
655.ns
656.TP 10
657.NOP \f\*[B-Font]offset\f[]
658offset of server relative to this host
659.br
660.ns
661.TP 10
662.NOP \f\*[B-Font]jitter\f[]
663jitter
664.RE
665.br
666.ns
667.TP 10
668.NOP \f\*[B-Font]pstats\f[] \f\*[I-Font]assocID\f[]
669Show the statistics for the peer with the given
670\f\*[I-Font]assocID\f[].
671.br
672.ns
673.TP 10
674.NOP \f\*[B-Font]readlist\f[] \f\*[I-Font]assocID\f[]
675.br
676.ns
677.TP 10
678.NOP \f\*[B-Font]rl\f[] \f\*[I-Font]assocID\f[]
679Read the system or peer variables included in the variable list.
680.br
681.ns
682.TP 10
683.NOP \f\*[B-Font]readvar\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[][=\f\*[I-Font]value\f[]] [, ...]
684.br
685.ns
686.TP 10
687.NOP \f\*[B-Font]rv\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[][=\f\*[I-Font]value\f[]] [, ...]
688Display the specified variables.
689If
690\f\*[I-Font]assocID\f[]
691is zero, the variables are from the
692\fISystem\f[] \fIVariables\f[]
693name space, otherwise they are from the
694\fIPeer\f[] \fIVariables\f[]
695name space.
696The
697\f\*[I-Font]assocID\f[]
698is required, as the same name can occur in both spaces.
699If no
700\f\*[I-Font]name\f[]
701is included, all operative variables in the name space are displayed.
702In this case only, if the
703\f\*[I-Font]assocID\f[]
704is omitted, it is assumed zero.
705Multiple names are specified with comma separators and without whitespace.
706Note that time values are represented in milliseconds
707and frequency values in parts-per-million (PPM).
708Some NTP timestamps are represented in the format
709YYYYMMDDTTTT ,
710where YYYY is the year,
711MM the month of year,
712DD the day of month and
713TTTT the time of day.
714.br
715.ns
716.TP 10
717.NOP \f\*[B-Font]reslist\f[]
718Show the access control (restrict) list for
719\f\*[B-Font]ntpq\fP.
720.br
721.ns
722.TP 10
723.NOP \f\*[B-Font]saveconfig\f[] \f\*[I-Font]filename\f[]
724Write the current configuration,
725including any runtime modifications given with
726\f\*[B-Font]:config\f[]
727or
728\f\*[B-Font]config-from-file\f[],
729to the ntpd host's file
730\f\*[I-Font]filename\f[].
731This command will be rejected by the server unless
732.Lk miscopt.html#saveconfigdir "saveconfigdir"
733appears in the
734\f\*[B-Font]ntpd\f[]
735configuration file.
736\f\*[I-Font]filename\f[]
737can use
738\fCstrftime\fR()\f[]
739format specifies to substitute the current date and time, for example,
740\f\*[B-Font]q]saveconfig\f[] \f\*[B-Font]ntp-%Y%m%d-%H%M%S.confq]\f[].
741The filename used is stored in system variable
742\f\*[B-Font]savedconfig\f[].
743Authentication is required.
744.br
745.ns
746.TP 10
747.NOP \f\*[B-Font]timerstats\f[]
748Display interval timer counters.
749.br
750.ns
751.TP 10
752.NOP \f\*[B-Font]writelist\f[] \f\*[I-Font]assocID\f[]
753Write the system or peer variables included in the variable list.
754.br
755.ns
756.TP 10
757.NOP \f\*[B-Font]writevar\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[]=\f\*[I-Font]value\f[] [, ...]
758Write the specified variables.
759If the
760\f\*[I-Font]assocID\f[]
761is zero, the variables are from the
762\fISystem\f[] \fIVariables\f[]
763name space, otherwise they are from the
764\fIPeer\f[] \fIVariables\f[]
765name space.
766The
767\f\*[I-Font]assocID\f[]
768is required, as the same name can occur in both spaces.
769.br
770.ns
771.TP 10
772.NOP \f\*[B-Font]sysinfo\f[]
773Display operational summary.
774.br
775.ns
776.TP 10
777.NOP \f\*[B-Font]sysstats\f[]
778Print statistics counters maintained in the protocol module.
779.PP
780.SS Status Words and Kiss Codes
781The current state of the operating program is shown
782in a set of status words
783maintained by the system.
784Status information is also available on a per-association basis.
785These words are displayed in the
786\f\*[B-Font]rv\f[]
787and
788\f\*[B-Font]as\f[]
789commands both in hexadecimal and in decoded short tip strings.
790The codes, tips and short explanations are documented on the
791.Lk decode.html "Event Messages and Status Words"
792page.
793The page also includes a list of system and peer messages,
794the code for the latest of which is included in the status word.
795.sp \n(Ppu
796.ne 2
797
798Information resulting from protocol machine state transitions
799is displayed using an informal set of ASCII strings called
800.Lk decode.html#kiss "kiss codes" .
801The original purpose was for kiss-o'-death (KoD) packets
802sent by the server to advise the client of an unusual condition.
803They are now displayed, when appropriate,
804in the reference identifier field in various billboards.
805.SS System Variables
806The following system variables appear in the
807\f\*[B-Font]rv\f[]
808billboard.
809Not all variables are displayed in some configurations.
810.TP 10
811.NOP Variable
812Description
813.br
814.ns
815.TP 10
816.NOP \f\*[B-Font]status\f[]
817.Lk decode.html#sys "system status word"
818.br
819.ns
820.TP 10
821.NOP \f\*[B-Font]version\f[]
822NTP software version and build time
823.br
824.ns
825.TP 10
826.NOP \f\*[B-Font]processor\f[]
827hardware platform and version
828.br
829.ns
830.TP 10
831.NOP \f\*[B-Font]system\f[]
832operating system and version
833.br
834.ns
835.TP 10
836.NOP \f\*[B-Font]leap\f[]
837leap warning indicator (0-3)
838.br
839.ns
840.TP 10
841.NOP \f\*[B-Font]stratum\f[]
842stratum (1-15)
843.br
844.ns
845.TP 10
846.NOP \f\*[B-Font]precision\f[]
847precision (log2 s)
848.br
849.ns
850.TP 10
851.NOP \f\*[B-Font]rootdelay\f[]
852total roundtrip delay to the primary reference clock
853.br
854.ns
855.TP 10
856.NOP \f\*[B-Font]rootdisp\f[]
857total dispersion to the primary reference clock
858.br
859.ns
860.TP 10
861.NOP \f\*[B-Font]peer\f[]
862system peer association ID
863.br
864.ns
865.TP 10
866.NOP \f\*[B-Font]tc\f[]
867time constant and poll exponent (log2 s) (3-17)
868.br
869.ns
870.TP 10
871.NOP \f\*[B-Font]mintc\f[]
872minimum time constant (log2 s) (3-10)
873.br
874.ns
875.TP 10
876.NOP \f\*[B-Font]clock\f[]
877date and time of day
878.br
879.ns
880.TP 10
881.NOP \f\*[B-Font]refid\f[]
882reference ID or
883.Lk decode.html#kiss "kiss code"
884.br
885.ns
886.TP 10
887.NOP \f\*[B-Font]reftime\f[]
888reference time
889.br
890.ns
891.TP 10
892.NOP \f\*[B-Font]offset\f[]
893combined  offset of server relative to this host
894.br
895.ns
896.TP 10
897.NOP \f\*[B-Font]sys_jitter\f[]
898combined system jitter
899.br
900.ns
901.TP 10
902.NOP \f\*[B-Font]frequency\f[]
903frequency offset (PPM) relative to hardware clock
904.br
905.ns
906.TP 10
907.NOP \f\*[B-Font]clk_wander\f[]
908clock frequency wander (PPM)
909.br
910.ns
911.TP 10
912.NOP \f\*[B-Font]clk_jitter\f[]
913clock jitter
914.br
915.ns
916.TP 10
917.NOP \f\*[B-Font]tai\f[]
918TAI-UTC offset (s)
919.br
920.ns
921.TP 10
922.NOP \f\*[B-Font]leapsec\f[]
923NTP seconds when the next leap second is/was inserted
924.br
925.ns
926.TP 10
927.NOP \f\*[B-Font]expire\f[]
928NTP seconds when the NIST leapseconds file expires
929.PP
930The jitter and wander statistics are exponentially-weighted RMS averages.
931The system jitter is defined in the NTPv4 specification;
932the clock jitter statistic is computed by the clock discipline module.
933.sp \n(Ppu
934.ne 2
935
936When the NTPv4 daemon is compiled with the OpenSSL software library,
937additional system variables are displayed,
938including some or all of the following,
939depending on the particular Autokey dance:
940.TP 10
941.NOP Variable
942Description
943.br
944.ns
945.TP 10
946.NOP \f\*[B-Font]host\f[]
947Autokey host name for this host
948.br
949.ns
950.TP 10
951.NOP \f\*[B-Font]ident\f[]
952Autokey group name for this host
953.br
954.ns
955.TP 10
956.NOP \f\*[B-Font]flags\f[]
957host flags  (see Autokey specification)
958.br
959.ns
960.TP 10
961.NOP \f\*[B-Font]digest\f[]
962OpenSSL message digest algorithm
963.br
964.ns
965.TP 10
966.NOP \f\*[B-Font]signature\f[]
967OpenSSL digest/signature scheme
968.br
969.ns
970.TP 10
971.NOP \f\*[B-Font]update\f[]
972NTP seconds at last signature update
973.br
974.ns
975.TP 10
976.NOP \f\*[B-Font]cert\f[]
977certificate subject, issuer and certificate flags
978.br
979.ns
980.TP 10
981.NOP \f\*[B-Font]until\f[]
982NTP seconds when the certificate expires
983.PP
984.SS Peer Variables
985The following peer variables appear in the
986\f\*[B-Font]rv\f[]
987billboard for each association.
988Not all variables are displayed in some configurations.
989.TP 10
990.NOP Variable
991Description
992.br
993.ns
994.TP 10
995.NOP \f\*[B-Font]associd\f[]
996association ID
997.br
998.ns
999.TP 10
1000.NOP \f\*[B-Font]status\f[]
1001.Lk decode.html#peer "peer status word"
1002.br
1003.ns
1004.TP 10
1005.NOP \f\*[B-Font]srcadr\f[]
1006source (remote) IP address
1007.br
1008.ns
1009.TP 10
1010.NOP \f\*[B-Font]srcport\f[]
1011source (remote) port
1012.br
1013.ns
1014.TP 10
1015.NOP \f\*[B-Font]dstadr\f[]
1016destination (local) IP address
1017.br
1018.ns
1019.TP 10
1020.NOP \f\*[B-Font]dstport\f[]
1021destination (local) port
1022.br
1023.ns
1024.TP 10
1025.NOP \f\*[B-Font]leap\f[]
1026leap indicator (0-3)
1027.br
1028.ns
1029.TP 10
1030.NOP \f\*[B-Font]stratum\f[]
1031stratum (0-15)
1032.br
1033.ns
1034.TP 10
1035.NOP \f\*[B-Font]precision\f[]
1036precision (log2 s)
1037.br
1038.ns
1039.TP 10
1040.NOP \f\*[B-Font]rootdelay\f[]
1041total roundtrip delay to the primary reference clock
1042.br
1043.ns
1044.TP 10
1045.NOP \f\*[B-Font]rootdisp\f[]
1046total root dispersion to the primary reference clock
1047.br
1048.ns
1049.TP 10
1050.NOP \f\*[B-Font]refid\f[]
1051reference ID or
1052.Lk decode.html#kiss "kiss code"
1053.br
1054.ns
1055.TP 10
1056.NOP \f\*[B-Font]reftime\f[]
1057reference time
1058.br
1059.ns
1060.TP 10
1061.NOP \f\*[B-Font]reach\f[]
1062reach register (octal)
1063.br
1064.ns
1065.TP 10
1066.NOP \f\*[B-Font]unreach\f[]
1067unreach counter
1068.br
1069.ns
1070.TP 10
1071.NOP \f\*[B-Font]hmode\f[]
1072host mode (1-6)
1073.br
1074.ns
1075.TP 10
1076.NOP \f\*[B-Font]pmode\f[]
1077peer mode (1-5)
1078.br
1079.ns
1080.TP 10
1081.NOP \f\*[B-Font]hpoll\f[]
1082host poll exponent (log2 s) (3-17)
1083.br
1084.ns
1085.TP 10
1086.NOP \f\*[B-Font]ppoll\f[]
1087peer poll exponent (log2 s) (3-17)
1088.br
1089.ns
1090.TP 10
1091.NOP \f\*[B-Font]headway\f[]
1092headway (see
1093.Lk rate.html "Rate Management and the Kiss-o'-Death Packet" )
1094.br
1095.ns
1096.TP 10
1097.NOP \f\*[B-Font]flash\f[]
1098.Lk decode.html#flash "flash status word"
1099.br
1100.ns
1101.TP 10
1102.NOP \f\*[B-Font]offset\f[]
1103filter offset
1104.br
1105.ns
1106.TP 10
1107.NOP \f\*[B-Font]delay\f[]
1108filter delay
1109.br
1110.ns
1111.TP 10
1112.NOP \f\*[B-Font]dispersion\f[]
1113filter dispersion
1114.br
1115.ns
1116.TP 10
1117.NOP \f\*[B-Font]jitter\f[]
1118filter jitter
1119.br
1120.ns
1121.TP 10
1122.NOP \f\*[B-Font]ident\f[]
1123Autokey group name for this association
1124.br
1125.ns
1126.TP 10
1127.NOP \f\*[B-Font]bias\f[]
1128unicast/broadcast bias
1129.br
1130.ns
1131.TP 10
1132.NOP \f\*[B-Font]xleave\f[]
1133interleave delay (see
1134.Lk xleave.html "NTP Interleaved Modes" )
1135.PP
1136The
1137\f\*[B-Font]bias\f[]
1138variable is calculated when the first broadcast packet is received
1139after the calibration volley.
1140It represents the offset of the broadcast subgraph relative to the unicast subgraph.
1141The
1142\f\*[B-Font]xleave\f[]
1143variable appears only for the interleaved symmetric and interleaved modes.
1144It represents the internal queuing, buffering and transmission delays
1145for the preceding packet.
1146.sp \n(Ppu
1147.ne 2
1148
1149When the NTPv4 daemon is compiled with the OpenSSL software library,
1150additional peer variables are displayed, including the following:
1151.TP 10
1152.NOP Variable
1153Description
1154.br
1155.ns
1156.TP 10
1157.NOP \f\*[B-Font]flags\f[]
1158peer flags (see Autokey specification)
1159.br
1160.ns
1161.TP 10
1162.NOP \f\*[B-Font]host\f[]
1163Autokey server name
1164.br
1165.ns
1166.TP 10
1167.NOP \f\*[B-Font]flags\f[]
1168peer flags (see Autokey specification)
1169.br
1170.ns
1171.TP 10
1172.NOP \f\*[B-Font]signature\f[]
1173OpenSSL digest/signature scheme
1174.br
1175.ns
1176.TP 10
1177.NOP \f\*[B-Font]initsequence\f[]
1178initial key ID
1179.br
1180.ns
1181.TP 10
1182.NOP \f\*[B-Font]initkey\f[]
1183initial key index
1184.br
1185.ns
1186.TP 10
1187.NOP \f\*[B-Font]timestamp\f[]
1188Autokey signature timestamp
1189.PP
1190.SS Clock Variables
1191The following clock variables appear in the
1192\f\*[B-Font]cv\f[]
1193billboard for each association with a reference clock.
1194Not all variables are displayed in some configurations.
1195.TP 10
1196.NOP Variable
1197Description
1198.br
1199.ns
1200.TP 10
1201.NOP \f\*[B-Font]associd\f[]
1202association ID
1203.br
1204.ns
1205.TP 10
1206.NOP \f\*[B-Font]status\f[]
1207.Lk decode.html#clock "clock status word"
1208.br
1209.ns
1210.TP 10
1211.NOP \f\*[B-Font]device\f[]
1212device description
1213.br
1214.ns
1215.TP 10
1216.NOP \f\*[B-Font]timecode\f[]
1217ASCII time code string (specific to device)
1218.br
1219.ns
1220.TP 10
1221.NOP \f\*[B-Font]poll\f[]
1222poll messages sent
1223.br
1224.ns
1225.TP 10
1226.NOP \f\*[B-Font]noreply\f[]
1227no reply
1228.br
1229.ns
1230.TP 10
1231.NOP \f\*[B-Font]badformat\f[]
1232bad format
1233.br
1234.ns
1235.TP 10
1236.NOP \f\*[B-Font]baddata\f[]
1237bad date or time
1238.br
1239.ns
1240.TP 10
1241.NOP \f\*[B-Font]fudgetime1\f[]
1242fudge time 1
1243.br
1244.ns
1245.TP 10
1246.NOP \f\*[B-Font]fudgetime2\f[]
1247fudge time 2
1248.br
1249.ns
1250.TP 10
1251.NOP \f\*[B-Font]stratum\f[]
1252driver stratum
1253.br
1254.ns
1255.TP 10
1256.NOP \f\*[B-Font]refid\f[]
1257driver reference ID
1258.br
1259.ns
1260.TP 10
1261.NOP \f\*[B-Font]flags\f[]
1262driver flags
1263.PP
1264.SH "OPTIONS"
1265.TP
1266.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
1267Force IPv4 DNS name resolution.
1268This option must not appear in combination with any of the following options:
1269ipv6.
1270.sp
1271Force DNS resolution of following host names on the command line
1272to the IPv4 namespace.
1273.TP
1274.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
1275Force IPv6 DNS name resolution.
1276This option must not appear in combination with any of the following options:
1277ipv4.
1278.sp
1279Force DNS resolution of following host names on the command line
1280to the IPv6 namespace.
1281.TP
1282.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]cmd\f[], \f\*[B-Font]\-\-command\f[]=\f\*[I-Font]cmd\f[]
1283run a command and exit.
1284This option may appear an unlimited number of times.
1285.sp
1286The following argument is interpreted as an interactive format command
1287and is added to the list of commands to be executed on the specified
1288host(s).
1289.TP
1290.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
1291Increase debug verbosity level.
1292This option may appear an unlimited number of times.
1293.sp
1294.TP
1295.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
1296Set the debug verbosity level.
1297This option may appear an unlimited number of times.
1298This option takes an integer number as its argument.
1299.sp
1300.TP
1301.NOP \f\*[B-Font]\-i\f[], \f\*[B-Font]\-\-interactive\f[]
1302Force ntpq to operate in interactive mode.
1303This option must not appear in combination with any of the following options:
1304command, peers.
1305.sp
1306Force \fBntpq\fP to operate in interactive mode.
1307Prompts will be written to the standard output and
1308commands read from the standard input.
1309.TP
1310.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-numeric\f[]
1311numeric host addresses.
1312.sp
1313Output all host addresses in dotted-quad numeric format rather than
1314converting to the canonical host names. 
1315.TP
1316.NOP \f\*[B-Font]\-\-old\-rv\f[]
1317Always output status line with readvar.
1318.sp
1319By default, \fBntpq\fP now suppresses the \fBassocid=...\fP
1320line that precedes the output of \fBreadvar\fP
1321(alias \fBrv\fP) when a single variable is requested, such as
1322\fBntpq \-c "rv 0 offset"\fP.
1323This option causes \fBntpq\fP to include both lines of output
1324for a single-variable \fBreadvar\fP.
1325Using an environment variable to
1326preset this option in a script will enable both older and
1327newer \fBntpq\fP to behave identically in this regard.
1328.TP
1329.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[]
1330Print a list of the peers.
1331This option must not appear in combination with any of the following options:
1332interactive.
1333.sp
1334Print a list of the peers known to the server as well as a summary
1335of their state. This is equivalent to the 'peers' interactive command.
1336.TP
1337.NOP \f\*[B-Font]\-w\f[], \f\*[B-Font]\-\-wide\f[]
1338Display the full 'remote' value.
1339.sp
1340Display the full value of the 'remote' value.  If this requires
1341more than 15 characters, display the full value, emit a newline,
1342and continue the data display properly indented on the next line.
1343.TP
1344.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
1345Display usage information and exit.
1346.TP
1347.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
1348Pass the extended usage information through a pager.
1349.TP
1350.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
1351Save the option state to \fIcfgfile\fP.  The default is the \fIlast\fP
1352configuration file listed in the \fBOPTION PRESETS\fP section, below.
1353The command will exit after updating the config file.
1354.TP
1355.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
1356Load options from \fIcfgfile\fP.
1357The \fIno-load-opts\fP form will disable the loading
1358of earlier config/rc/ini files.  \fI\-\-no-load-opts\fP is handled early,
1359out of order.
1360.TP
1361.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
1362Output version of program and exit.  The default mode is `v', a simple
1363version.  The `c' mode will print copyright information and `n' will
1364print the full copyright notice.
1365.PP
1366.SH "OPTION PRESETS"
1367Any option that is not marked as \fInot presettable\fP may be preset
1368by loading values from configuration ("RC" or ".INI") file(s) and values from
1369environment variables named:
1370.nf
1371  \fBNTPQ_<option-name>\fP or \fBNTPQ\fP
1372.fi
1373.ad
1374The environmental presets take precedence (are processed later than)
1375the configuration files.
1376The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
1377If any of these are directories, then the file \fI.ntprc\fP
1378is searched for within those directories.
1379.SH "ENVIRONMENT"
1380See \fBOPTION PRESETS\fP for configuration environment variables.
1381.SH "FILES"
1382See \fBOPTION PRESETS\fP for configuration files.
1383.SH "EXIT STATUS"
1384One of the following exit values will be returned:
1385.TP
1386.NOP 0 " (EXIT_SUCCESS)"
1387Successful program execution.
1388.TP
1389.NOP 1 " (EXIT_FAILURE)"
1390The operation failed or the command syntax was not valid.
1391.TP
1392.NOP 66 " (EX_NOINPUT)"
1393A specified configuration file could not be loaded.
1394.TP
1395.NOP 70 " (EX_SOFTWARE)"
1396libopts had an internal operational error.  Please report
1397it to autogen-users@lists.sourceforge.net.  Thank you.
1398.PP
1399.SH "AUTHORS"
1400The University of Delaware and Network Time Foundation
1401.SH "COPYRIGHT"
1402Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved.
1403This program is released under the terms of the NTP license, <http://ntp.org/license>.
1404.SH "BUGS"
1405Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
1406.SH "NOTES"
1407This manual page was \fIAutoGen\fP-erated from the \fBntpq\fP
1408option definitions.
1409