1 .TH NTPQ 1 2009-12-08 "( 4.2.4p8)" "Programmer's Manual"
2 .\" EDIT THIS FILE WITH CAUTION (ntpq.1)
4 .\" It has been AutoGen-ed Tuesday December 8, 2009 at 08:14:27 AM EST
5 .\" From the definitions ntpq-opts.def
6 .\" and the template file agman1.tpl
9 ntpq \- standard NTP query program
12 .\" Mixture of short (flag) options and long options
13 .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..."
18 This manual page documents, briefly, the \fBntpq\fP command.
21 utility program is used to query NTP servers which
22 implement the standard NTP mode 6 control message formats defined
23 in Appendix B of the NTPv3 specification RFC1305, requesting
24 information about current state and/or changes in that state.
25 The same formats are used in NTPv4, although some of the
26 variables have changed and new ones added. The description on this
27 page is for the NTPv4 variables.
28 The program may be run either in interactive mode or controlled using
29 command line arguments.
30 Requests to read and write arbitrary
31 variables can be assembled, with raw and pretty-printed output
32 options being available.
35 utility can also obtain and print a
36 list of peers in a common format by sending multiple queries to the
39 If one or more request options is included on the command line
42 is executed, each of the requests will be sent
43 to the NTP servers running on each of the hosts given as command
44 line arguments, or on localhost by default.
48 will attempt to read commands from the
49 standard input and execute these on the NTP server running on the
50 first host given on the command line, again defaulting to localhost
51 when no other host is specified.
54 utility will prompt for
55 commands if the standard input is a terminal device.
59 utility 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.
68 one attempt to retransmit requests, and will time requests out if
69 the remote host is not heard from within a suitable timeout
73 command line option other than
78 cause the specified query (queries) to be sent to the indicated
83 interactive format commands from the standard input.
84 .Ss "Internal Commands"
85 Interactive format commands consist of a keyword followed by zero
87 Only enough characters of the full keyword to
88 uniquely identify the command need be typed.
91 number of interactive format commands are executed entirely within
94 utility itself and do not result in NTP mode 6
95 requests being sent to a server.
96 These are described following.
98 .IR "? [command_keyword]"
100 by itself will print a list of all the command
101 keywords known to this incarnation of
105 followed by a command keyword will print function and usage
106 information about the command.
107 This command is probably a better
108 source of information about
114 .Ar variable_name [=value] ...
117 .IR "rmvars variable_name ..."
120 The data carried by NTP mode 6 messages consists of a list of
122 .Ql variable_name=value ,
125 is ignored, and can be omitted,
126 in requests to the server to read variables.
129 utility maintains an internal list in which data to be included in control
130 messages can be assembled, and sent using the
134 commands described below.
137 command allows variables and their optional values to be added to
139 If more than one variable is to be added, the list should
140 be comma-separated and not contain white space.
143 command can be used to remove individual variables from the list,
146 command removes all variables from the
149 .IR "authenticate [ yes | no ]"
152 does not authenticate requests unless
153 they are write requests.
158 to send authentication with all requests it
160 Authenticated requests causes some servers to handle
161 requests slightly differently, and can occasionally melt the CPU in
162 fuzzballs if you turn authentication on before doing a
169 to display whether or not
171 is currently autheinticating requests.
174 Causes output from query commands to be "cooked", so that
175 variables which are recognized by
178 values reformatted for human consumption.
181 thinks should have a decodable value but didn't are
182 marked with a trailing
190 With no argument, displays the current debug level.
191 Otherwise, the debug level is changed to the indicated level.
193 .IR "delay milliseconds"
194 Specify a time interval to be added to timestamps included in
195 requests which require authentication.
196 This is used to enable
197 (unreliable) server reconfiguration over long delay network paths
198 or between machines whose clocks are unsynchronized.
200 server does not now require timestamps in authenticated requests,
201 so this command may be obsolete.
204 Set the host to which future queries will be sent.
206 be either a host name or a numeric address.
208 .IR "hostnames Cm yes | Cm no"
211 is specified, host names are printed in
212 information displays.
215 is specified, numeric
216 addresses are printed instead.
220 modified using the command line
225 This command allows the specification of a key number to be
226 used to authenticate configuration requests.
228 to a key number the server has been configured to use for this
238 Sets the NTP version number which
242 Defaults to 3, Note that mode 6 control messages (and
243 modes, for that matter) didn't exist in NTP version 1.
245 to be no servers left which demand version 1.
246 With no argument, displays the current NTP version that will be used
247 when communicating with servers.
254 This command prompts you to type in a password (which will not
255 be echoed) which will be used to authenticate configuration
257 The password must correspond to the key configured for
258 use by the NTP server for this purpose if such requests are to be
262 Causes all output from query commands is printed as received
263 from the remote server.
264 The only formating/interpretation done on
265 the data is to transform nonascii data into a printable (but barely
266 understandable) form.
268 .IR "timeout Ar milliseconds"
269 Specify a timeout period for responses to server queries.
271 default is about 5000 milliseconds.
274 retries each query once after a timeout, the total waiting time for
275 a timeout will be twice the timeout value set.
281 Force IPv4 DNS name resolution.
282 This option is a member of the ipv4 class of options.
284 Force DNS resolution of following host names on the command line
285 to the IPv4 namespace.
288 Force IPv6 DNS name resolution.
289 This option is a member of the ipv4 class of options.
291 Force DNS resolution of following host names on the command line
292 to the IPv6 namespace.
294 .BR \-c " \fIcmd\fP, " \--command "=" \fIcmd\fP
295 run a command and exit.
296 This option may appear an unlimited number of times.
298 The following argument is interpreted as an interactive format command
299 and is added to the list of commands to be executed on the specified
302 .BR \-d ", " \--debug-level
303 Increase output debug message level.
304 This option may appear an unlimited number of times.
306 Increase the debugging message output level.
308 .BR \-D " \fIstring\fP, " \--set-debug-level "=" \fIstring\fP
309 Set the output debug message level.
310 This option may appear an unlimited number of times.
312 Set the output debugging level. Can be supplied multiple times,
313 but each overrides the previous value(s).
315 .BR \-p ", " \--peers
316 Print a list of the peers.
317 This option must not appear in combination with any of the following options:
320 Print a list of the peers known to the server as well as a summary
321 of their state. This is equivalent to the 'peers' interactive command.
323 .BR \-i ", " \--interactive
324 Force ntpq to operate in interactive mode.
325 This option must not appear in combination with any of the following options:
328 Force ntpq to operate in interactive mode. Prompts will be written
329 to the standard output and commands read from the standard input.
331 .BR \-n ", " \--numeric
332 numeric host addresses.
334 Output all host addresses in dotted-quad numeric format rather than
335 converting to the canonical host names.
338 Display usage information and exit.
340 .BR \-! , " \--more-help"
341 Extended usage information passed thru pager.
343 .BR \-> " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]"
344 Save the option state to \fIrcfile\fP. The default is the \fIlast\fP
345 configuration file listed in the \fBOPTION PRESETS\fP section, below.
347 .BR \-< " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts"
348 Load options from \fIrcfile\fP.
349 The \fIno-load-opts\fP form will disable the loading
350 of earlier RC/INI files. \fI--no-load-opts\fP is handled early,
353 .BR \-v " [{\fIv|c|n\fP}]," " \--version" "[=\fI{v|c|n}\fP]"
354 Output version of program and exit. The default mode is `v', a simple
355 version. The `c' mode will print copyright information and `n' will
356 print the full copyright notice.
358 Any option that is not marked as \fInot presettable\fP may be preset
359 by loading values from configuration ("RC" or ".INI") file(s) and values from
360 environment variables named:
362 \fBNTPQ_<option-name>\fP or \fBNTPQ\fP
365 The environmental presets take precedence (are processed later than)
366 the configuration files.
367 The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
368 If any of these are directories, then the file \fI.ntprc\fP
369 is searched for within those directories.
371 David L. Mills and/or others
373 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
378 see /usr/share/doc/html/ntp/copyright.html
382 This manual page was \fIAutoGen\fP-erated from the \fBntpq\fP