1316722Sdelphij.Dd March 21 2017
2275970Scy.Dt NTPQ @NTPQ_MS@ User Commands
3275970Scy.Os
4275970Scy.\"  EDIT THIS FILE WITH CAUTION  (ntpq-opts.mdoc)
5275970Scy.\"
6316722Sdelphij.\"  It has been AutoGen-ed  March 21, 2017 at 10:45:31 AM by AutoGen 5.18.5
7275970Scy.\"  From the definitions    ntpq-opts.def
8275970Scy.\"  and the template file   agmdoc-cmd.tpl
9275970Scy.Sh NAME
10275970Scy.Nm ntpq
11275970Scy.Nd standard NTP query program
12275970Scy.Sh SYNOPSIS
13275970Scy.Nm
14275970Scy.\" Mixture of short (flag) options and long options
15275970Scy.Op Fl flags
16275970Scy.Op Fl flag Op Ar value
17275970Scy.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
18275970Scy[ host ...]
19275970Scy.Pp
20275970Scy.Sh DESCRIPTION
21275970ScyThe
22275970Scy.Nm
23275970Scyutility program is used to query NTP servers which
24275970Scyimplement the standard NTP mode 6 control message formats defined
25275970Scyin Appendix B of the NTPv3 specification RFC1305, requesting
26275970Scyinformation about current state and/or changes in that state.
27275970ScyThe same formats are used in NTPv4, although some of the
28275970Scyvariables have changed and new ones added. The description on this
29275970Scypage is for the NTPv4 variables.
30275970ScyThe program may be run either in interactive mode or controlled using
31275970Scycommand line arguments.
32275970ScyRequests to read and write arbitrary
33275970Scyvariables can be assembled, with raw and pretty\-printed output
34275970Scyoptions being available.
35275970ScyThe
36275970Scy.Nm
37275970Scyutility can also obtain and print a
38275970Scylist of peers in a common format by sending multiple queries to the
39275970Scyserver.
40275970ScyIf one or more request options is included on the command line
41275970Scywhen
42275970Scy.Nm
43275970Scyis executed, each of the requests will be sent
44275970Scyto the NTP servers running on each of the hosts given as command
45275970Scyline arguments, or on localhost by default.
46275970ScyIf no request options
47275970Scyare given,
48275970Scy.Nm
49275970Scywill attempt to read commands from the
50275970Scystandard input and execute these on the NTP server running on the
51275970Scyfirst host given on the command line, again defaulting to localhost
52275970Scywhen no other host is specified.
53275970ScyThe
54275970Scy.Nm
55275970Scyutility will prompt for
56275970Scycommands if the standard input is a terminal device.
57275970Scy.Nm
58275970Scyuses NTP mode 6 packets to communicate with the
59275970ScyNTP server, and hence can be used to query any compatible server on
60275970Scythe network which permits it.
61275970ScyNote that since NTP is a UDP protocol
62275970Scythis communication will be somewhat unreliable, especially over
63275970Scylarge distances in terms of network topology.
64275970ScyThe
65275970Scy.Nm
66275970Scyutility makes
67275970Scyone attempt to retransmit requests, and will time requests out if
68275970Scythe remote host is not heard from within a suitable timeout
69275970Scytime.
70275970ScySpecifying a
71275970Scycommand line option other than
72275970Scy.Fl i
73275970Scyor
74275970Scy.Fl n
75275970Scywill
76275970Scycause the specified query (queries) to be sent to the indicated
77275970Scyhost(s) immediately.
78275970ScyOtherwise,
79275970Scy.Nm
80275970Scywill attempt to read
81275970Scyinteractive format commands from the standard input.
82275970Scy.Ss "Internal Commands"
83275970ScyInteractive format commands consist of a keyword followed by zero
84275970Scyto four arguments.
85275970ScyOnly enough characters of the full keyword to
86275970Scyuniquely identify the command need be typed.
87275970ScyA
88275970Scynumber of interactive format commands are executed entirely within
89275970Scythe
90275970Scy.Nm
91275970Scyutility itself and do not result in NTP mode 6
92275970Scyrequests being sent to a server.
93275970ScyThese are described following.
94275970Scy.Bl -tag -width "? [command_keyword]" -compact -offset indent
95275970Scy.It Ic ? Op  Ar command_keyword
96275970Scy.It Ic help Op Ar command_keyword
97275970ScyA
98275970Scy.Ql \&?
99275970Scyby itself will print a list of all the command
100275970Scykeywords known to this incarnation of
101275970Scy.Nm .
102275970ScyA
103275970Scy.Ql \&?
104275970Scyfollowed by a command keyword will print function and usage
105275970Scyinformation about the command.
106275970ScyThis command is probably a better
107275970Scysource of information about
108275970Scy.Nm
109275970Scythan this manual
110275970Scypage.
111275970Scy.It Ic addvars Ar variable_name Ns Xo Op Ic =value
112275970Scy.Ic ...
113275970Scy.Xc
114275970Scy.It Ic rmvars Ar variable_name Ic ...
115275970Scy.It Ic clearvars
116275970Scy.It Ic showvars
117275970ScyThe data carried by NTP mode 6 messages consists of a list of
118275970Scyitems of the form
119275970Scy.Ql variable_name=value ,
120275970Scywhere the
121275970Scy.Ql =value
122275970Scyis ignored, and can be omitted,
123275970Scyin requests to the server to read variables.
124275970ScyThe
125275970Scy.Nm
126275970Scyutility maintains an internal list in which data to be included in control
127275970Scymessages can be assembled, and sent using the
128275970Scy.Ic readlist
129275970Scyand
130275970Scy.Ic writelist
131275970Scycommands described below.
132275970ScyThe
133275970Scy.Ic addvars
134275970Scycommand allows variables and their optional values to be added to
135275970Scythe list.
136275970ScyIf more than one variable is to be added, the list should
137275970Scybe comma\-separated and not contain white space.
138275970ScyThe
139275970Scy.Ic rmvars
140275970Scycommand can be used to remove individual variables from the list,
141275970Scywhile the
142275970Scy.Ic clearlist
143275970Scycommand removes all variables from the
144275970Scylist.
145275970ScyThe
146275970Scy.Ic showvars
147275970Scycommand displays the current list of optional variables.
148275970Scy.It Ic authenticate Op yes | no
149275970ScyNormally
150275970Scy.Nm
151275970Scydoes not authenticate requests unless
152275970Scythey are write requests.
153275970ScyThe command
154275970Scy.Ql authenticate yes
155275970Scycauses
156275970Scy.Nm
157275970Scyto send authentication with all requests it
158275970Scymakes.
159275970ScyAuthenticated requests causes some servers to handle
160275970Scyrequests slightly differently, and can occasionally melt the CPU in
161275970Scyfuzzballs if you turn authentication on before doing a
162275970Scy.Ic peer
163275970Scydisplay.
164275970ScyThe command
165275970Scy.Ql authenticate
166275970Scycauses
167275970Scy.Nm
168275970Scyto display whether or not
169275970Scy.Nm
170275970Scyis currently autheinticating requests.
171275970Scy.It Ic cooked
172275970ScyCauses output from query commands to be "cooked", so that
173275970Scyvariables which are recognized by
174275970Scy.Nm
175275970Scywill have their
176275970Scyvalues reformatted for human consumption.
177275970ScyVariables which
178275970Scy.Nm
179275970Scythinks should have a decodable value but didn't are
180275970Scymarked with a trailing
181275970Scy.Ql \&? .
182275970Scy.It Xo
183275970Scy.Ic debug
184275970Scy.Oo
185275970Scy.Cm more |
186275970Scy.Cm less |
187275970Scy.Cm off
188275970Scy.Oc
189275970Scy.Xc
190275970ScyWith no argument, displays the current debug level.
191275970ScyOtherwise, the debug level is changed to the indicated level.
192275970Scy.It Ic delay Ar milliseconds
193275970ScySpecify a time interval to be added to timestamps included in
194275970Scyrequests which require authentication.
195275970ScyThis is used to enable
196275970Scy(unreliable) server reconfiguration over long delay network paths
197275970Scyor between machines whose clocks are unsynchronized.
198275970ScyActually the
199275970Scyserver does not now require timestamps in authenticated requests,
200275970Scyso this command may be obsolete.
201275970Scy.It Ic exit
202275970ScyExit
203275970Scy.Nm .
204275970Scy.It Ic host Ar hostname
205275970ScySet the host to which future queries will be sent.
206275970Scy.Ar hostname
207275970Scymay be either a host name or a numeric address.
208275970Scy.It Ic hostnames Op Cm yes | Cm no
209275970ScyIf
210275970Scy.Cm yes
211275970Scyis specified, host names are printed in
212275970Scyinformation displays.
213275970ScyIf
214275970Scy.Cm no
215275970Scyis specified, numeric
216275970Scyaddresses are printed instead.
217275970ScyThe default is
218275970Scy.Cm yes ,
219275970Scyunless
220275970Scymodified using the command line
221275970Scy.Fl n
222275970Scyswitch.
223275970Scy.It Ic keyid Ar keyid
224275970ScyThis command allows the specification of a key number to be
225275970Scyused to authenticate configuration requests.
226275970ScyThis must correspond
227285169Scyto the
228285169Scy.Cm controlkey
229285169Scykey number the server has been configured to use for this
230275970Scypurpose.
231275970Scy.It Ic keytype Xo Oo
232275970Scy.Cm md5 |
233275970Scy.Cm OpenSSLDigestType
234275970Scy.Oc
235275970Scy.Xc
236275970ScySpecify the type of key to use for authenticating requests.
237275970Scy.Cm md5
238275970Scyis alway supported.
239275970ScyIf
240275970Scy.Nm
241275970Scywas built with OpenSSL support,
242275970Scyany digest type supported by OpenSSL can also be provided.
243275970ScyIf no argument is given, the current
244275970Scy.Ic keytype
245275970Scyis displayed.
246275970Scy.It Ic ntpversion Xo Oo
247275970Scy.Cm 1 |
248275970Scy.Cm 2 |
249275970Scy.Cm 3 |
250275970Scy.Cm 4
251275970Scy.Oc
252275970Scy.Xc
253275970ScySets the NTP version number which
254275970Scy.Nm
255275970Scyclaims in
256275970Scypackets.
257275970ScyDefaults to 3, and note that mode 6 control messages (and
258275970Scymodes, for that matter) didn't exist in NTP version 1.
259275970ScyThere appear
260275970Scyto be no servers left which demand version 1.
261275970ScyWith no argument, displays the current NTP version that will be used
262275970Scywhen communicating with servers.
263275970Scy.It Ic passwd
264275970ScyThis command prompts you to type in a password (which will not
265275970Scybe echoed) which will be used to authenticate configuration
266275970Scyrequests.
267275970ScyThe password must correspond to the key configured for
268275970Scyuse by the NTP server for this purpose if such requests are to be
269275970Scysuccessful.
270275970Scy.\" Not yet implemented.
271275970Scy.\" .It Ic poll
272275970Scy.\" .Op Ar n
273275970Scy.\" .Op Ic verbose
274275970Scy.\" Poll an NTP server in client mode
275275970Scy.\" .Ar n
276275970Scy.\" times.
277275970Scy.It Ic quit
278275970ScyExit
279275970Scy.Nm .
280275970Scy.It Ic raw
281275970ScyCauses all output from query commands is printed as received
282275970Scyfrom the remote server.
283275970ScyThe only formating/interpretation done on
284275970Scythe data is to transform nonascii data into a printable (but barely
285275970Scyunderstandable) form.
286275970Scy.It Ic timeout Ar milliseconds
287275970ScySpecify a timeout period for responses to server queries.
288275970ScyThe
289275970Scydefault is about 5000 milliseconds.
290275970ScyNote that since
291275970Scy.Nm
292275970Scyretries each query once after a timeout, the total waiting time for
293275970Scya timeout will be twice the timeout value set.
294275970Scy.It Ic version
295275970ScyPrint the version of the
296275970Scy.Nm
297275970Scyprogram.
298275970Scy.El
299275970Scy.Ss "Control Message Commands"
300275970ScyAssociation IDs are used to identify system, peer and clock variables.
301275970ScySystem variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
302275970ScyMost control commands send a single mode\-6 message to the server and expect a single response message.
303275970ScyThe exceptions are the
304275970Scy.Li peers
305275970Scycommand, which sends a series of messages,
306275970Scyand the
307275970Scy.Li mreadlist
308275970Scyand
309275970Scy.Li mreadvar
310275970Scycommands, which iterate over a range of associations.
311275970Scy.Bl -tag -width "something" -compact -offset indent
312275970Scy.It Cm associations
313275970ScyDisplay a list of mobilized associations in the form:
314275970Scy.Dl ind assid status conf reach auth condition last_event cnt
315275970Scy.Bl -column -offset indent ".Sy Variable" ".Sy Description"
316275970Scy.It Sy String Ta Sy Description
317275970Scy.It Li ind Ta index on this list
318275970Scy.It Li assid Ta association ID
319275970Scy.It Li status Ta peer status word
320275970Scy.It Li conf Ta Li yes : persistent, Li no : ephemeral
321275970Scy.It Li reach Ta Li yes : reachable, Li no : unreachable
322275970Scy.It Li auth Ta Li ok , Li yes , Li bad and Li none
323275970Scy.It Li condition Ta selection status (see the Li select field of the peer status word)
324275970Scy.It Li last_event Ta event report (see the Li event field of the peer status word)
325275970Scy.It Li cnt Ta event count (see the Li count field of the peer status word)
326275970Scy.El
327275970Scy.It Cm authinfo
328275970ScyDisplay the authentication statistics.
329275970Scy.It Cm clockvar Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
330275970Scy.It Cm cv Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
331275970ScyDisplay a list of clock variables for those associations supporting a reference clock.
332275970Scy.It Cm :config Op ...
333275970ScySend 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.
334275970Scy.It Cm config\-from\-file Ar filename
335275970ScySend the each line of
336275970Scy.Ar filename
337275970Scyto 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.
338275970Scy.It Ic ifstats
339275970ScyDisplay statistics for each local network address. Authentication is required.
340275970Scy.It Ic iostats
341275970ScyDisplay network and reference clock I/O statistics.
342275970Scy.It Ic kerninfo
343275970ScyDisplay 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.
344275970Scy.It Ic lassociations
345275970ScyPerform the same function as the associations command, except display mobilized and unmobilized associations.
346275970Scy.It Ic lopeers Xo
347275970Scy.Oo Ic \-4 |
348275970Scy.Ic \-6
349275970Scy.Oc
350275970Scy.Xc
351275970ScyObtain and print a list of all peers and clients showing
352275970Scy.Ar dstadr
353275970Scy(associated with any given IP version).
354275970Scy.It Ic lpeers Xo
355275970Scy.Oo Ic \-4 |
356275970Scy.Ic \-6
357275970Scy.Oc
358275970Scy.Xc
359275970ScyPrint a peer spreadsheet for the appropriate IP version(s).
360275970Scy.Ar dstadr
361275970Scy(associated with any given IP version).
362275970Scy.It Ic monstats
363275970ScyDisplay monitor facility statistics.
364275970Scy.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
365275970ScyObtain and print traffic counts collected and maintained by the monitor facility.
366275970ScyWith the exception of
367275970Scy.Cm sort Ns = Ns Ar sortorder ,
368275970Scythe options filter the list returned by
369275970Scy.Cm ntpd.
370275970ScyThe
371275970Scy.Cm limited
372275970Scyand
373275970Scy.Cm kod
374275970Scyoptions return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
375275970ScyThe
376275970Scy.Cm mincount Ns = Ns Ar count
377275970Scyoption filters entries representing less than
378275970Scy.Ar count
379275970Scypackets.
380275970ScyThe
381275970Scy.Cm laddr Ns = Ns Ar localaddr
382275970Scyoption filters entries for packets received on any local address other than
383275970Scy.Ar localaddr .
384275970Scy.Cm resany Ns = Ns Ar hexmask
385275970Scyand
386275970Scy.Cm resall Ns = Ns Ar hexmask
387275970Scyfilter entries containing none or less than all, respectively, of the bits in
388275970Scy.Ar hexmask ,
389275970Scywhich must begin with
390275970Scy.Cm 0x .
391275970ScyThe
392275970Scy.Ar sortorder
393275970Scydefaults to
394275970Scy.Cm lstint
395275970Scyand may be any of
396275970Scy.Cm addr ,
397275970Scy.Cm count ,
398275970Scy.Cm avgint ,
399275970Scy.Cm lstint ,
400275970Scyor any of those preceded by a minus sign (hyphen) to reverse the sort order.
401275970ScyThe output columns are:
402275970Scy.Bl -tag -width "something" -compact -offset indent
403275970Scy.It Column
404275970ScyDescription
405275970Scy.It Ic lstint
406275970ScyInterval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
407275970Scy.Nm .
408275970Scy.It Ic avgint
409275970ScyAverage interval in s between packets from this address.
410275970Scy.It Ic rstr
411275970ScyRestriction flags associated with this address.
412275970ScyMost are copied unchanged from the matching
413275970Scy.Ic restrict
414275970Scycommand, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
415275970Scy.It Ic r
416275970ScyRate control indicator, either
417275970Scya period,
418275970Scy.Ic L
419275970Scyor
420275970Scy.Ic K
421275970Scyfor no rate control response,
422275970Scyrate limiting by discarding, or rate limiting with a KoD response, respectively.
423275970Scy.It Ic m
424275970ScyPacket mode.
425275970Scy.It Ic v
426275970ScyPacket version number.
427275970Scy.It Ic count
428275970ScyPackets received from this address.
429275970Scy.It Ic rport
430275970ScySource port of last packet from this address.
431275970Scy.It Ic remote address
432275970ScyDNS name, numeric address, or address followed by
433275970Scyclaimed DNS name which could not be verified in parentheses.
434275970Scy.El
435275970Scy.It Ic mreadvar assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
436275970Scy.It Ic mrv assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
437275970ScyPerform the same function as the
438275970Scy.Ic readvar
439275970Scycommand, except for a range of association IDs.
440275970ScyThis range is determined from the association list cached by the most recent
441275970Scy.Ic associations
442275970Scycommand.
443275970Scy.It Ic opeers Xo
444275970Scy.Oo Ic \-4 |
445275970Scy.Ic \-6
446275970Scy.Oc
447275970Scy.Xc
448275970ScyObtain and print the old\-style list of all peers and clients showing
449275970Scy.Ar dstadr
450275970Scy(associated with any given IP version),
451275970Scyrather than the
452275970Scy.Ar refid .
453275970Scy.It Ic passociations
454275970ScyPerform the same function as the
455275970Scy.Ic associations
456275970Scycommand,
457275970Scyexcept that it uses previously stored data rather than making a new query.
458275970Scy.It Ic peers
459275970ScyDisplay a list of peers in the form:
460275970Scy.Dl [tally]remote refid st t when pool reach delay offset jitter
461275970Scy.Bl -tag -width "something" -compact -offset indent
462275970Scy.It Variable
463275970ScyDescription
464275970Scy.It Ic [tally]
465275970Scysingle\-character code indicating current value of the
466275970Scy.Ic select
467275970Scyfield of the
468275970Scy.Lk decode.html#peer "peer status word"
469275970Scy.It Ic remote
470275970Scyhost name (or IP number) of peer.
471275970ScyThe value displayed will be truncated to 15 characters  unless the
472275970Scy.Fl w
473275970Scyflag is given, in which case the full value will be displayed
474275970Scyon the first line,
475275970Scyand the remaining data is displayed on the next line.
476275970Scy.It Ic refid
477275970Scyassociation ID or
478275970Scy.Lk decode.html#kiss "'kiss code"
479275970Scy.It Ic st
480275970Scystratum
481275970Scy.It Ic t
482275970Scy.Ic u :
483275970Scyunicast or manycast client,
484275970Scy.Ic b :
485275970Scybroadcast or multicast client,
486275970Scy.Ic l :
487275970Scylocal (reference clock),
488275970Scy.Ic s :
489275970Scysymmetric (peer),
490275970Scy.Ic A :
491275970Scymanycast server,
492275970Scy.Ic B :
493275970Scybroadcast server,
494275970Scy.Ic M :
495275970Scymulticast server
496275970Scy.It Ic when
497275970Scysec/min/hr since last received packet
498275970Scy.It Ic poll
499275970Scypoll interval (log2 s)
500275970Scy.It Ic reach
501275970Scyreach shift register (octal)
502275970Scy.It Ic delay
503275970Scyroundtrip delay
504275970Scy.It Ic offset
505275970Scyoffset of server relative to this host
506275970Scy.It Ic jitter
507275970Scyjitter
508275970Scy.El
509285169Scy.It Ic apeers
510285169ScyDisplay a list of peers in the form:
511285169Scy.Dl [tally]remote refid assid st t when pool reach delay offset jitter
512285169Scywhere the output is just like the
513285169Scy.Ic peers
514285169Scycommand except that the
515285169Scy.Ic refid
516285169Scyis displayed in hex format and the association number is also displayed.
517275970Scy.It Ic pstats Ar assocID
518275970ScyShow the statistics for the peer with the given
519275970Scy.Ar assocID .
520275970Scy.It Ic readlist Ar assocID
521275970Scy.It Ic rl Ar assocID
522275970ScyRead the system or peer variables included in the variable list.
523275970Scy.It Ic readvar Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc  Oo , ... Oc
524275970Scy.It Ic rv Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc  Oo , ... Oc
525275970ScyDisplay the specified variables.
526275970ScyIf
527275970Scy.Ar assocID
528275970Scyis zero, the variables are from the
529275970Scy.Sx System Variables
530275970Scyname space, otherwise they are from the
531275970Scy.Sx Peer Variables
532275970Scyname space.
533275970ScyThe
534275970Scy.Ar assocID
535275970Scyis required, as the same name can occur in both spaces.
536275970ScyIf no
537275970Scy.Ar name
538275970Scyis included, all operative variables in the name space are displayed.
539275970ScyIn this case only, if the
540275970Scy.Ar assocID
541275970Scyis omitted, it is assumed zero.
542275970ScyMultiple names are specified with comma separators and without whitespace.
543275970ScyNote that time values are represented in milliseconds
544275970Scyand frequency values in parts\-per\-million (PPM).
545275970ScySome NTP timestamps are represented in the format
546275970ScyYYYYMMDDTTTT ,
547275970Scywhere YYYY is the year,
548275970ScyMM the month of year,
549275970ScyDD the day of month and
550275970ScyTTTT the time of day.
551275970Scy.It Ic reslist
552275970ScyShow the access control (restrict) list for
553275970Scy.Nm .
554275970Scy.It Ic saveconfig Ar filename
555275970ScyWrite the current configuration,
556275970Scyincluding any runtime modifications given with
557275970Scy.Ic :config
558275970Scyor
559275970Scy.Ic config\-from\-file ,
560275970Scyto the ntpd host's file
561275970Scy.Ar filename .
562275970ScyThis command will be rejected by the server unless
563275970Scy.Lk miscopt.html#saveconfigdir "saveconfigdir"
564275970Scyappears in the
565275970Scy.Ic ntpd
566275970Scyconfiguration file.
567275970Scy.Ar filename
568275970Scycan use
569275970Scy.Xr strftime
570275970Scyformat specifies to substitute the current date and time, for example,
571275970Scy.Ic q]saveconfig ntp\-%Y%m%d\-%H%M%S.confq] .
572275970ScyThe filename used is stored in system variable
573275970Scy.Ic savedconfig .
574275970ScyAuthentication is required.
575275970Scy.It Ic timerstats
576275970ScyDisplay interval timer counters.
577275970Scy.It Ic writelist Ar assocID
578275970ScyWrite the system or peer variables included in the variable list.
579275970Scy.It Ic writevar Ar assocID Ar name Ns = Ns Ar value Op , ...
580275970ScyWrite the specified variables.
581275970ScyIf the
582275970Scy.Ar assocID
583275970Scyis zero, the variables are from the
584275970Scy.Sx System Variables
585275970Scyname space, otherwise they are from the
586275970Scy.Sx Peer Variables
587275970Scyname space.
588275970ScyThe
589275970Scy.Ar assocID
590275970Scyis required, as the same name can occur in both spaces.
591275970Scy.It Ic sysinfo
592275970ScyDisplay operational summary.
593275970Scy.It Ic sysstats
594275970ScyPrint statistics counters maintained in the protocol module.
595275970Scy.El
596275970Scy.Ss Status Words and Kiss Codes
597275970ScyThe current state of the operating program is shown
598275970Scyin a set of status words
599275970Scymaintained by the system.
600275970ScyStatus information is also available on a per\-association basis.
601275970ScyThese words are displayed in the
602275970Scy.Ic rv
603275970Scyand
604275970Scy.Ic as
605275970Scycommands both in hexadecimal and in decoded short tip strings.
606275970ScyThe codes, tips and short explanations are documented on the
607275970Scy.Lk decode.html "Event Messages and Status Words"
608275970Scypage.
609275970ScyThe page also includes a list of system and peer messages,
610275970Scythe code for the latest of which is included in the status word.
611275970Scy.Pp
612275970ScyInformation resulting from protocol machine state transitions
613275970Scyis displayed using an informal set of ASCII strings called
614275970Scy.Lk decode.html#kiss "kiss codes" .
615275970ScyThe original purpose was for kiss\-o'\-death (KoD) packets
616275970Scysent by the server to advise the client of an unusual condition.
617275970ScyThey are now displayed, when appropriate,
618275970Scyin the reference identifier field in various billboards.
619275970Scy.Ss System Variables
620275970ScyThe following system variables appear in the
621275970Scy.Ic rv
622275970Scybillboard.
623275970ScyNot all variables are displayed in some configurations.
624275970Scy.Bl -tag -width "something" -compact -offset indent
625275970Scy.It Variable
626275970ScyDescription
627275970Scy.It Ic status
628275970Scy.Lk decode.html#sys "system status word"
629275970Scy.It Ic version
630275970ScyNTP software version and build time
631275970Scy.It Ic processor
632275970Scyhardware platform and version
633275970Scy.It Ic system
634275970Scyoperating system and version
635275970Scy.It Ic leap
636275970Scyleap warning indicator (0\-3)
637275970Scy.It Ic stratum
638275970Scystratum (1\-15)
639275970Scy.It Ic precision
640275970Scyprecision (log2 s)
641275970Scy.It Ic rootdelay
642275970Scytotal roundtrip delay to the primary reference clock
643275970Scy.It Ic rootdisp
644275970Scytotal dispersion to the primary reference clock
645275970Scy.It Ic peer
646275970Scysystem peer association ID
647275970Scy.It Ic tc
648275970Scytime constant and poll exponent (log2 s) (3\-17)
649275970Scy.It Ic mintc
650275970Scyminimum time constant (log2 s) (3\-10)
651275970Scy.It Ic clock
652275970Scydate and time of day
653275970Scy.It Ic refid
654275970Scyreference ID or
655275970Scy.Lk decode.html#kiss "kiss code"
656275970Scy.It Ic reftime
657275970Scyreference time
658275970Scy.It Ic offset
659275970Scycombined  offset of server relative to this host
660275970Scy.It Ic sys_jitter
661275970Scycombined system jitter
662275970Scy.It Ic frequency
663275970Scyfrequency offset (PPM) relative to hardware clock
664275970Scy.It Ic clk_wander
665275970Scyclock frequency wander (PPM)
666275970Scy.It Ic clk_jitter
667275970Scyclock jitter
668275970Scy.It Ic tai
669275970ScyTAI\-UTC offset (s)
670275970Scy.It Ic leapsec
671275970ScyNTP seconds when the next leap second is/was inserted
672275970Scy.It Ic expire
673275970ScyNTP seconds when the NIST leapseconds file expires
674275970Scy.El
675275970ScyThe jitter and wander statistics are exponentially\-weighted RMS averages.
676275970ScyThe system jitter is defined in the NTPv4 specification;
677275970Scythe clock jitter statistic is computed by the clock discipline module.
678275970Scy.Pp
679275970ScyWhen the NTPv4 daemon is compiled with the OpenSSL software library,
680275970Scyadditional system variables are displayed,
681275970Scyincluding some or all of the following,
682275970Scydepending on the particular Autokey dance:
683275970Scy.Bl -tag -width "something" -compact -offset indent
684275970Scy.It Variable
685275970ScyDescription
686275970Scy.It Ic host
687275970ScyAutokey host name for this host
688275970Scy.It Ic ident
689275970ScyAutokey group name for this host
690275970Scy.It Ic flags
691275970Scyhost flags  (see Autokey specification)
692275970Scy.It Ic digest
693275970ScyOpenSSL message digest algorithm
694275970Scy.It Ic signature
695275970ScyOpenSSL digest/signature scheme
696275970Scy.It Ic update
697275970ScyNTP seconds at last signature update
698275970Scy.It Ic cert
699275970Scycertificate subject, issuer and certificate flags
700275970Scy.It Ic until
701275970ScyNTP seconds when the certificate expires
702275970Scy.El
703275970Scy.Ss Peer Variables
704275970ScyThe following peer variables appear in the
705275970Scy.Ic rv
706275970Scybillboard for each association.
707275970ScyNot all variables are displayed in some configurations.
708275970Scy.Bl -tag -width "something" -compact -offset indent
709275970Scy.It Variable
710275970ScyDescription
711275970Scy.It Ic associd
712275970Scyassociation ID
713275970Scy.It Ic status
714275970Scy.Lk decode.html#peer "peer status word"
715275970Scy.It Ic srcadr
716275970Scysource (remote) IP address
717275970Scy.It Ic srcport
718275970Scysource (remote) port
719275970Scy.It Ic dstadr
720275970Scydestination (local) IP address
721275970Scy.It Ic dstport
722275970Scydestination (local) port
723275970Scy.It Ic leap
724275970Scyleap indicator (0\-3)
725275970Scy.It Ic stratum
726275970Scystratum (0\-15)
727275970Scy.It Ic precision
728275970Scyprecision (log2 s)
729275970Scy.It Ic rootdelay
730275970Scytotal roundtrip delay to the primary reference clock
731275970Scy.It Ic rootdisp
732275970Scytotal root dispersion to the primary reference clock
733275970Scy.It Ic refid
734275970Scyreference ID or
735275970Scy.Lk decode.html#kiss "kiss code"
736275970Scy.It Ic reftime
737275970Scyreference time
738275970Scy.It Ic reach
739275970Scyreach register (octal)
740275970Scy.It Ic unreach
741275970Scyunreach counter
742275970Scy.It Ic hmode
743275970Scyhost mode (1\-6)
744275970Scy.It Ic pmode
745275970Scypeer mode (1\-5)
746275970Scy.It Ic hpoll
747275970Scyhost poll exponent (log2 s) (3\-17)
748275970Scy.It Ic ppoll
749275970Scypeer poll exponent (log2 s) (3\-17)
750275970Scy.It Ic headway
751275970Scyheadway (see
752275970Scy.Lk rate.html "Rate Management and the Kiss\-o'\-Death Packet" )
753275970Scy.It Ic flash
754275970Scy.Lk decode.html#flash "flash status word"
755275970Scy.It Ic offset
756275970Scyfilter offset
757275970Scy.It Ic delay
758275970Scyfilter delay
759275970Scy.It Ic dispersion
760275970Scyfilter dispersion
761275970Scy.It Ic jitter
762275970Scyfilter jitter
763275970Scy.It Ic ident
764275970ScyAutokey group name for this association
765275970Scy.It Ic bias
766275970Scyunicast/broadcast bias
767275970Scy.It Ic xleave
768275970Scyinterleave delay (see
769275970Scy.Lk xleave.html "NTP Interleaved Modes" )
770275970Scy.El
771275970ScyThe
772275970Scy.Ic bias
773275970Scyvariable is calculated when the first broadcast packet is received
774275970Scyafter the calibration volley.
775275970ScyIt represents the offset of the broadcast subgraph relative to the unicast subgraph.
776275970ScyThe
777275970Scy.Ic xleave
778275970Scyvariable appears only for the interleaved symmetric and interleaved modes.
779275970ScyIt represents the internal queuing, buffering and transmission delays
780275970Scyfor the preceding packet.
781275970Scy.Pp
782275970ScyWhen the NTPv4 daemon is compiled with the OpenSSL software library,
783275970Scyadditional peer variables are displayed, including the following:
784275970Scy.Bl -tag -width "something" -compact -offset indent
785275970Scy.It Variable
786275970ScyDescription
787275970Scy.It Ic flags
788275970Scypeer flags (see Autokey specification)
789275970Scy.It Ic host
790275970ScyAutokey server name
791275970Scy.It Ic flags
792275970Scypeer flags (see Autokey specification)
793275970Scy.It Ic signature
794275970ScyOpenSSL digest/signature scheme
795275970Scy.It Ic initsequence
796275970Scyinitial key ID
797275970Scy.It Ic initkey
798275970Scyinitial key index
799275970Scy.It Ic timestamp
800275970ScyAutokey signature timestamp
801275970Scy.El
802275970Scy.Ss Clock Variables
803275970ScyThe following clock variables appear in the
804275970Scy.Ic cv
805275970Scybillboard for each association with a reference clock.
806275970ScyNot all variables are displayed in some configurations.
807275970Scy.Bl -tag -width "something" -compact -offset indent
808275970Scy.It Variable
809275970ScyDescription
810275970Scy.It Ic associd
811275970Scyassociation ID
812275970Scy.It Ic status
813275970Scy.Lk decode.html#clock "clock status word"
814275970Scy.It Ic device
815275970Scydevice description
816275970Scy.It Ic timecode
817275970ScyASCII time code string (specific to device)
818275970Scy.It Ic poll
819275970Scypoll messages sent
820275970Scy.It Ic noreply
821275970Scyno reply
822275970Scy.It Ic badformat
823275970Scybad format
824275970Scy.It Ic baddata
825275970Scybad date or time
826275970Scy.It Ic fudgetime1
827275970Scyfudge time 1
828275970Scy.It Ic fudgetime2
829275970Scyfudge time 2
830275970Scy.It Ic stratum
831275970Scydriver stratum
832275970Scy.It Ic refid
833275970Scydriver reference ID
834275970Scy.It Ic flags
835275970Scydriver flags
836275970Scy.El
837275970Scy.Sh "OPTIONS"
838275970Scy.Bl -tag
839275970Scy.It  Fl 4 , Fl \-ipv4 
840275970ScyForce IPv4 DNS name resolution.
841275970ScyThis option must not appear in combination with any of the following options:
842275970Scyipv6.
843275970Scy.sp
844275970ScyForce DNS resolution of following host names on the command line
845275970Scyto the IPv4 namespace.
846275970Scy.It  Fl 6 , Fl \-ipv6 
847275970ScyForce IPv6 DNS name resolution.
848275970ScyThis option must not appear in combination with any of the following options:
849275970Scyipv4.
850275970Scy.sp
851275970ScyForce DNS resolution of following host names on the command line
852275970Scyto the IPv6 namespace.
853275970Scy.It  Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd 
854275970Scyrun a command and exit.
855275970ScyThis option may appear an unlimited number of times.
856275970Scy.sp
857275970ScyThe following argument is interpreted as an interactive format command
858275970Scyand is added to the list of commands to be executed on the specified
859275970Scyhost(s).
860275970Scy.It  Fl d , Fl \-debug\-level 
861275970ScyIncrease debug verbosity level.
862275970ScyThis option may appear an unlimited number of times.
863275970Scy.sp
864275970Scy.It  Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number 
865275970ScySet the debug verbosity level.
866275970ScyThis option may appear an unlimited number of times.
867275970ScyThis option takes an integer number as its argument.
868275970Scy.sp
869275970Scy.It  Fl i , Fl \-interactive 
870275970ScyForce ntpq to operate in interactive mode.
871275970ScyThis option must not appear in combination with any of the following options:
872275970Scycommand, peers.
873275970Scy.sp
874275970ScyForce \fBntpq\fP to operate in interactive mode.
875275970ScyPrompts will be written to the standard output and
876275970Scycommands read from the standard input.
877275970Scy.It  Fl n , Fl \-numeric 
878275970Scynumeric host addresses.
879275970Scy.sp
880275970ScyOutput all host addresses in dotted\-quad numeric format rather than
881275970Scyconverting to the canonical host names. 
882275970Scy.It  Fl \-old\-rv 
883275970ScyAlways output status line with readvar.
884275970Scy.sp
885275970ScyBy default, \fBntpq\fP now suppresses the \fBassocid=...\fP
886275970Scyline that precedes the output of \fBreadvar\fP
887275970Scy(alias \fBrv\fP) when a single variable is requested, such as
888275970Scy\fBntpq \-c "rv 0 offset"\fP.
889275970ScyThis option causes \fBntpq\fP to include both lines of output
890275970Scyfor a single\-variable \fBreadvar\fP.
891275970ScyUsing an environment variable to
892275970Scypreset this option in a script will enable both older and
893275970Scynewer \fBntpq\fP to behave identically in this regard.
894275970Scy.It  Fl p , Fl \-peers 
895275970ScyPrint a list of the peers.
896275970ScyThis option must not appear in combination with any of the following options:
897275970Scyinteractive.
898275970Scy.sp
899275970ScyPrint a list of the peers known to the server as well as a summary
900275970Scyof their state. This is equivalent to the 'peers' interactive command.
901298695Sdelphij.It  Fl r Ar keyword , Fl \-refid Ns = Ns Ar keyword 
902298695SdelphijSet default display type for S2+ refids.
903298695SdelphijThis option takes a keyword as its argument.  The argument sets an enumeration value that can
904298695Sdelphijbe tested by comparing them against the option value macro.
905298695SdelphijThe available keywords are:
906298695Sdelphij.in +4
907298695Sdelphij.nf
908298695Sdelphij.na
909298695Sdelphijhash ipv4
910298695Sdelphij.fi
911298695Sdelphijor their numeric equivalent.
912298695Sdelphij.in -4
913298695Sdelphij.sp
914298695SdelphijThe default
915298695Sdelphij.Ar keyword
916298695Sdelphijfor this option is:
917298695Sdelphij.ti +4
918298695Sdelphij ipv4
919298695Sdelphij.sp
920298695SdelphijSet the default display format for S2+ refids.
921275970Scy.It  Fl w , Fl \-wide 
922275970ScyDisplay the full 'remote' value.
923275970Scy.sp
924275970ScyDisplay the full value of the 'remote' value.  If this requires
925275970Scymore than 15 characters, display the full value, emit a newline,
926275970Scyand continue the data display properly indented on the next line.
927275970Scy.It Fl \&? , Fl \-help
928275970ScyDisplay usage information and exit.
929275970Scy.It Fl \&! , Fl \-more\-help
930275970ScyPass the extended usage information through a pager.
931275970Scy.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
932275970ScySave the option state to \fIcfgfile\fP.  The default is the \fIlast\fP
933275970Scyconfiguration file listed in the \fBOPTION PRESETS\fP section, below.
934275970ScyThe command will exit after updating the config file.
935275970Scy.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
936275970ScyLoad options from \fIcfgfile\fP.
937275970ScyThe \fIno\-load\-opts\fP form will disable the loading
938275970Scyof earlier config/rc/ini files.  \fI\-\-no\-load\-opts\fP is handled early,
939275970Scyout of order.
940275970Scy.It Fl \-version Op Brq Ar v|c|n
941275970ScyOutput version of program and exit.  The default mode is `v', a simple
942275970Scyversion.  The `c' mode will print copyright information and `n' will
943275970Scyprint the full copyright notice.
944275970Scy.El
945275970Scy.Sh "OPTION PRESETS"
946275970ScyAny option that is not marked as \fInot presettable\fP may be preset
947275970Scyby loading values from configuration ("RC" or ".INI") file(s) and values from
948275970Scyenvironment variables named:
949275970Scy.nf
950275970Scy  \fBNTPQ_<option\-name>\fP or \fBNTPQ\fP
951275970Scy.fi
952275970Scy.ad
953275970ScyThe environmental presets take precedence (are processed later than)
954275970Scythe configuration files.
955275970ScyThe \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
956275970ScyIf any of these are directories, then the file \fI.ntprc\fP
957275970Scyis searched for within those directories.
958275970Scy.Sh "ENVIRONMENT"
959275970ScySee \fBOPTION PRESETS\fP for configuration environment variables.
960275970Scy.Sh "FILES"
961275970ScySee \fBOPTION PRESETS\fP for configuration files.
962275970Scy.Sh "EXIT STATUS"
963275970ScyOne of the following exit values will be returned:
964275970Scy.Bl -tag
965275970Scy.It 0 " (EXIT_SUCCESS)"
966275970ScySuccessful program execution.
967275970Scy.It 1 " (EXIT_FAILURE)"
968275970ScyThe operation failed or the command syntax was not valid.
969275970Scy.It 66 " (EX_NOINPUT)"
970275970ScyA specified configuration file could not be loaded.
971275970Scy.It 70 " (EX_SOFTWARE)"
972275970Scylibopts had an internal operational error.  Please report
973275970Scyit to autogen\-users@lists.sourceforge.net.  Thank you.
974275970Scy.El
975275970Scy.Sh "AUTHORS"
976280849ScyThe University of Delaware and Network Time Foundation
977275970Scy.Sh "COPYRIGHT"
978316722SdelphijCopyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved.
979275970ScyThis program is released under the terms of the NTP license, <http://ntp.org/license>.
980275970Scy.Sh "BUGS"
981275970ScyPlease send bug reports to: http://bugs.ntp.org, bugs@ntp.org
982275970Scy.Sh "NOTES"
983275970ScyThis manual page was \fIAutoGen\fP\-erated from the \fBntpq\fP
984275970Scyoption definitions.
985