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