followed by a command keyword will print function and usage
information about the command.
This command is probably a better
source of information about
.Nm
than this manual
page.
.It Ic addvars Ar variable_name Ns Xo Op Ic =value
.Ic ...
.Xc
.It Ic rmvars Ar variable_name Ic ...
.It Ic clearvars
.It Ic showvars
The data carried by NTP mode 6 messages consists of a list of
items of the form
.Ql variable_name=value ,
where the
.Ql =value
is ignored, and can be omitted,
in requests to the server to read variables.
The
.Nm
utility maintains an internal list in which data to be included in control
messages can be assembled, and sent using the
.Ic readlist
and
.Ic writelist
commands described below.
The
.Ic addvars
command allows variables and their optional values to be added to
the list.
If more than one variable is to be added, the list should
be comma\-separated and not contain white space.
The
.Ic rmvars
command can be used to remove individual variables from the list,
while the
.Ic clearlist
command removes all variables from the
list.
The
.Ic showvars
command displays the current list of optional variables.
.It Ic authenticate Op yes | no
Normally
.Nm
does not authenticate requests unless
they are write requests.
The command
.Ql authenticate yes
causes
.Nm
to send authentication with all requests it
makes.
Authenticated requests causes some servers to handle
requests slightly differently, and can occasionally melt the CPU in
fuzzballs if you turn authentication on before doing a
.Ic peer
display.
The command
.Ql authenticate
causes
.Nm
to display whether or not
.Nm
is currently autheinticating requests.
.It Ic cooked
Causes output from query commands to be "cooked", so that
variables which are recognized by
.Nm
will have their
values reformatted for human consumption.
Variables which
.Nm
thinks should have a decodable value but didn't are
marked with a trailing
.Ql \&? .
.It Xo
.Ic debug
.Oo
.Cm more |
.Cm less |
.Cm off
.Oc
.Xc
With no argument, displays the current debug level.
Otherwise, the debug level is changed to the indicated level.
.It Ic delay Ar milliseconds
Specify a time interval to be added to timestamps included in
requests which require authentication.
This is used to enable
(unreliable) server reconfiguration over long delay network paths
or between machines whose clocks are unsynchronized.
Actually the
server does not now require timestamps in authenticated requests,
so this command may be obsolete.
.It Ic exit
Exit
.Nm .
.It Ic host Ar hostname
Set the host to which future queries will be sent.
.Ar hostname
may be either a host name or a numeric address.
.It Ic hostnames Op Cm yes | Cm no
If
.Cm yes
is specified, host names are printed in
information displays.
If
.Cm no
is specified, numeric
addresses are printed instead.
The default is
.Cm yes ,
unless
modified using the command line
.Fl n
switch.
.It Ic keyid Ar keyid
This command allows the specification of a key number to be
used to authenticate configuration requests.
This must correspond
to a key number the server has been configured to use for this
purpose.
.It Ic keytype Xo Oo
.Cm md5 |
.Cm OpenSSLDigestType
.Oc
.Xc
Specify the type of key to use for authenticating requests.
.Cm md5
is alway supported.
If
.Nm
was built with OpenSSL support,
any digest type supported by OpenSSL can also be provided.
If no argument is given, the current
.Ic keytype
is displayed.
.It Ic ntpversion Xo Oo
.Cm 1 |
.Cm 2 |
.Cm 3 |
.Cm 4
.Oc
.Xc
Sets the NTP version number which
.Nm
claims in
packets.
Defaults to 3, and note that mode 6 control messages (and
modes, for that matter) didn't exist in NTP version 1.
There appear
to be no servers left which demand version 1.
With no argument, displays the current NTP version that will be used
when communicating with servers.
.It Ic passwd
This command prompts you to type in a password (which will not
be echoed) which will be used to authenticate configuration
requests.
The password must correspond to the key configured for
use by the NTP server for this purpose if such requests are to be
successful.
.\" Not yet implemented.
.\" .It Ic poll
.\" .Op Ar n
.\" .Op Ic verbose
.\" Poll an NTP server in client mode
.\" .Ar n
.\" times.
.It Ic quit
Exit
.Nm .
.It Ic raw
Causes all output from query commands is printed as received
from the remote server.
The only formating/interpretation done on
the data is to transform nonascii data into a printable (but barely
understandable) form.
.It Ic timeout Ar milliseconds
Specify a timeout period for responses to server queries.
The
default is about 5000 milliseconds.
Note that since
.Nm
retries each query once after a timeout, the total waiting time for
a timeout will be twice the timeout value set.
.It Ic version
Print the version of the
.Nm
program.
.El
.Ss "Control Message Commands"
Association IDs are used to identify system, peer and clock variables.
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.
Most control commands send a single mode\-6 message to the server and expect a single response message.
The exceptions are the
.Li peers
command, which sends a series of messages,
and the
.Li mreadlist
and
.Li mreadvar
commands, which iterate over a range of associations.
.It Li conf Ta Li yes : persistent, Li no : ephemeral
.It Li reach Ta Li yes : reachable, Li no : unreachable
.It Li auth Ta Li ok , Li yes , Li bad and Li none
.It Li condition Ta selection status (see the Li select field of the peer status word)
.It Li last_event Ta event report (see the Li event field of the peer status word)
.It Li cnt Ta event count (see the Li count field of the peer status word)
.El
.It Cm authinfo
Display the authentication statistics.
.It Cm clockvar Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
.It Cm cv Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
Display a list of clock variables for those associations supporting a reference clock.
.It Cm :config Op ...
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.
.It Cm config\-from\-file Ar filename
Send the each line of
.Ar filename
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.
.It Ic ifstats
Display statistics for each local network address. Authentication is required.
.It Ic iostats
Display network and reference clock I/O statistics.
.It Ic kerninfo
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.
.It Ic lassociations
Perform the same function as the associations command, except display mobilized and unmobilized associations.
.It Ic lopeers Xo
.Oo Ic \-4 |
.Ic \-6
.Oc
.Xc
Obtain and print a list of all peers and clients showing
.Ar dstadr
(associated with any given IP version).
.It Ic lpeers Xo
.Oo Ic \-4 |
.Ic \-6
.Oc
.Xc
Print a peer spreadsheet for the appropriate IP version(s).
.Ar dstadr
(associated with any given IP version).
.It Ic monstats
Display monitor facility statistics.
.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
Obtain and print traffic counts collected and maintained by the monitor facility.
With the exception of
.Cm sort Ns = Ns Ar sortorder ,
the options filter the list returned by
.Cm ntpd.
The
.Cm limited
and
.Cm kod
options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
The
.Cm mincount Ns = Ns Ar count
option filters entries representing less than
.Ar count
packets.
The
.Cm laddr Ns = Ns Ar localaddr
option filters entries for packets received on any local address other than
.Ar localaddr .
.Cm resany Ns = Ns Ar hexmask
and
.Cm resall Ns = Ns Ar hexmask
filter entries containing none or less than all, respectively, of the bits in
.Ar hexmask ,
which must begin with
.Cm 0x .
The
.Ar sortorder
defaults to
.Cm lstint
and may be any of
.Cm addr ,
.Cm count ,
.Cm avgint ,
.Cm lstint ,
or any of those preceded by a minus sign (hyphen) to reverse the sort order.