ntpq.mdoc.in revision 298695
1243789Sdim.Dd April 26 2016
2243789Sdim.Dt NTPQ @NTPQ_MS@ User Commands
3243789Sdim.Os
4243789Sdim.\"  EDIT THIS FILE WITH CAUTION  (ntpq-opts.mdoc)
5243789Sdim.\"
6243789Sdim.\"  It has been AutoGen-ed  April 26, 2016 at 08:29:41 PM by AutoGen 5.18.5
7243789Sdim.\"  From the definitions    ntpq-opts.def
8243789Sdim.\"  and the template file   agmdoc-cmd.tpl
9243789Sdim.Sh NAME
10243789Sdim.Nm ntpq
11243789Sdim.Nd standard NTP query program
12243789Sdim.Sh SYNOPSIS
13243789Sdim.Nm
14243789Sdim.\" Mixture of short (flag) options and long options
15243789Sdim.Op Fl flags
16243789Sdim.Op Fl flag Op Ar value
17243789Sdim.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
18243789Sdim[ host ...]
19243789Sdim.Pp
20243789Sdim.Sh DESCRIPTION
21243789SdimThe
22243789Sdim.Nm
23243789Sdimutility program is used to query NTP servers which
24243789Sdimimplement the standard NTP mode 6 control message formats defined
25243789Sdimin Appendix B of the NTPv3 specification RFC1305, requesting
26243789Sdiminformation about current state and/or changes in that state.
27243789SdimThe same formats are used in NTPv4, although some of the
28243789Sdimvariables have changed and new ones added. The description on this
29243789Sdimpage is for the NTPv4 variables.
30243789SdimThe program may be run either in interactive mode or controlled using
31243789Sdimcommand line arguments.
32243789SdimRequests to read and write arbitrary
33243789Sdimvariables can be assembled, with raw and pretty\-printed output
34243789Sdimoptions being available.
35243789SdimThe
36243789Sdim.Nm
37243789Sdimutility can also obtain and print a
38243789Sdimlist of peers in a common format by sending multiple queries to the
39243789Sdimserver.
40243789SdimIf one or more request options is included on the command line
41243789Sdimwhen
42243789Sdim.Nm
43243789Sdimis executed, each of the requests will be sent
44243789Sdimto the NTP servers running on each of the hosts given as command
45243789Sdimline arguments, or on localhost by default.
46243789SdimIf no request options
47243789Sdimare given,
48243789Sdim.Nm
49243789Sdimwill attempt to read commands from the
50243789Sdimstandard input and execute these on the NTP server running on the
51243789Sdimfirst host given on the command line, again defaulting to localhost
52243789Sdimwhen no other host is specified.
53243789SdimThe
54243789Sdim.Nm
55243789Sdimutility will prompt for
56243789Sdimcommands if the standard input is a terminal device.
57243789Sdim.Nm
58243789Sdimuses NTP mode 6 packets to communicate with the
59243789SdimNTP server, and hence can be used to query any compatible server on
60243789Sdimthe network which permits it.
61243789SdimNote that since NTP is a UDP protocol
62243789Sdimthis communication will be somewhat unreliable, especially over
63243789Sdimlarge distances in terms of network topology.
64243789SdimThe
65243789Sdim.Nm
66243789Sdimutility makes
67243789Sdimone attempt to retransmit requests, and will time requests out if
68243789Sdimthe remote host is not heard from within a suitable timeout
69243789Sdimtime.
70243789SdimSpecifying a
71243789Sdimcommand line option other than
72243789Sdim.Fl i
73243789Sdimor
74243789Sdim.Fl n
75243789Sdimwill
76243789Sdimcause the specified query (queries) to be sent to the indicated
77243789Sdimhost(s) immediately.
78243789SdimOtherwise,
79243789Sdim.Nm
80243789Sdimwill attempt to read
81243789Sdiminteractive format commands from the standard input.
82243789Sdim.Ss "Internal Commands"
83243789SdimInteractive format commands consist of a keyword followed by zero
84243789Sdimto four arguments.
85243789SdimOnly enough characters of the full keyword to
86243789Sdimuniquely identify the command need be typed.
87243789SdimA
88243789Sdimnumber of interactive format commands are executed entirely within
89243789Sdimthe
90243789Sdim.Nm
91243789Sdimutility itself and do not result in NTP mode 6
92243789Sdimrequests being sent to a server.
93243789SdimThese are described following.
94243789Sdim.Bl -tag -width "? [command_keyword]" -compact -offset indent
95243789Sdim.It Ic ? Op  Ar command_keyword
96243789Sdim.It Ic help Op Ar command_keyword
97243789SdimA
98243789Sdim.Ql \&?
99243789Sdimby itself will print a list of all the command
100243789Sdimkeywords known to this incarnation of
101243789Sdim.Nm .
102243789SdimA
103243789Sdim.Ql \&?
104243789Sdimfollowed by a command keyword will print function and usage
105243789Sdiminformation about the command.
106243789SdimThis command is probably a better
107243789Sdimsource of information about
108243789Sdim.Nm
109243789Sdimthan this manual
110243789Sdimpage.
111243789Sdim.It Ic addvars Ar variable_name Ns Xo Op Ic =value
112243789Sdim.Ic ...
113243789Sdim.Xc
114243789Sdim.It Ic rmvars Ar variable_name Ic ...
115243789Sdim.It Ic clearvars
116243789Sdim.It Ic showvars
117243789SdimThe data carried by NTP mode 6 messages consists of a list of
118243789Sdimitems of the form
119243789Sdim.Ql variable_name=value ,
120243789Sdimwhere the
121243789Sdim.Ql =value
122243789Sdimis ignored, and can be omitted,
123243789Sdimin requests to the server to read variables.
124243789SdimThe
125243789Sdim.Nm
126243789Sdimutility maintains an internal list in which data to be included in control
127243789Sdimmessages can be assembled, and sent using the
128243789Sdim.Ic readlist
129243789Sdimand
130243789Sdim.Ic writelist
131243789Sdimcommands described below.
132243789SdimThe
133243789Sdim.Ic addvars
134243789Sdimcommand allows variables and their optional values to be added to
135243789Sdimthe list.
136243789SdimIf more than one variable is to be added, the list should
137243789Sdimbe comma\-separated and not contain white space.
138243789SdimThe
139243789Sdim.Ic rmvars
140243789Sdimcommand can be used to remove individual variables from the list,
141243789Sdimwhile the
142243789Sdim.Ic clearlist
143243789Sdimcommand removes all variables from the
144243789Sdimlist.
145243789SdimThe
146243789Sdim.Ic showvars
147243789Sdimcommand displays the current list of optional variables.
148243789Sdim.It Ic authenticate Op yes | no
149243789SdimNormally
150243789Sdim.Nm
151243789Sdimdoes not authenticate requests unless
152243789Sdimthey are write requests.
153243789SdimThe command
154243789Sdim.Ql authenticate yes
155243789Sdimcauses
156243789Sdim.Nm
157243789Sdimto send authentication with all requests it
158243789Sdimmakes.
159243789SdimAuthenticated requests causes some servers to handle
160243789Sdimrequests slightly differently, and can occasionally melt the CPU in
161243789Sdimfuzzballs if you turn authentication on before doing a
162243789Sdim.Ic peer
163243789Sdimdisplay.
164243789SdimThe command
165243789Sdim.Ql authenticate
166243789Sdimcauses
167243789Sdim.Nm
168243789Sdimto display whether or not
169243789Sdim.Nm
170243789Sdimis currently autheinticating requests.
171243789Sdim.It Ic cooked
172243789SdimCauses output from query commands to be "cooked", so that
173243789Sdimvariables which are recognized by
174243789Sdim.Nm
175243789Sdimwill have their
176243789Sdimvalues reformatted for human consumption.
177243789SdimVariables which
178243789Sdim.Nm
179243789Sdimthinks should have a decodable value but didn't are
180243789Sdimmarked with a trailing
181243789Sdim.Ql \&? .
182243789Sdim.It Xo
183243789Sdim.Ic debug
184243789Sdim.Oo
185243789Sdim.Cm more |
186243789Sdim.Cm less |
187243789Sdim.Cm off
188243789Sdim.Oc
189243789Sdim.Xc
190243789SdimWith no argument, displays the current debug level.
191243789SdimOtherwise, the debug level is changed to the indicated level.
192243789Sdim.It Ic delay Ar milliseconds
193243789SdimSpecify a time interval to be added to timestamps included in
194243789Sdimrequests which require authentication.
195243789SdimThis is used to enable
196243789Sdim(unreliable) server reconfiguration over long delay network paths
197243789Sdimor between machines whose clocks are unsynchronized.
198243789SdimActually the
199243789Sdimserver does not now require timestamps in authenticated requests,
200243789Sdimso this command may be obsolete.
201243789Sdim.It Ic exit
202243789SdimExit
203243789Sdim.Nm .
204243789Sdim.It Ic host Ar hostname
205243789SdimSet the host to which future queries will be sent.
206243789Sdim.Ar hostname
207243789Sdimmay be either a host name or a numeric address.
208243789Sdim.It Ic hostnames Op Cm yes | Cm no
209243789SdimIf
210243789Sdim.Cm yes
211243789Sdimis specified, host names are printed in
212243789Sdiminformation displays.
213243789SdimIf
214243789Sdim.Cm no
215243789Sdimis specified, numeric
216243789Sdimaddresses are printed instead.
217243789SdimThe default is
218243789Sdim.Cm yes ,
219243789Sdimunless
220243789Sdimmodified using the command line
221243789Sdim.Fl n
222243789Sdimswitch.
223243789Sdim.It Ic keyid Ar keyid
224243789SdimThis command allows the specification of a key number to be
225243789Sdimused to authenticate configuration requests.
226243789SdimThis must correspond
227243789Sdimto the
228243789Sdim.Cm controlkey
229243789Sdimkey number the server has been configured to use for this
230243789Sdimpurpose.
231243789Sdim.It Ic keytype Xo Oo
232243789Sdim.Cm md5 |
233243789Sdim.Cm OpenSSLDigestType
234243789Sdim.Oc
235243789Sdim.Xc
236243789SdimSpecify the type of key to use for authenticating requests.
237243789Sdim.Cm md5
238243789Sdimis alway supported.
239243789SdimIf
240243789Sdim.Nm
241243789Sdimwas built with OpenSSL support,
242243789Sdimany digest type supported by OpenSSL can also be provided.
243243789SdimIf no argument is given, the current
244243789Sdim.Ic keytype
245243789Sdimis displayed.
246243789Sdim.It Ic ntpversion Xo Oo
247243789Sdim.Cm 1 |
248243789Sdim.Cm 2 |
249243789Sdim.Cm 3 |
250243789Sdim.Cm 4
251243789Sdim.Oc
252243789Sdim.Xc
253243789SdimSets the NTP version number which
254243789Sdim.Nm
255243789Sdimclaims in
256243789Sdimpackets.
257243789SdimDefaults to 3, and note that mode 6 control messages (and
258243789Sdimmodes, for that matter) didn't exist in NTP version 1.
259243789SdimThere appear
260to be no servers left which demand version 1.
261With no argument, displays the current NTP version that will be used
262when communicating with servers.
263.It Ic passwd
264This command prompts you to type in a password (which will not
265be echoed) which will be used to authenticate configuration
266requests.
267The password must correspond to the key configured for
268use by the NTP server for this purpose if such requests are to be
269successful.
270.\" Not yet implemented.
271.\" .It Ic poll
272.\" .Op Ar n
273.\" .Op Ic verbose
274.\" Poll an NTP server in client mode
275.\" .Ar n
276.\" times.
277.It Ic quit
278Exit
279.Nm .
280.It Ic raw
281Causes all output from query commands is printed as received
282from the remote server.
283The only formating/interpretation done on
284the data is to transform nonascii data into a printable (but barely
285understandable) form.
286.It Ic timeout Ar milliseconds
287Specify a timeout period for responses to server queries.
288The
289default is about 5000 milliseconds.
290Note that since
291.Nm
292retries each query once after a timeout, the total waiting time for
293a timeout will be twice the timeout value set.
294.It Ic version
295Print the version of the
296.Nm
297program.
298.El
299.Ss "Control Message Commands"
300Association IDs are used to identify system, peer and clock variables.
301System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
302Most control commands send a single mode\-6 message to the server and expect a single response message.
303The exceptions are the
304.Li peers
305command, which sends a series of messages,
306and the
307.Li mreadlist
308and
309.Li mreadvar
310commands, which iterate over a range of associations.
311.Bl -tag -width "something" -compact -offset indent
312.It Cm associations
313Display a list of mobilized associations in the form:
314.Dl ind assid status conf reach auth condition last_event cnt
315.Bl -column -offset indent ".Sy Variable" ".Sy Description"
316.It Sy String Ta Sy Description
317.It Li ind Ta index on this list
318.It Li assid Ta association ID
319.It Li status Ta peer status word
320.It Li conf Ta Li yes : persistent, Li no : ephemeral
321.It Li reach Ta Li yes : reachable, Li no : unreachable
322.It Li auth Ta Li ok , Li yes , Li bad and Li none
323.It Li condition Ta selection status (see the Li select field of the peer status word)
324.It Li last_event Ta event report (see the Li event field of the peer status word)
325.It Li cnt Ta event count (see the Li count field of the peer status word)
326.El
327.It Cm authinfo
328Display the authentication statistics.
329.It Cm clockvar Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
330.It Cm cv Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
331Display a list of clock variables for those associations supporting a reference clock.
332.It Cm :config Op ...
333Send 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.
334.It Cm config\-from\-file Ar filename
335Send the each line of
336.Ar filename
337to 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.
338.It Ic ifstats
339Display statistics for each local network address. Authentication is required.
340.It Ic iostats
341Display network and reference clock I/O statistics.
342.It Ic kerninfo
343Display 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.
344.It Ic lassociations
345Perform the same function as the associations command, except display mobilized and unmobilized associations.
346.It Ic lopeers Xo
347.Oo Ic \-4 |
348.Ic \-6
349.Oc
350.Xc
351Obtain and print a list of all peers and clients showing
352.Ar dstadr
353(associated with any given IP version).
354.It Ic lpeers Xo
355.Oo Ic \-4 |
356.Ic \-6
357.Oc
358.Xc
359Print a peer spreadsheet for the appropriate IP version(s).
360.Ar dstadr
361(associated with any given IP version).
362.It Ic monstats
363Display monitor facility statistics.
364.It Ic mrulist Oo Ic limited | Ic kod | Ic mincount Ns = Ns Ar count | Ic laddr Ns = Ns Ar localaddr | Ic sort Ns = Ns Ar sortorder | Ic resany Ns = Ns Ar hexmask | Ic resall Ns = Ns Ar hexmask Oc
365Obtain and print traffic counts collected and maintained by the monitor facility.
366With the exception of
367.Cm sort Ns = Ns Ar sortorder ,
368the options filter the list returned by
369.Cm ntpd.
370The
371.Cm limited
372and
373.Cm kod
374options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
375The
376.Cm mincount Ns = Ns Ar count
377option filters entries representing less than
378.Ar count
379packets.
380The
381.Cm laddr Ns = Ns Ar localaddr
382option filters entries for packets received on any local address other than
383.Ar localaddr .
384.Cm resany Ns = Ns Ar hexmask
385and
386.Cm resall Ns = Ns Ar hexmask
387filter entries containing none or less than all, respectively, of the bits in
388.Ar hexmask ,
389which must begin with
390.Cm 0x .
391The
392.Ar sortorder
393defaults to
394.Cm lstint
395and may be any of
396.Cm addr ,
397.Cm count ,
398.Cm avgint ,
399.Cm lstint ,
400or any of those preceded by a minus sign (hyphen) to reverse the sort order.
401The output columns are:
402.Bl -tag -width "something" -compact -offset indent
403.It Column
404Description
405.It Ic lstint
406Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
407.Nm .
408.It Ic avgint
409Average interval in s between packets from this address.
410.It Ic rstr
411Restriction flags associated with this address.
412Most are copied unchanged from the matching
413.Ic restrict
414command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
415.It Ic r
416Rate control indicator, either
417a period,
418.Ic L
419or
420.Ic K
421for no rate control response,
422rate limiting by discarding, or rate limiting with a KoD response, respectively.
423.It Ic m
424Packet mode.
425.It Ic v
426Packet version number.
427.It Ic count
428Packets received from this address.
429.It Ic rport
430Source port of last packet from this address.
431.It Ic remote address
432DNS name, numeric address, or address followed by
433claimed DNS name which could not be verified in parentheses.
434.El
435.It Ic mreadvar assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
436.It Ic mrv assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
437Perform the same function as the
438.Ic readvar
439command, except for a range of association IDs.
440This range is determined from the association list cached by the most recent
441.Ic associations
442command.
443.It Ic opeers Xo
444.Oo Ic \-4 |
445.Ic \-6
446.Oc
447.Xc
448Obtain and print the old\-style list of all peers and clients showing
449.Ar dstadr
450(associated with any given IP version),
451rather than the
452.Ar refid .
453.It Ic passociations
454Perform the same function as the
455.Ic associations
456command,
457except that it uses previously stored data rather than making a new query.
458.It Ic peers
459Display a list of peers in the form:
460.Dl [tally]remote refid st t when pool reach delay offset jitter
461.Bl -tag -width "something" -compact -offset indent
462.It Variable
463Description
464.It Ic [tally]
465single\-character code indicating current value of the
466.Ic select
467field of the
468.Lk decode.html#peer "peer status word"
469.It Ic remote
470host name (or IP number) of peer.
471The value displayed will be truncated to 15 characters  unless the
472.Fl w
473flag is given, in which case the full value will be displayed
474on the first line,
475and the remaining data is displayed on the next line.
476.It Ic refid
477association ID or
478.Lk decode.html#kiss "'kiss code"
479.It Ic st
480stratum
481.It Ic t
482.Ic u :
483unicast or manycast client,
484.Ic b :
485broadcast or multicast client,
486.Ic l :
487local (reference clock),
488.Ic s :
489symmetric (peer),
490.Ic A :
491manycast server,
492.Ic B :
493broadcast server,
494.Ic M :
495multicast server
496.It Ic when
497sec/min/hr since last received packet
498.It Ic poll
499poll interval (log2 s)
500.It Ic reach
501reach shift register (octal)
502.It Ic delay
503roundtrip delay
504.It Ic offset
505offset of server relative to this host
506.It Ic jitter
507jitter
508.El
509.It Ic apeers
510Display a list of peers in the form:
511.Dl [tally]remote refid assid st t when pool reach delay offset jitter
512where the output is just like the
513.Ic peers
514command except that the
515.Ic refid
516is displayed in hex format and the association number is also displayed.
517.It Ic pstats Ar assocID
518Show the statistics for the peer with the given
519.Ar assocID .
520.It Ic readlist Ar assocID
521.It Ic rl Ar assocID
522Read the system or peer variables included in the variable list.
523.It Ic readvar Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc  Oo , ... Oc
524.It Ic rv Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc  Oo , ... Oc
525Display the specified variables.
526If
527.Ar assocID
528is zero, the variables are from the
529.Sx System Variables
530name space, otherwise they are from the
531.Sx Peer Variables
532name space.
533The
534.Ar assocID
535is required, as the same name can occur in both spaces.
536If no
537.Ar name
538is included, all operative variables in the name space are displayed.
539In this case only, if the
540.Ar assocID
541is omitted, it is assumed zero.
542Multiple names are specified with comma separators and without whitespace.
543Note that time values are represented in milliseconds
544and frequency values in parts\-per\-million (PPM).
545Some NTP timestamps are represented in the format
546YYYYMMDDTTTT ,
547where YYYY is the year,
548MM the month of year,
549DD the day of month and
550TTTT the time of day.
551.It Ic reslist
552Show the access control (restrict) list for
553.Nm .
554.It Ic saveconfig Ar filename
555Write the current configuration,
556including any runtime modifications given with
557.Ic :config
558or
559.Ic config\-from\-file ,
560to the ntpd host's file
561.Ar filename .
562This command will be rejected by the server unless
563.Lk miscopt.html#saveconfigdir "saveconfigdir"
564appears in the
565.Ic ntpd
566configuration file.
567.Ar filename
568can use
569.Xr strftime
570format specifies to substitute the current date and time, for example,
571.Ic q]saveconfig ntp\-%Y%m%d\-%H%M%S.confq] .
572The filename used is stored in system variable
573.Ic savedconfig .
574Authentication is required.
575.It Ic timerstats
576Display interval timer counters.
577.It Ic writelist Ar assocID
578Write the system or peer variables included in the variable list.
579.It Ic writevar Ar assocID Ar name Ns = Ns Ar value Op , ...
580Write the specified variables.
581If the
582.Ar assocID
583is zero, the variables are from the
584.Sx System Variables
585name space, otherwise they are from the
586.Sx Peer Variables
587name space.
588The
589.Ar assocID
590is required, as the same name can occur in both spaces.
591.It Ic sysinfo
592Display operational summary.
593.It Ic sysstats
594Print statistics counters maintained in the protocol module.
595.El
596.Ss Status Words and Kiss Codes
597The current state of the operating program is shown
598in a set of status words
599maintained by the system.
600Status information is also available on a per\-association basis.
601These words are displayed in the
602.Ic rv
603and
604.Ic as
605commands both in hexadecimal and in decoded short tip strings.
606The codes, tips and short explanations are documented on the
607.Lk decode.html "Event Messages and Status Words"
608page.
609The page also includes a list of system and peer messages,
610the code for the latest of which is included in the status word.
611.Pp
612Information resulting from protocol machine state transitions
613is displayed using an informal set of ASCII strings called
614.Lk decode.html#kiss "kiss codes" .
615The original purpose was for kiss\-o'\-death (KoD) packets
616sent by the server to advise the client of an unusual condition.
617They are now displayed, when appropriate,
618in the reference identifier field in various billboards.
619.Ss System Variables
620The following system variables appear in the
621.Ic rv
622billboard.
623Not all variables are displayed in some configurations.
624.Bl -tag -width "something" -compact -offset indent
625.It Variable
626Description
627.It Ic status
628.Lk decode.html#sys "system status word"
629.It Ic version
630NTP software version and build time
631.It Ic processor
632hardware platform and version
633.It Ic system
634operating system and version
635.It Ic leap
636leap warning indicator (0\-3)
637.It Ic stratum
638stratum (1\-15)
639.It Ic precision
640precision (log2 s)
641.It Ic rootdelay
642total roundtrip delay to the primary reference clock
643.It Ic rootdisp
644total dispersion to the primary reference clock
645.It Ic peer
646system peer association ID
647.It Ic tc
648time constant and poll exponent (log2 s) (3\-17)
649.It Ic mintc
650minimum time constant (log2 s) (3\-10)
651.It Ic clock
652date and time of day
653.It Ic refid
654reference ID or
655.Lk decode.html#kiss "kiss code"
656.It Ic reftime
657reference time
658.It Ic offset
659combined  offset of server relative to this host
660.It Ic sys_jitter
661combined system jitter
662.It Ic frequency
663frequency offset (PPM) relative to hardware clock
664.It Ic clk_wander
665clock frequency wander (PPM)
666.It Ic clk_jitter
667clock jitter
668.It Ic tai
669TAI\-UTC offset (s)
670.It Ic leapsec
671NTP seconds when the next leap second is/was inserted
672.It Ic expire
673NTP seconds when the NIST leapseconds file expires
674.El
675The jitter and wander statistics are exponentially\-weighted RMS averages.
676The system jitter is defined in the NTPv4 specification;
677the clock jitter statistic is computed by the clock discipline module.
678.Pp
679When the NTPv4 daemon is compiled with the OpenSSL software library,
680additional system variables are displayed,
681including some or all of the following,
682depending on the particular Autokey dance:
683.Bl -tag -width "something" -compact -offset indent
684.It Variable
685Description
686.It Ic host
687Autokey host name for this host
688.It Ic ident
689Autokey group name for this host
690.It Ic flags
691host flags  (see Autokey specification)
692.It Ic digest
693OpenSSL message digest algorithm
694.It Ic signature
695OpenSSL digest/signature scheme
696.It Ic update
697NTP seconds at last signature update
698.It Ic cert
699certificate subject, issuer and certificate flags
700.It Ic until
701NTP seconds when the certificate expires
702.El
703.Ss Peer Variables
704The following peer variables appear in the
705.Ic rv
706billboard for each association.
707Not all variables are displayed in some configurations.
708.Bl -tag -width "something" -compact -offset indent
709.It Variable
710Description
711.It Ic associd
712association ID
713.It Ic status
714.Lk decode.html#peer "peer status word"
715.It Ic srcadr
716source (remote) IP address
717.It Ic srcport
718source (remote) port
719.It Ic dstadr
720destination (local) IP address
721.It Ic dstport
722destination (local) port
723.It Ic leap
724leap indicator (0\-3)
725.It Ic stratum
726stratum (0\-15)
727.It Ic precision
728precision (log2 s)
729.It Ic rootdelay
730total roundtrip delay to the primary reference clock
731.It Ic rootdisp
732total root dispersion to the primary reference clock
733.It Ic refid
734reference ID or
735.Lk decode.html#kiss "kiss code"
736.It Ic reftime
737reference time
738.It Ic reach
739reach register (octal)
740.It Ic unreach
741unreach counter
742.It Ic hmode
743host mode (1\-6)
744.It Ic pmode
745peer mode (1\-5)
746.It Ic hpoll
747host poll exponent (log2 s) (3\-17)
748.It Ic ppoll
749peer poll exponent (log2 s) (3\-17)
750.It Ic headway
751headway (see
752.Lk rate.html "Rate Management and the Kiss\-o'\-Death Packet" )
753.It Ic flash
754.Lk decode.html#flash "flash status word"
755.It Ic offset
756filter offset
757.It Ic delay
758filter delay
759.It Ic dispersion
760filter dispersion
761.It Ic jitter
762filter jitter
763.It Ic ident
764Autokey group name for this association
765.It Ic bias
766unicast/broadcast bias
767.It Ic xleave
768interleave delay (see
769.Lk xleave.html "NTP Interleaved Modes" )
770.El
771The
772.Ic bias
773variable is calculated when the first broadcast packet is received
774after the calibration volley.
775It represents the offset of the broadcast subgraph relative to the unicast subgraph.
776The
777.Ic xleave
778variable appears only for the interleaved symmetric and interleaved modes.
779It represents the internal queuing, buffering and transmission delays
780for the preceding packet.
781.Pp
782When the NTPv4 daemon is compiled with the OpenSSL software library,
783additional peer variables are displayed, including the following:
784.Bl -tag -width "something" -compact -offset indent
785.It Variable
786Description
787.It Ic flags
788peer flags (see Autokey specification)
789.It Ic host
790Autokey server name
791.It Ic flags
792peer flags (see Autokey specification)
793.It Ic signature
794OpenSSL digest/signature scheme
795.It Ic initsequence
796initial key ID
797.It Ic initkey
798initial key index
799.It Ic timestamp
800Autokey signature timestamp
801.El
802.Ss Clock Variables
803The following clock variables appear in the
804.Ic cv
805billboard for each association with a reference clock.
806Not all variables are displayed in some configurations.
807.Bl -tag -width "something" -compact -offset indent
808.It Variable
809Description
810.It Ic associd
811association ID
812.It Ic status
813.Lk decode.html#clock "clock status word"
814.It Ic device
815device description
816.It Ic timecode
817ASCII time code string (specific to device)
818.It Ic poll
819poll messages sent
820.It Ic noreply
821no reply
822.It Ic badformat
823bad format
824.It Ic baddata
825bad date or time
826.It Ic fudgetime1
827fudge time 1
828.It Ic fudgetime2
829fudge time 2
830.It Ic stratum
831driver stratum
832.It Ic refid
833driver reference ID
834.It Ic flags
835driver flags
836.El
837.Sh "OPTIONS"
838.Bl -tag
839.It  Fl 4 , Fl \-ipv4 
840Force IPv4 DNS name resolution.
841This option must not appear in combination with any of the following options:
842ipv6.
843.sp
844Force DNS resolution of following host names on the command line
845to the IPv4 namespace.
846.It  Fl 6 , Fl \-ipv6 
847Force IPv6 DNS name resolution.
848This option must not appear in combination with any of the following options:
849ipv4.
850.sp
851Force DNS resolution of following host names on the command line
852to the IPv6 namespace.
853.It  Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd 
854run a command and exit.
855This option may appear an unlimited number of times.
856.sp
857The following argument is interpreted as an interactive format command
858and is added to the list of commands to be executed on the specified
859host(s).
860.It  Fl d , Fl \-debug\-level 
861Increase debug verbosity level.
862This option may appear an unlimited number of times.
863.sp
864.It  Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number 
865Set the debug verbosity level.
866This option may appear an unlimited number of times.
867This option takes an integer number as its argument.
868.sp
869.It  Fl i , Fl \-interactive 
870Force ntpq to operate in interactive mode.
871This option must not appear in combination with any of the following options:
872command, peers.
873.sp
874Force \fBntpq\fP to operate in interactive mode.
875Prompts will be written to the standard output and
876commands read from the standard input.
877.It  Fl n , Fl \-numeric 
878numeric host addresses.
879.sp
880Output all host addresses in dotted\-quad numeric format rather than
881converting to the canonical host names. 
882.It  Fl \-old\-rv 
883Always output status line with readvar.
884.sp
885By default, \fBntpq\fP now suppresses the \fBassocid=...\fP
886line that precedes the output of \fBreadvar\fP
887(alias \fBrv\fP) when a single variable is requested, such as
888\fBntpq \-c "rv 0 offset"\fP.
889This option causes \fBntpq\fP to include both lines of output
890for a single\-variable \fBreadvar\fP.
891Using an environment variable to
892preset this option in a script will enable both older and
893newer \fBntpq\fP to behave identically in this regard.
894.It  Fl p , Fl \-peers 
895Print a list of the peers.
896This option must not appear in combination with any of the following options:
897interactive.
898.sp
899Print a list of the peers known to the server as well as a summary
900of their state. This is equivalent to the 'peers' interactive command.
901.It  Fl r Ar keyword , Fl \-refid Ns = Ns Ar keyword 
902Set default display type for S2+ refids.
903This option takes a keyword as its argument.  The argument sets an enumeration value that can
904be tested by comparing them against the option value macro.
905The available keywords are:
906.in +4
907.nf
908.na
909hash ipv4
910.fi
911or their numeric equivalent.
912.in -4
913.sp
914The default
915.Ar keyword
916for this option is:
917.ti +4
918 ipv4
919.sp
920Set the default display format for S2+ refids.
921.It  Fl w , Fl \-wide 
922Display the full 'remote' value.
923.sp
924Display the full value of the 'remote' value.  If this requires
925more than 15 characters, display the full value, emit a newline,
926and continue the data display properly indented on the next line.
927.It Fl \&? , Fl \-help
928Display usage information and exit.
929.It Fl \&! , Fl \-more\-help
930Pass the extended usage information through a pager.
931.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
932Save the option state to \fIcfgfile\fP.  The default is the \fIlast\fP
933configuration file listed in the \fBOPTION PRESETS\fP section, below.
934The command will exit after updating the config file.
935.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
936Load options from \fIcfgfile\fP.
937The \fIno\-load\-opts\fP form will disable the loading
938of earlier config/rc/ini files.  \fI\-\-no\-load\-opts\fP is handled early,
939out of order.
940.It Fl \-version Op Brq Ar v|c|n
941Output version of program and exit.  The default mode is `v', a simple
942version.  The `c' mode will print copyright information and `n' will
943print the full copyright notice.
944.El
945.Sh "OPTION PRESETS"
946Any option that is not marked as \fInot presettable\fP may be preset
947by loading values from configuration ("RC" or ".INI") file(s) and values from
948environment variables named:
949.nf
950  \fBNTPQ_<option\-name>\fP or \fBNTPQ\fP
951.fi
952.ad
953The environmental presets take precedence (are processed later than)
954the configuration files.
955The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
956If any of these are directories, then the file \fI.ntprc\fP
957is searched for within those directories.
958.Sh "ENVIRONMENT"
959See \fBOPTION PRESETS\fP for configuration environment variables.
960.Sh "FILES"
961See \fBOPTION PRESETS\fP for configuration files.
962.Sh "EXIT STATUS"
963One of the following exit values will be returned:
964.Bl -tag
965.It 0 " (EXIT_SUCCESS)"
966Successful program execution.
967.It 1 " (EXIT_FAILURE)"
968The operation failed or the command syntax was not valid.
969.It 66 " (EX_NOINPUT)"
970A specified configuration file could not be loaded.
971.It 70 " (EX_SOFTWARE)"
972libopts had an internal operational error.  Please report
973it to autogen\-users@lists.sourceforge.net.  Thank you.
974.El
975.Sh "AUTHORS"
976The University of Delaware and Network Time Foundation
977.Sh "COPYRIGHT"
978Copyright (C) 1992\-2016 The University of Delaware and Network Time Foundation all rights reserved.
979This program is released under the terms of the NTP license, <http://ntp.org/license>.
980.Sh "BUGS"
981Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
982.Sh "NOTES"
983This manual page was \fIAutoGen\fP\-erated from the \fBntpq\fP
984option definitions.
985