]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - usr.sbin/ntp/doc/ntpq.8
Fix ntp multiple vulnerabilities.
[FreeBSD/releng/10.2.git] / usr.sbin / ntp / doc / ntpq.8
1 .Dd April 26 2016
2 .Dt NTPQ 8 User Commands
3 .Os
4 .\"  EDIT THIS FILE WITH CAUTION  (ntpq-opts.mdoc)
5 .\"
6 .\" $FreeBSD$
7 .\"
8 .\"  It has been AutoGen-ed  April 26, 2016 at 08:29:41 PM by AutoGen 5.18.5
9 .\"  From the definitions    ntpq-opts.def
10 .\"  and the template file   agmdoc-cmd.tpl
11 .Sh NAME
12 .Nm ntpq
13 .Nd standard NTP query program
14 .Sh SYNOPSIS
15 .Nm
16 .\" Mixture of short (flag) options and long options
17 .Op Fl flags
18 .Op Fl flag Op Ar value
19 .Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
20 [ host ...]
21 .Pp
22 .Sh DESCRIPTION
23 The
24 .Nm
25 utility program is used to query NTP servers which
26 implement the standard NTP mode 6 control message formats defined
27 in Appendix B of the NTPv3 specification RFC1305, requesting
28 information about current state and/or changes in that state.
29 The same formats are used in NTPv4, although some of the
30 variables have changed and new ones added. The description on this
31 page is for the NTPv4 variables.
32 The program may be run either in interactive mode or controlled using
33 command line arguments.
34 Requests to read and write arbitrary
35 variables can be assembled, with raw and pretty\-printed output
36 options being available.
37 The
38 .Nm
39 utility can also obtain and print a
40 list of peers in a common format by sending multiple queries to the
41 server.
42 If one or more request options is included on the command line
43 when
44 .Nm
45 is executed, each of the requests will be sent
46 to the NTP servers running on each of the hosts given as command
47 line arguments, or on localhost by default.
48 If no request options
49 are given,
50 .Nm
51 will attempt to read commands from the
52 standard input and execute these on the NTP server running on the
53 first host given on the command line, again defaulting to localhost
54 when no other host is specified.
55 The
56 .Nm
57 utility will prompt for
58 commands if the standard input is a terminal device.
59 .Nm
60 uses NTP mode 6 packets to communicate with the
61 NTP server, and hence can be used to query any compatible server on
62 the network which permits it.
63 Note that since NTP is a UDP protocol
64 this communication will be somewhat unreliable, especially over
65 large distances in terms of network topology.
66 The
67 .Nm
68 utility makes
69 one attempt to retransmit requests, and will time requests out if
70 the remote host is not heard from within a suitable timeout
71 time.
72 Specifying a
73 command line option other than
74 .Fl i
75 or
76 .Fl n
77 will
78 cause the specified query (queries) to be sent to the indicated
79 host(s) immediately.
80 Otherwise,
81 .Nm
82 will attempt to read
83 interactive format commands from the standard input.
84 .Ss "Internal Commands"
85 Interactive format commands consist of a keyword followed by zero
86 to four arguments.
87 Only enough characters of the full keyword to
88 uniquely identify the command need be typed.
89 A
90 number of interactive format commands are executed entirely within
91 the
92 .Nm
93 utility itself and do not result in NTP mode 6
94 requests being sent to a server.
95 These are described following.
96 .Bl -tag -width "? [command_keyword]" -compact -offset indent
97 .It Ic ? Op  Ar command_keyword
98 .It Ic help Op Ar command_keyword
99 A
100 .Ql \&?
101 by itself will print a list of all the command
102 keywords known to this incarnation of
103 .Nm .
104 A
105 .Ql \&?
106 followed by a command keyword will print function and usage
107 information about the command.
108 This command is probably a better
109 source of information about
110 .Nm
111 than this manual
112 page.
113 .It Ic addvars Ar variable_name Ns Xo Op Ic =value
114 .Ic ...
115 .Xc
116 .It Ic rmvars Ar variable_name Ic ...
117 .It Ic clearvars
118 .It Ic showvars
119 The data carried by NTP mode 6 messages consists of a list of
120 items of the form
121 .Ql variable_name=value ,
122 where the
123 .Ql =value
124 is ignored, and can be omitted,
125 in requests to the server to read variables.
126 The
127 .Nm
128 utility maintains an internal list in which data to be included in control
129 messages can be assembled, and sent using the
130 .Ic readlist
131 and
132 .Ic writelist
133 commands described below.
134 The
135 .Ic addvars
136 command allows variables and their optional values to be added to
137 the list.
138 If more than one variable is to be added, the list should
139 be comma\-separated and not contain white space.
140 The
141 .Ic rmvars
142 command can be used to remove individual variables from the list,
143 while the
144 .Ic clearlist
145 command removes all variables from the
146 list.
147 The
148 .Ic showvars
149 command displays the current list of optional variables.
150 .It Ic authenticate Op yes | no
151 Normally
152 .Nm
153 does not authenticate requests unless
154 they are write requests.
155 The command
156 .Ql authenticate yes
157 causes
158 .Nm
159 to send authentication with all requests it
160 makes.
161 Authenticated requests causes some servers to handle
162 requests slightly differently, and can occasionally melt the CPU in
163 fuzzballs if you turn authentication on before doing a
164 .Ic peer
165 display.
166 The command
167 .Ql authenticate
168 causes
169 .Nm
170 to display whether or not
171 .Nm
172 is currently autheinticating requests.
173 .It Ic cooked
174 Causes output from query commands to be "cooked", so that
175 variables which are recognized by
176 .Nm
177 will have their
178 values reformatted for human consumption.
179 Variables which
180 .Nm
181 thinks should have a decodable value but didn't are
182 marked with a trailing
183 .Ql \&? .
184 .It Xo
185 .Ic debug
186 .Oo
187 .Cm more |
188 .Cm less |
189 .Cm off
190 .Oc
191 .Xc
192 With no argument, displays the current debug level.
193 Otherwise, the debug level is changed to the indicated level.
194 .It Ic delay Ar milliseconds
195 Specify a time interval to be added to timestamps included in
196 requests which require authentication.
197 This is used to enable
198 (unreliable) server reconfiguration over long delay network paths
199 or between machines whose clocks are unsynchronized.
200 Actually the
201 server does not now require timestamps in authenticated requests,
202 so this command may be obsolete.
203 .It Ic exit
204 Exit
205 .Nm .
206 .It Ic host Ar hostname
207 Set the host to which future queries will be sent.
208 .Ar hostname
209 may be either a host name or a numeric address.
210 .It Ic hostnames Op Cm yes | Cm no
211 If
212 .Cm yes
213 is specified, host names are printed in
214 information displays.
215 If
216 .Cm no
217 is specified, numeric
218 addresses are printed instead.
219 The default is
220 .Cm yes ,
221 unless
222 modified using the command line
223 .Fl n
224 switch.
225 .It Ic keyid Ar keyid
226 This command allows the specification of a key number to be
227 used to authenticate configuration requests.
228 This must correspond
229 to the
230 .Cm controlkey
231 key number the server has been configured to use for this
232 purpose.
233 .It Ic keytype Xo Oo
234 .Cm md5 |
235 .Cm OpenSSLDigestType
236 .Oc
237 .Xc
238 Specify the type of key to use for authenticating requests.
239 .Cm md5
240 is alway supported.
241 If
242 .Nm
243 was built with OpenSSL support,
244 any digest type supported by OpenSSL can also be provided.
245 If no argument is given, the current
246 .Ic keytype
247 is displayed.
248 .It Ic ntpversion Xo Oo
249 .Cm 1 |
250 .Cm 2 |
251 .Cm 3 |
252 .Cm 4
253 .Oc
254 .Xc
255 Sets the NTP version number which
256 .Nm
257 claims in
258 packets.
259 Defaults to 3, and note that mode 6 control messages (and
260 modes, for that matter) didn't exist in NTP version 1.
261 There appear
262 to be no servers left which demand version 1.
263 With no argument, displays the current NTP version that will be used
264 when communicating with servers.
265 .It Ic passwd
266 This command prompts you to type in a password (which will not
267 be echoed) which will be used to authenticate configuration
268 requests.
269 The password must correspond to the key configured for
270 use by the NTP server for this purpose if such requests are to be
271 successful.
272 .\" Not yet implemented.
273 .\" .It Ic poll
274 .\" .Op Ar n
275 .\" .Op Ic verbose
276 .\" Poll an NTP server in client mode
277 .\" .Ar n
278 .\" times.
279 .It Ic quit
280 Exit
281 .Nm .
282 .It Ic raw
283 Causes all output from query commands is printed as received
284 from the remote server.
285 The only formating/interpretation done on
286 the data is to transform nonascii data into a printable (but barely
287 understandable) form.
288 .It Ic timeout Ar milliseconds
289 Specify a timeout period for responses to server queries.
290 The
291 default is about 5000 milliseconds.
292 Note that since
293 .Nm
294 retries each query once after a timeout, the total waiting time for
295 a timeout will be twice the timeout value set.
296 .It Ic version
297 Print the version of the
298 .Nm
299 program.
300 .El
301 .Ss "Control Message Commands"
302 Association IDs are used to identify system, peer and clock variables.
303 System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
304 Most control commands send a single mode\-6 message to the server and expect a single response message.
305 The exceptions are the
306 .Li peers
307 command, which sends a series of messages,
308 and the
309 .Li mreadlist
310 and
311 .Li mreadvar
312 commands, which iterate over a range of associations.
313 .Bl -tag -width "something" -compact -offset indent
314 .It Cm associations
315 Display a list of mobilized associations in the form:
316 .Dl ind assid status conf reach auth condition last_event cnt
317 .Bl -column -offset indent ".Sy Variable" ".Sy Description"
318 .It Sy String Ta Sy Description
319 .It Li ind Ta index on this list
320 .It Li assid Ta association ID
321 .It Li status Ta peer status word
322 .It Li conf Ta Li yes : persistent, Li no : ephemeral
323 .It Li reach Ta Li yes : reachable, Li no : unreachable
324 .It Li auth Ta Li ok , Li yes , Li bad and Li none
325 .It Li condition Ta selection status (see the Li select field of the peer status word)
326 .It Li last_event Ta event report (see the Li event field of the peer status word)
327 .It Li cnt Ta event count (see the Li count field of the peer status word)
328 .El
329 .It Cm authinfo
330 Display the authentication statistics.
331 .It Cm clockvar Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
332 .It Cm cv Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
333 Display a list of clock variables for those associations supporting a reference clock.
334 .It Cm :config Op ...
335 Send 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.
336 .It Cm config\-from\-file Ar filename
337 Send the each line of
338 .Ar filename
339 to 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.
340 .It Ic ifstats
341 Display statistics for each local network address. Authentication is required.
342 .It Ic iostats
343 Display network and reference clock I/O statistics.
344 .It Ic kerninfo
345 Display 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.
346 .It Ic lassociations
347 Perform the same function as the associations command, except display mobilized and unmobilized associations.
348 .It Ic lopeers Xo
349 .Oo Ic \-4 |
350 .Ic \-6
351 .Oc
352 .Xc
353 Obtain and print a list of all peers and clients showing
354 .Ar dstadr
355 (associated with any given IP version).
356 .It Ic lpeers Xo
357 .Oo Ic \-4 |
358 .Ic \-6
359 .Oc
360 .Xc
361 Print a peer spreadsheet for the appropriate IP version(s).
362 .Ar dstadr
363 (associated with any given IP version).
364 .It Ic monstats
365 Display monitor facility statistics.
366 .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
367 Obtain and print traffic counts collected and maintained by the monitor facility.
368 With the exception of
369 .Cm sort Ns = Ns Ar sortorder ,
370 the options filter the list returned by
371 .Cm ntpd.
372 The
373 .Cm limited
374 and
375 .Cm kod
376 options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
377 The
378 .Cm mincount Ns = Ns Ar count
379 option filters entries representing less than
380 .Ar count
381 packets.
382 The
383 .Cm laddr Ns = Ns Ar localaddr
384 option filters entries for packets received on any local address other than
385 .Ar localaddr .
386 .Cm resany Ns = Ns Ar hexmask
387 and
388 .Cm resall Ns = Ns Ar hexmask
389 filter entries containing none or less than all, respectively, of the bits in
390 .Ar hexmask ,
391 which must begin with
392 .Cm 0x .
393 The
394 .Ar sortorder
395 defaults to
396 .Cm lstint
397 and may be any of
398 .Cm addr ,
399 .Cm count ,
400 .Cm avgint ,
401 .Cm lstint ,
402 or any of those preceded by a minus sign (hyphen) to reverse the sort order.
403 The output columns are:
404 .Bl -tag -width "something" -compact -offset indent
405 .It Column
406 Description
407 .It Ic lstint
408 Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
409 .Nm .
410 .It Ic avgint
411 Average interval in s between packets from this address.
412 .It Ic rstr
413 Restriction flags associated with this address.
414 Most are copied unchanged from the matching
415 .Ic restrict
416 command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
417 .It Ic r
418 Rate control indicator, either
419 a period,
420 .Ic L
421 or
422 .Ic K
423 for no rate control response,
424 rate limiting by discarding, or rate limiting with a KoD response, respectively.
425 .It Ic m
426 Packet mode.
427 .It Ic v
428 Packet version number.
429 .It Ic count
430 Packets received from this address.
431 .It Ic rport
432 Source port of last packet from this address.
433 .It Ic remote address
434 DNS name, numeric address, or address followed by
435 claimed DNS name which could not be verified in parentheses.
436 .El
437 .It Ic mreadvar assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
438 .It Ic mrv assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
439 Perform the same function as the
440 .Ic readvar
441 command, except for a range of association IDs.
442 This range is determined from the association list cached by the most recent
443 .Ic associations
444 command.
445 .It Ic opeers Xo
446 .Oo Ic \-4 |
447 .Ic \-6
448 .Oc
449 .Xc
450 Obtain and print the old\-style list of all peers and clients showing
451 .Ar dstadr
452 (associated with any given IP version),
453 rather than the
454 .Ar refid .
455 .It Ic passociations
456 Perform the same function as the
457 .Ic associations
458 command,
459 except that it uses previously stored data rather than making a new query.
460 .It Ic peers
461 Display a list of peers in the form:
462 .Dl [tally]remote refid st t when pool reach delay offset jitter
463 .Bl -tag -width "something" -compact -offset indent
464 .It Variable
465 Description
466 .It Ic [tally]
467 single\-character code indicating current value of the
468 .Ic select
469 field of the
470 .Lk decode.html#peer "peer status word"
471 .It Ic remote
472 host name (or IP number) of peer.
473 The value displayed will be truncated to 15 characters  unless the
474 .Fl w
475 flag is given, in which case the full value will be displayed
476 on the first line,
477 and the remaining data is displayed on the next line.
478 .It Ic refid
479 association ID or
480 .Lk decode.html#kiss "'kiss code"
481 .It Ic st
482 stratum
483 .It Ic t
484 .Ic u :
485 unicast or manycast client,
486 .Ic b :
487 broadcast or multicast client,
488 .Ic l :
489 local (reference clock),
490 .Ic s :
491 symmetric (peer),
492 .Ic A :
493 manycast server,
494 .Ic B :
495 broadcast server,
496 .Ic M :
497 multicast server
498 .It Ic when
499 sec/min/hr since last received packet
500 .It Ic poll
501 poll interval (log2 s)
502 .It Ic reach
503 reach shift register (octal)
504 .It Ic delay
505 roundtrip delay
506 .It Ic offset
507 offset of server relative to this host
508 .It Ic jitter
509 jitter
510 .El
511 .It Ic apeers
512 Display a list of peers in the form:
513 .Dl [tally]remote refid assid st t when pool reach delay offset jitter
514 where the output is just like the
515 .Ic peers
516 command except that the
517 .Ic refid
518 is displayed in hex format and the association number is also displayed.
519 .It Ic pstats Ar assocID
520 Show the statistics for the peer with the given
521 .Ar assocID .
522 .It Ic readlist Ar assocID
523 .It Ic rl Ar assocID
524 Read the system or peer variables included in the variable list.
525 .It Ic readvar Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc  Oo , ... Oc
526 .It Ic rv Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc  Oo , ... Oc
527 Display the specified variables.
528 If
529 .Ar assocID
530 is zero, the variables are from the
531 .Sx System Variables
532 name space, otherwise they are from the
533 .Sx Peer Variables
534 name space.
535 The
536 .Ar assocID
537 is required, as the same name can occur in both spaces.
538 If no
539 .Ar name
540 is included, all operative variables in the name space are displayed.
541 In this case only, if the
542 .Ar assocID
543 is omitted, it is assumed zero.
544 Multiple names are specified with comma separators and without whitespace.
545 Note that time values are represented in milliseconds
546 and frequency values in parts\-per\-million (PPM).
547 Some NTP timestamps are represented in the format
548 YYYYMMDDTTTT ,
549 where YYYY is the year,
550 MM the month of year,
551 DD the day of month and
552 TTTT the time of day.
553 .It Ic reslist
554 Show the access control (restrict) list for
555 .Nm .
556 .It Ic saveconfig Ar filename
557 Write the current configuration,
558 including any runtime modifications given with
559 .Ic :config
560 or
561 .Ic config\-from\-file ,
562 to the ntpd host's file
563 .Ar filename .
564 This command will be rejected by the server unless
565 .Lk miscopt.html#saveconfigdir "saveconfigdir"
566 appears in the
567 .Ic ntpd
568 configuration file.
569 .Ar filename
570 can use
571 .Xr strftime
572 format specifies to substitute the current date and time, for example,
573 .Ic q]saveconfig ntp\-%Y%m%d\-%H%M%S.confq] .
574 The filename used is stored in system variable
575 .Ic savedconfig .
576 Authentication is required.
577 .It Ic timerstats
578 Display interval timer counters.
579 .It Ic writelist Ar assocID
580 Write the system or peer variables included in the variable list.
581 .It Ic writevar Ar assocID Ar name Ns = Ns Ar value Op , ...
582 Write the specified variables.
583 If the
584 .Ar assocID
585 is zero, the variables are from the
586 .Sx System Variables
587 name space, otherwise they are from the
588 .Sx Peer Variables
589 name space.
590 The
591 .Ar assocID
592 is required, as the same name can occur in both spaces.
593 .It Ic sysinfo
594 Display operational summary.
595 .It Ic sysstats
596 Print statistics counters maintained in the protocol module.
597 .El
598 .Ss Status Words and Kiss Codes
599 The current state of the operating program is shown
600 in a set of status words
601 maintained by the system.
602 Status information is also available on a per\-association basis.
603 These words are displayed in the
604 .Ic rv
605 and
606 .Ic as
607 commands both in hexadecimal and in decoded short tip strings.
608 The codes, tips and short explanations are documented on the
609 .Lk decode.html "Event Messages and Status Words"
610 page.
611 The page also includes a list of system and peer messages,
612 the code for the latest of which is included in the status word.
613 .Pp
614 Information resulting from protocol machine state transitions
615 is displayed using an informal set of ASCII strings called
616 .Lk decode.html#kiss "kiss codes" .
617 The original purpose was for kiss\-o'\-death (KoD) packets
618 sent by the server to advise the client of an unusual condition.
619 They are now displayed, when appropriate,
620 in the reference identifier field in various billboards.
621 .Ss System Variables
622 The following system variables appear in the
623 .Ic rv
624 billboard.
625 Not all variables are displayed in some configurations.
626 .Bl -tag -width "something" -compact -offset indent
627 .It Variable
628 Description
629 .It Ic status
630 .Lk decode.html#sys "system status word"
631 .It Ic version
632 NTP software version and build time
633 .It Ic processor
634 hardware platform and version
635 .It Ic system
636 operating system and version
637 .It Ic leap
638 leap warning indicator (0\-3)
639 .It Ic stratum
640 stratum (1\-15)
641 .It Ic precision
642 precision (log2 s)
643 .It Ic rootdelay
644 total roundtrip delay to the primary reference clock
645 .It Ic rootdisp
646 total dispersion to the primary reference clock
647 .It Ic peer
648 system peer association ID
649 .It Ic tc
650 time constant and poll exponent (log2 s) (3\-17)
651 .It Ic mintc
652 minimum time constant (log2 s) (3\-10)
653 .It Ic clock
654 date and time of day
655 .It Ic refid
656 reference ID or
657 .Lk decode.html#kiss "kiss code"
658 .It Ic reftime
659 reference time
660 .It Ic offset
661 combined  offset of server relative to this host
662 .It Ic sys_jitter
663 combined system jitter
664 .It Ic frequency
665 frequency offset (PPM) relative to hardware clock
666 .It Ic clk_wander
667 clock frequency wander (PPM)
668 .It Ic clk_jitter
669 clock jitter
670 .It Ic tai
671 TAI\-UTC offset (s)
672 .It Ic leapsec
673 NTP seconds when the next leap second is/was inserted
674 .It Ic expire
675 NTP seconds when the NIST leapseconds file expires
676 .El
677 The jitter and wander statistics are exponentially\-weighted RMS averages.
678 The system jitter is defined in the NTPv4 specification;
679 the clock jitter statistic is computed by the clock discipline module.
680 .Pp
681 When the NTPv4 daemon is compiled with the OpenSSL software library,
682 additional system variables are displayed,
683 including some or all of the following,
684 depending on the particular Autokey dance:
685 .Bl -tag -width "something" -compact -offset indent
686 .It Variable
687 Description
688 .It Ic host
689 Autokey host name for this host
690 .It Ic ident
691 Autokey group name for this host
692 .It Ic flags
693 host flags  (see Autokey specification)
694 .It Ic digest
695 OpenSSL message digest algorithm
696 .It Ic signature
697 OpenSSL digest/signature scheme
698 .It Ic update
699 NTP seconds at last signature update
700 .It Ic cert
701 certificate subject, issuer and certificate flags
702 .It Ic until
703 NTP seconds when the certificate expires
704 .El
705 .Ss Peer Variables
706 The following peer variables appear in the
707 .Ic rv
708 billboard for each association.
709 Not all variables are displayed in some configurations.
710 .Bl -tag -width "something" -compact -offset indent
711 .It Variable
712 Description
713 .It Ic associd
714 association ID
715 .It Ic status
716 .Lk decode.html#peer "peer status word"
717 .It Ic srcadr
718 source (remote) IP address
719 .It Ic srcport
720 source (remote) port
721 .It Ic dstadr
722 destination (local) IP address
723 .It Ic dstport
724 destination (local) port
725 .It Ic leap
726 leap indicator (0\-3)
727 .It Ic stratum
728 stratum (0\-15)
729 .It Ic precision
730 precision (log2 s)
731 .It Ic rootdelay
732 total roundtrip delay to the primary reference clock
733 .It Ic rootdisp
734 total root dispersion to the primary reference clock
735 .It Ic refid
736 reference ID or
737 .Lk decode.html#kiss "kiss code"
738 .It Ic reftime
739 reference time
740 .It Ic reach
741 reach register (octal)
742 .It Ic unreach
743 unreach counter
744 .It Ic hmode
745 host mode (1\-6)
746 .It Ic pmode
747 peer mode (1\-5)
748 .It Ic hpoll
749 host poll exponent (log2 s) (3\-17)
750 .It Ic ppoll
751 peer poll exponent (log2 s) (3\-17)
752 .It Ic headway
753 headway (see
754 .Lk rate.html "Rate Management and the Kiss\-o'\-Death Packet" )
755 .It Ic flash
756 .Lk decode.html#flash "flash status word"
757 .It Ic offset
758 filter offset
759 .It Ic delay
760 filter delay
761 .It Ic dispersion
762 filter dispersion
763 .It Ic jitter
764 filter jitter
765 .It Ic ident
766 Autokey group name for this association
767 .It Ic bias
768 unicast/broadcast bias
769 .It Ic xleave
770 interleave delay (see
771 .Lk xleave.html "NTP Interleaved Modes" )
772 .El
773 The
774 .Ic bias
775 variable is calculated when the first broadcast packet is received
776 after the calibration volley.
777 It represents the offset of the broadcast subgraph relative to the unicast subgraph.
778 The
779 .Ic xleave
780 variable appears only for the interleaved symmetric and interleaved modes.
781 It represents the internal queuing, buffering and transmission delays
782 for the preceding packet.
783 .Pp
784 When the NTPv4 daemon is compiled with the OpenSSL software library,
785 additional peer variables are displayed, including the following:
786 .Bl -tag -width "something" -compact -offset indent
787 .It Variable
788 Description
789 .It Ic flags
790 peer flags (see Autokey specification)
791 .It Ic host
792 Autokey server name
793 .It Ic flags
794 peer flags (see Autokey specification)
795 .It Ic signature
796 OpenSSL digest/signature scheme
797 .It Ic initsequence
798 initial key ID
799 .It Ic initkey
800 initial key index
801 .It Ic timestamp
802 Autokey signature timestamp
803 .El
804 .Ss Clock Variables
805 The following clock variables appear in the
806 .Ic cv
807 billboard for each association with a reference clock.
808 Not all variables are displayed in some configurations.
809 .Bl -tag -width "something" -compact -offset indent
810 .It Variable
811 Description
812 .It Ic associd
813 association ID
814 .It Ic status
815 .Lk decode.html#clock "clock status word"
816 .It Ic device
817 device description
818 .It Ic timecode
819 ASCII time code string (specific to device)
820 .It Ic poll
821 poll messages sent
822 .It Ic noreply
823 no reply
824 .It Ic badformat
825 bad format
826 .It Ic baddata
827 bad date or time
828 .It Ic fudgetime1
829 fudge time 1
830 .It Ic fudgetime2
831 fudge time 2
832 .It Ic stratum
833 driver stratum
834 .It Ic refid
835 driver reference ID
836 .It Ic flags
837 driver flags
838 .El
839 .Sh "OPTIONS"
840 .Bl -tag
841 .It  Fl 4 , Fl \-ipv4 
842 Force IPv4 DNS name resolution.
843 This option must not appear in combination with any of the following options:
844 ipv6.
845 .sp
846 Force DNS resolution of following host names on the command line
847 to the IPv4 namespace.
848 .It  Fl 6 , Fl \-ipv6 
849 Force IPv6 DNS name resolution.
850 This option must not appear in combination with any of the following options:
851 ipv4.
852 .sp
853 Force DNS resolution of following host names on the command line
854 to the IPv6 namespace.
855 .It  Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd 
856 run a command and exit.
857 This option may appear an unlimited number of times.
858 .sp
859 The following argument is interpreted as an interactive format command
860 and is added to the list of commands to be executed on the specified
861 host(s).
862 .It  Fl d , Fl \-debug\-level 
863 Increase debug verbosity level.
864 This option may appear an unlimited number of times.
865 .sp
866 .It  Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number 
867 Set the debug verbosity level.
868 This option may appear an unlimited number of times.
869 This option takes an integer number as its argument.
870 .sp
871 .It  Fl i , Fl \-interactive 
872 Force ntpq to operate in interactive mode.
873 This option must not appear in combination with any of the following options:
874 command, peers.
875 .sp
876 Force \fBntpq\fP to operate in interactive mode.
877 Prompts will be written to the standard output and
878 commands read from the standard input.
879 .It  Fl n , Fl \-numeric 
880 numeric host addresses.
881 .sp
882 Output all host addresses in dotted\-quad numeric format rather than
883 converting to the canonical host names. 
884 .It  Fl \-old\-rv 
885 Always output status line with readvar.
886 .sp
887 By default, \fBntpq\fP now suppresses the \fBassocid=...\fP
888 line that precedes the output of \fBreadvar\fP
889 (alias \fBrv\fP) when a single variable is requested, such as
890 \fBntpq \-c "rv 0 offset"\fP.
891 This option causes \fBntpq\fP to include both lines of output
892 for a single\-variable \fBreadvar\fP.
893 Using an environment variable to
894 preset this option in a script will enable both older and
895 newer \fBntpq\fP to behave identically in this regard.
896 .It  Fl p , Fl \-peers 
897 Print a list of the peers.
898 This option must not appear in combination with any of the following options:
899 interactive.
900 .sp
901 Print a list of the peers known to the server as well as a summary
902 of their state. This is equivalent to the 'peers' interactive command.
903 .It  Fl r Ar keyword , Fl \-refid Ns = Ns Ar keyword 
904 Set default display type for S2+ refids.
905 This option takes a keyword as its argument.  The argument sets an enumeration value that can
906 be tested by comparing them against the option value macro.
907 The available keywords are:
908 .in +4
909 .nf
910 .na
911 hash ipv4
912 .fi
913 or their numeric equivalent.
914 .in -4
915 .sp
916 The default
917 .Ar keyword
918 for this option is:
919 .ti +4
920  ipv4
921 .sp
922 Set the default display format for S2+ refids.
923 .It  Fl w , Fl \-wide 
924 Display the full 'remote' value.
925 .sp
926 Display the full value of the 'remote' value.  If this requires
927 more than 15 characters, display the full value, emit a newline,
928 and continue the data display properly indented on the next line.
929 .It Fl \&? , Fl \-help
930 Display usage information and exit.
931 .It Fl \&! , Fl \-more\-help
932 Pass the extended usage information through a pager.
933 .It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
934 Save the option state to \fIcfgfile\fP.  The default is the \fIlast\fP
935 configuration file listed in the \fBOPTION PRESETS\fP section, below.
936 The command will exit after updating the config file.
937 .It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
938 Load options from \fIcfgfile\fP.
939 The \fIno\-load\-opts\fP form will disable the loading
940 of earlier config/rc/ini files.  \fI\-\-no\-load\-opts\fP is handled early,
941 out of order.
942 .It Fl \-version Op Brq Ar v|c|n
943 Output version of program and exit.  The default mode is `v', a simple
944 version.  The `c' mode will print copyright information and `n' will
945 print the full copyright notice.
946 .El
947 .Sh "OPTION PRESETS"
948 Any option that is not marked as \fInot presettable\fP may be preset
949 by loading values from configuration ("RC" or ".INI") file(s) and values from
950 environment variables named:
951 .nf
952   \fBNTPQ_<option\-name>\fP or \fBNTPQ\fP
953 .fi
954 .ad
955 The environmental presets take precedence (are processed later than)
956 the configuration files.
957 The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
958 If any of these are directories, then the file \fI.ntprc\fP
959 is searched for within those directories.
960 .Sh "ENVIRONMENT"
961 See \fBOPTION PRESETS\fP for configuration environment variables.
962 .Sh "FILES"
963 See \fBOPTION PRESETS\fP for configuration files.
964 .Sh "EXIT STATUS"
965 One of the following exit values will be returned:
966 .Bl -tag
967 .It 0 " (EXIT_SUCCESS)"
968 Successful program execution.
969 .It 1 " (EXIT_FAILURE)"
970 The operation failed or the command syntax was not valid.
971 .It 66 " (EX_NOINPUT)"
972 A specified configuration file could not be loaded.
973 .It 70 " (EX_SOFTWARE)"
974 libopts had an internal operational error.  Please report
975 it to autogen\-users@lists.sourceforge.net.  Thank you.
976 .El
977 .Sh "AUTHORS"
978 The University of Delaware and Network Time Foundation
979 .Sh "COPYRIGHT"
980 Copyright (C) 1992\-2016 The University of Delaware and Network Time Foundation all rights reserved.
981 This program is released under the terms of the NTP license, <http://ntp.org/license>.
982 .Sh "BUGS"
983 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
984 .Sh "NOTES"
985 This manual page was \fIAutoGen\fP\-erated from the \fBntpq\fP
986 option definitions.