ntpq.1ntpqmdoc revision 301256
1139825Simp.Dd June 2 2016
21541Srgrimes.Dt NTPQ 1ntpqmdoc User Commands
31541Srgrimes.Os
41541Srgrimes.\"  EDIT THIS FILE WITH CAUTION  (ntpq-opts.mdoc)
51541Srgrimes.\"
61541Srgrimes.\"  It has been AutoGen-ed  June  2, 2016 at 07:37:48 AM by AutoGen 5.18.5
71541Srgrimes.\"  From the definitions    ntpq-opts.def
81541Srgrimes.\"  and the template file   agmdoc-cmd.tpl
91541Srgrimes.Sh NAME
101541Srgrimes.Nm ntpq
111541Srgrimes.Nd standard NTP query program
121541Srgrimes.Sh SYNOPSIS
131541Srgrimes.Nm
141541Srgrimes.\" Mixture of short (flag) options and long options
151541Srgrimes.Op Fl flags
161541Srgrimes.Op Fl flag Op Ar value
171541Srgrimes.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
181541Srgrimes[ host ...]
191541Srgrimes.Pp
201541Srgrimes.Sh DESCRIPTION
211541SrgrimesThe
221541Srgrimes.Nm
231541Srgrimesutility program is used to query NTP servers which
241541Srgrimesimplement the standard NTP mode 6 control message formats defined
251541Srgrimesin Appendix B of the NTPv3 specification RFC1305, requesting
261541Srgrimesinformation about current state and/or changes in that state.
271541SrgrimesThe same formats are used in NTPv4, although some of the
281541Srgrimesvariables have changed and new ones added. The description on this
291541Srgrimespage is for the NTPv4 variables.
3050477SpeterThe program may be run either in interactive mode or controlled using
311541Srgrimescommand line arguments.
321541SrgrimesRequests to read and write arbitrary
332165Spaulvariables can be assembled, with raw and pretty\-printed output
342165Spauloptions being available.
352165SpaulThe
361541Srgrimes.Nm
3755205Speterutility can also obtain and print a
381541Srgrimeslist of peers in a common format by sending multiple queries to the
3918207Sbdeserver.
401541SrgrimesIf one or more request options is included on the command line
411541Srgrimeswhen
421541Srgrimes.Nm
431541Srgrimesis executed, each of the requests will be sent
4492047Sddto the NTP servers running on each of the hosts given as command
4581202Sjhbline arguments, or on localhost by default.
4676166SmarkmIf no request options
4711913Sphkare given,
4812685Speter.Nm
4912685Speterwill attempt to read commands from the
5012685Speterstandard input and execute these on the NTP server running on the
5112685Speterfirst host given on the command line, again defaulting to localhost
5255205Speterwhen no other host is specified.
5334924SbdeThe
541541Srgrimes.Nm
5534924Sbdeutility will prompt for
5634924Sbdecommands if the standard input is a terminal device.
571541Srgrimes.Nm
5834924Sbdeuses NTP mode 6 packets to communicate with the
591541SrgrimesNTP server, and hence can be used to query any compatible server on
601541Srgrimesthe network which permits it.
6169896SmckusickNote that since NTP is a UDP protocol
6269896Smckusickthis communication will be somewhat unreliable, especially over
63147188Sgadlarge distances in terms of network topology.
64147188SgadThe
65147188Sgad.Nm
66147188Sgadutility makes
67147188Sgadone attempt to retransmit requests, and will time requests out if
68147188Sgadthe remote host is not heard from within a suitable timeout
69147188Sgadtime.
70147188SgadSpecifying a
71130825Sgadcommand line option other than
72147188Sgad.Fl i
73147188Sgador
74147188Sgad.Fl n
75147188Sgadwill
76147188Sgadcause the specified query (queries) to be sent to the indicated
77147188Sgadhost(s) immediately.
78147188SgadOtherwise,
79147188Sgad.Nm
8011865Sphkwill attempt to read
81147188Sgadinteractive format commands from the standard input.
82147188Sgad.Ss "Internal Commands"
83147188SgadInteractive format commands consist of a keyword followed by zero
84130825Sgadto four arguments.
85130825SgadOnly enough characters of the full keyword to
86147188Sgaduniquely identify the command need be typed.
8774022SdfrA
88130825Sgadnumber of interactive format commands are executed entirely within
89147188Sgadthe
9071040Smjacob.Nm
91130825Sgadutility itself and do not result in NTP mode 6
92147188Sgadrequests being sent to a server.
9377956SbennoThese are described following.
94130825Sgad.Bl -tag -width "? [command_keyword]" -compact -offset indent
95147188Sgad.It Ic ? Op  Ar command_keyword
9674022Sdfr.It Ic help Op Ar command_keyword
97130825SgadA
98147188Sgad.Ql \&?
99130825Sgadby itself will print a list of all the command
100130825Sgadkeywords known to this incarnation of
101147188Sgad.Nm .
102130825SgadA
103130825Sgad.Ql \&?
104147188Sgadfollowed by a command keyword will print function and usage
105130825Sgadinformation about the command.
106130825SgadThis command is probably a better
107130825Sgadsource of information about
108130825Sgad.Nm
109130825Sgadthan this manual
11069896Smckusickpage.
111104387Sjhb.It Ic addvars Ar variable_name Ns Xo Op Ic =value
11281759Speter.Ic ...
11381759Speter.Xc
114130726Sgad.It Ic rmvars Ar variable_name Ic ...
11581759Speter.It Ic clearvars
11681759Speter.It Ic showvars
11769896SmckusickThe data carried by NTP mode 6 messages consists of a list of
11811865Sphkitems of the form
11969896Smckusick.Ql variable_name=value ,
12072415Sphkwhere the
12169896Smckusick.Ql =value
12269896Smckusickis ignored, and can be omitted,
12369896Smckusickin requests to the server to read variables.
12469896SmckusickThe
12569896Smckusick.Nm
12669896Smckusickutility maintains an internal list in which data to be included in control
12769896Smckusickmessages can be assembled, and sent using the
12869896Smckusick.Ic readlist
12969896Smckusickand
13069896Smckusick.Ic writelist
13169896Smckusickcommands described below.
13269896SmckusickThe
13369896Smckusick.Ic addvars
13469896Smckusickcommand allows variables and their optional values to be added to
13569896Smckusickthe list.
136130726SgadIf more than one variable is to be added, the list should
137130640Sphkbe comma\-separated and not contain white space.
13869896SmckusickThe
13969896Smckusick.Ic rmvars
14069896Smckusickcommand can be used to remove individual variables from the list,
14169896Smckusickwhile the
14269896Smckusick.Ic clearlist
14369896Smckusickcommand removes all variables from the
14469896Smckusicklist.
14569896SmckusickThe
14669896Smckusick.Ic showvars
14769896Smckusickcommand displays the current list of optional variables.
148130726Sgad.It Ic authenticate Op yes | no
14981759SpeterNormally
15069896Smckusick.Nm
15169896Smckusickdoes not authenticate requests unless
15269896Smckusickthey are write requests.
15369896SmckusickThe command
15469896Smckusick.Ql authenticate yes
15569896Smckusickcauses
15669896Smckusick.Nm
15769896Smckusickto send authentication with all requests it
15869896Smckusickmakes.
15969896SmckusickAuthenticated requests causes some servers to handle
16069896Smckusickrequests slightly differently, and can occasionally melt the CPU in
16169896Smckusickfuzzballs if you turn authentication on before doing a
162147188Sgad.Ic peer
16369896Smckusickdisplay.
16469896SmckusickThe command
16569896Smckusick.Ql authenticate
16669896Smckusickcauses
16769896Smckusick.Nm
16869896Smckusickto display whether or not
16969896Smckusick.Nm
170124829Sgrehanis currently autheinticating requests.
17169896Smckusick.It Ic cooked
17269896SmckusickCauses output from query commands to be "cooked", so that
17369896Smckusickvariables which are recognized by
17469896Smckusick.Nm
17581759Speterwill have their
17669896Smckusickvalues reformatted for human consumption.
17781759SpeterVariables which
178104387Sjhb.Nm
17981759Speterthinks should have a decodable value but didn't are
180130726Sgadmarked with a trailing
181147188Sgad.Ql \&? .
182147188Sgad.It Xo
183147188Sgad.Ic debug
184147188Sgad.Oo
185147188Sgad.Cm more |
186130726Sgad.Cm less |
187147188Sgad.Cm off
188147188Sgad.Oc
189147188Sgad.Xc
190147188SgadWith no argument, displays the current debug level.
191147188SgadOtherwise, the debug level is changed to the indicated level.
19269896Smckusick.It Ic delay Ar milliseconds
193147188SgadSpecify a time interval to be added to timestamps included in
194147188Sgadrequests which require authentication.
19583366SjulianThis is used to enable
19683366Sjulian(unreliable) server reconfiguration over long delay network paths
197132014Salfredor between machines whose clocks are unsynchronized.
198147188SgadActually the
199147188Sgadserver does not now require timestamps in authenticated requests,
200147188Sgadso this command may be obsolete.
201147188Sgad.It Ic exit
202147188SgadExit
203147188Sgad.Nm .
204147188Sgad.It Ic host Ar hostname
205147188SgadSet the host to which future queries will be sent.
206147188Sgad.Ar hostname
20711865Sphkmay be either a host name or a numeric address.
20892719Salfred.It Ic hostnames Op Cm yes | Cm no
209147188SgadIf
210147188Sgad.Cm yes
211147188Sgadis specified, host names are printed in
21211865Sphkinformation displays.
21369896SmckusickIf
21469896Smckusick.Cm no
21569896Smckusickis specified, numeric
216104387Sjhbaddresses are printed instead.
21711865SphkThe default is
21811865Sphk.Cm yes ,
219137920Sdasunless
220137920Sdasmodified using the command line
221137920Sdas.Fl n
2221541Srgrimesswitch.
22383421Sobrien.It Ic keyid Ar keyid
22483366SjulianThis command allows the specification of a key number to be
22583366Sjulianused to authenticate configuration requests.
2261541SrgrimesThis must correspond
2271541Srgrimesto the
22837689Sdfr.Cm controlkey
229key number the server has been configured to use for this
230purpose.
231.It Ic keytype Xo Oo
232.Cm md5 |
233.Cm OpenSSLDigestType
234.Oc
235.Xc
236Specify the type of key to use for authenticating requests.
237.Cm md5
238is alway supported.
239If
240.Nm
241was built with OpenSSL support,
242any digest type supported by OpenSSL can also be provided.
243If no argument is given, the current
244.Ic keytype
245is displayed.
246.It Ic ntpversion Xo Oo
247.Cm 1 |
248.Cm 2 |
249.Cm 3 |
250.Cm 4
251.Oc
252.Xc
253Sets the NTP version number which
254.Nm
255claims in
256packets.
257Defaults to 3, and note that mode 6 control messages (and
258modes, for that matter) didn't exist in NTP version 1.
259There 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