LinuxCommandLibrary

ntp-ctl

Query NTP service status

TLDR

Display information about the current state of the NTP daemon

$ ntp-ctl status
copy

Check if the specified configuration file (default: /etc/ntpd-rs/ntp.toml) is valid
$ ntp-ctl [[-c|--config]] [path/to/config] validate
copy

Interactively run a single synchronization of the clock
$ sudo ntp-ctl force-sync
copy

SYNOPSIS

ntpq [options] [host]

PARAMETERS

-c command
    Executes a specific command on the NTP server, then exits. Common commands include peers, associations, sysinfo, etc.

-d
    Enables debug mode, displaying additional information useful for troubleshooting.

-i
    Enters interactive mode, allowing multiple commands to be executed sequentially without exiting.

-n
    Does not convert host addresses to names, displaying them as dotted-quad IP addresses instead.

-p
    Prints a list of peers in a concise format, showing their status, stratum, offset, and jitter.

-q
    Queries the NTP server and then exits. This is similar to -c peers and -c associations for a quick overview.

-r retry_delay
    Specifies the initial retry delay for queries, in seconds.

-t timeout
    Sets the timeout for queries, in seconds.

-v
    Prints the version number of ntpq.

host
    Specifies the host or IP address of the NTP server to query. If omitted, ntpq defaults to localhost.

DESCRIPTION

The command ntp-ctl is not a standard Linux utility. This analysis provides information based on ntpq, the widely used Network Time Protocol (NTP) query program. ntpq is an interactive utility that allows users to monitor and control the ntpd daemon. It can be used to query any compatible NTP server on the network for current state information, including the status of configured peers, system variables, and protocol statistics. This tool is essential for diagnosing NTP synchronization issues and verifying the health of time services. While ntp-ctl is not a recognized command, ntpq serves the purpose of controlling and querying NTP services on most Linux distributions.

CAVEATS

The command ntp-ctl is not a standard Linux command and will likely result in 'command not found'. The analysis provided is for ntpq, which is the standard NTP query tool. ntpq requires the ntpd daemon to be running on the target host for most queries to return meaningful information. Some operations may require root privileges or specific network permissions.

NTP CONTROL UTILITIES

While ntp-ctl is not a recognized command on standard Linux systems, the functionality of controlling and querying NTP services is commonly provided by tools like ntpq (for the NTP daemon) and chronyc (for the Chrony NTP client/server). These utilities offer comprehensive capabilities for monitoring time synchronization status, peer information, and system variables crucial for network time management.

HISTORY

ntpq has been an integral part of the NTP reference implementation since its early versions. Developed alongside the Network Time Protocol itself, it has evolved to support new protocol features and provide robust diagnostic capabilities for NTP daemon operations. Its design reflects the continuous development of the NTP protocol, allowing administrators to monitor and manage time synchronization effectively across diverse network environments.

SEE ALSO

ntpd(8), ntpdate(8), chronyc(1), ntp.conf(5)

Copied to clipboard