summaryrefslogtreecommitdiff
path: root/debian/man/ntpq.1
blob: 83ee5fec4690749ef75904519e23d3c20fb0b100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.\" transcribed from ntp 4.2.2p3
.TH NTPQ 1 "November 9, 2007" "Network Time Protocol"
.SH NAME
ntpq \- standard NTP query program
.SH SYNOPSIS
.B ntpq
[\-inp] [\-c \fIcommand\fR] [\fIhost\fR] [...]
.SH DESCRIPTION
The ntpq utility program is used to monitor NTP daemon ntpd operations and determine performance. It uses the standard NTP mode 6 control message formats defined in Appendix B of the NTPv3 specification RFC1305. The same formats are used in NTPv4, although some of the variables have changed and new ones added. The description on this page is for the NTPv4 variables.
.PP
The program can be run either in interactive mode or controlled using command line arguments. Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available. The ntpq can also obtain and print a list of peers in a common format by sending multiple queries to the server.
.PP
If one or more request options is included on the command line when ntpq is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, ntpq will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. ntpq will prompt for commands if the standard input is a terminal device.
.PP
ntpq uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. ntpq makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.
.PP
Note that in contexts where a host name is expected, a \-4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a \-6 qualifier forces DNS resolution to the IPv6 namespace.
.SH OPTIONS
Command line options are described following. Specifying a command line option other than \-i or \-n will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, ntpq will attempt to read interactive format commands from the standard input.
.TP
\-4
Force DNS resolution of following host names on the command line to the IPv4 namespace.
.TP
\-6
Force DNS resolution of following host names on the command line to the IPv6 namespace.
.TP
\-c
The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). Multiple \-c options may be given.
.TP
\-i
Force ntpq to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input.
.TP
\-n
Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names.
.TP
\-p
Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the peers interactive command.
.SH "SEE ALSO"
.I /usr/share/doc/ntp\-doc/html/ntpq.html
for the full documentation.