ntptrace Command for NTPv4
Purpose
Traces a chain of Network Time Protocol (NTP) hosts back to their primary time source.
Syntax
Description
The ntptrace command is a perl script that uses the ntpq command to follow the chain of NTP servers from a specified host back to the primary time source. For ntptrace command to function correctly, each server must implement the NTP Control and Monitoring Protocol as specified in RFC 1305 and enable the NTP Mode 6 packets.
If no arguments are provided, the ntptrace command starts with localhost.
% ntptrace
localhost: stratum 4, offset 0.0019529, sync distance 0.144135
server2ozo.com: stratum 2, offset 0.0124263, sync distance 0.115784
usndh.edu: stratum 1, offset 0.0019298, sync distance 0.011993, refid 'WWVB'
Each line contains the following fields from left to right:
- The hostname.
- The host stratum.
- The time offset between the specified host and the local host. The ntptrace command measures the time offset.
- The host synchronization distance.
- The reference clock ID is displayed only for the strarum-1 server.
Note: The stratum is the server hop count to the primary
source. The synchronization distance is the estimated error relative to the primary source. These
terms are precisely defined in RFC 1305.
Flags
Item | Description |
---|---|
-m max_hosts | Sets the upper-limit of the number of hosts to check for the primary time source. The default value is unlimited. |
-n | Turns off the printing of the hostname. When -n option is specified, host IP addresses are printed instead of the hostnames. The -n flag is useful when a name server is down. |
Parameters
Item | Description |
---|---|
server | Specifies the server. The default is the local host. |
Exit Status
The ntptrace command returns the following exit values:
Item | Description |
---|---|
0 |
Successful completion |
>0 |
An error occurred |
Security
- Access Control
- You must be a part of the system group to run this command.
- Auditing Events
- N/A
Examples
- To trace the time source for the local host NTP server, enter the following
command:
ntptrace
An output similar to the following output is displayed:
loopback: stratum 5, offset 0.000076, synch distance 0.18291
ganga08.in.ibm.com: stratum 4, offset -0.001854, synch distance 0.30600
ganga10.in.ibm.com: stratum 3, offset 0.000251, synch distance 0.30550
ausgsa.austin.ibm.com: stratum 2, offset -0.010158, synch distance 0.01921
gsantp.austin.ibm.com: stratum 1, offset 0.016067, synch distance 0.00000, refid
'GPS'
Files
- /usr/sbin/ntp4/ntptrace4
- Contains the ntptrace command for NTPv4.
- /usr/sbin/ntptrace-->/usr/sbin/ntp4/ntptrace4
- The default symbolic link to the NTP version 4 binary file from the
/usr/sbin
directory.