Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Querying the NTP status with commands for control messages

&pagelevel(5)&pagelevel

Each partner that is known to a server has a 16-bit association identifier consisting of an integer. NTP control messages with partner variables must use this association identifier to identify which partner the values belong to.

By means of commands for control messages, one or more NTP messages are sent to the server, and the returned data is output in partially formatted form. Most of the commands output a single message and also expect a single answer. One exception is the peers command, which sends a preprogrammed sequence of messages.


Request and display association IDs and partner statuses


associations


The associations command requests a list of the association IDs and partner statuses for the partners of the queried server, and outputs this list in columns. The first column contains a sequential number for the associations (starting with 1); the second column contains the actual association ID returned by the server, and the third column contains the status word for the partner. These are followed by several columns with data that was decoded from the status word. The data returned by the associations command is buffered internally in ntpq.


Send request to read a status


pstatus assocID


The pstatus command sends a request to the server to read the status for the specified association ID (assocID). The returned names and values of the partner variables are output.


Request a list of the clock variables of the server


clockvar[ assocID] [name[,name...]]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

cv[ assocID] [name[,name...]]


The clockvar command, or cv for short, requests a list of the clock variables of the server. Servers on which a clock is configured react positively to this request. assocID specifies the association ID. If the association ID is not specified or is specified as “0”, the request for variables applies to the internal NTP system clock of the server. Otherwise, the association ID is interpreted as the partner association ID of a clock, and the related variables are displayed. If no variable list is specified, the server returns a standard list of variables and values.


Request a list of the server’s peers, including additional information


peers


The peers command requests a list of the server’s partners, including an overview of the status of each partner. The information in the overview includes:

  • the address of the remote partner,

  • the reference ID (0.0.0.0 if the reference ID is unknown),

  • the stratum of the remote partner,

  • the type of partner (local, unicast or broadcast),

  • an indication of when the last packet arrived,

  • the polling interval (in seconds),

  • the accessibility register (as an octal number),

  • the current message runtime,

  • the drift and variance of the partner (both in milliseconds).

The character in the left margin indicates the significance of this partner in the clock selection process.


The meanings of the codes are as follows:

sp

deleted because of a high stratum and/or negative plausibility checks

x

time is invalid since the drift is too large

.

selected from the end of the candidate list

-

deleted from the cluster algorithms

+

added to the final selection group

#

selected for synchronization, but the synchronization distance exceeds the maximum

*

selected for synchronization

o

selected for synchronization; external clock


The host field may contain either a host name, an IP address or the name of a clock. If hostnames no (see also "Querying the NTP status with internal commands of ntpq") is specified, only IP addresses are displayed.


Specifying a key ID for authenticating configuration requests


keyid keyid


The keyid command specifies a key ID for authenticating configuration requests. The key number specified must match a key number which was configured on the server for this purpose.


Having the password inquired for authenticating configuration requests


passwd


The passwd command inquires a password which must match a key that was configured on the server for this purpose.