Compaq TCP/IP Services for OpenVMS
Management


Previous Contents Index

12.8.3 Making Run-Time Requests with NTPDC

Section 12.3 discussed how to use the configuration file to configure NTP on your system. In addition to using a configuration file, you can make run-time changes to NTP with query commands by running the NTPDC utility. NTPDC displays time values in seconds.

Run-time requests are always authenticated requests. Authentication provides verification that the requester has permission to make such changes but also gives an extra degree of protection against transmission errors.

The reconfiguration facility works well with a server on the local host and between time-synchronized hosts on the same LAN. The facility works poorly for more distant hosts. Authenticated requests include a timestamp. The server compares the timestamp to its receive timestamp. If they differ by more than a small amount, the request is rejected. This is done for two reasons:

To run NTPDC, enter the following command:


$ RUN SYS$SYSTEM:TCPIP$NTPDC.EXE 

At the NTPDC> prompt, enter the appropriate type of command from the following list:

12.8.3.1 NTPDC Interactive Commands

Interactive commands consist of a command name followed by one or more keywords. The interactive commands are:

12.8.3.2 NTPDC Control Message Commands

Control message commands request information about the server. These are read-only commands in that they make no modification of the server configuration state.

The NTPDC control message commands are:

12.8.3.3 NTPDC Request Commands

The following commands make authenticated requests:

You can also run NTPDC by defining a foreign command as follows:


$ NTPDC:==$SYS$SYSTEM:TCPIP$NTPDC.EXE 
 

Use the following syntax when entering commands:


NTPDC [option...] 
 

Table 12-5 describes the NTPDC options.

Table 12-5 NTPDC Options
Option Description
-c command The command argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified hosts. Multiple -c options may be given.
-i Forces NTPDC to operate in interactive mode.
-l Obtains a list of peers that are known to the servers.
-n Displays all host addresses in numeric format rather than converting them to host names.
-p Displays a list of the peers known to the server as well as a summary of their state.
-s Displays a list of the peers known to the server as well as a summary of their state, but in a slightly different format than the -p option.

12.8.4 Querying the NTP Server with NTPQ

The NTPQ program allows you to query the NTP server about its current state and request changes to that state. NTPQ can also obtain and display a list of peers in a common format by sending multiple queries to the server.

The NTPQ program authenticates requests based on the key entry in the keys file that is configured using the controlkey command, as described in Table 12-2.

The NTPQ program uses NTP mode 6 packets to communicate with the NTP server; therefore, it is used to query any compatible server on the network. Because NTP is a UDP protocol, this communication is somewhat unreliable over long distances (in terms of network topology). The NTPQ program makes one attempt to restransmit requests and times out requests if the remote host does not respond within the expected amount of time. NTPQ displays time values in milliseconds.

To run the NTPQ program, enter the following command:


$ RUN SYS$SYSTEM:TCPIP$NTPQ.EXE 

At the NTPQ> prompt, enter commands using the following syntax:


command [options...] 

The following commands allow you to query and set NTP server state information:

12.8.4.1 NTPQ Control Message Commands

Each peer known to an NTP server has a 16-bit integer association identifier assigned to it. NTP control messages that carry peer variables must identify the peer that the values correspond to by including the peer's association ID. An association ID of zero indicates the variables are system variables whose names are drawn from a separate name space.

Control message commands result in one or more NTP mode 6 messages being sent to the server, and cause the data returned to be displayed in a format that you control using the commands listed in Section 12.8.4. Most commands send a single message and expect a single response. The exceptions are the peers command, which sends a preprogrammed series of messages to obtain the data it needs, and the mreadlist and mreadvar commands, which are repeated for each specified association.

You can also run NTPQ by defining a foreign command as follows:


NTPQ:==$SYS$SYSTEM:TCPIP$NTPQ.EXE 
 

Use the following syntax when entering the NTPQ foreign command:


NTPQ [-i] [-n] [-p] [-c command] [host1,host2,...] 

Table 12-6 describes the NTPQ options.

Table 12-6 NTPQ Options
Option Description
-c command Adds the specified interactive command to the list of commands to be executed on the specified host. You can enter multiple -c options on the command line.
-i Forces NTPQ to operate in interactive mode. This is the default mode of operation.
-n Displays host addresses numeric format rather than converting them to host names.
-p Displays a list of the peers known to the server as well as a summary of their state.


Previous Next Contents Index