LinuxCommandLibrary

ntpctl

Query and control the NTP daemon

TLDR

Show all data

$ ntpctl -s [[a|all]]
copy

Show information about each peer
$ ntpctl -s [[p|peers]]
copy

Show the status of peers and sensors, and whether the system clock is synced
$ ntpctl -s [[s|status]]
copy

Show information about each sensor
$ ntpctl -s [[S|Sensors]]
copy

SYNOPSIS

ntpctl [ options ] command [ arguments ]

PARAMETERS

-4
    Use IPv4 only.

-6
    Use IPv6 only.

-a
    Include authentication information.

-n
    Do not resolve hostnames.

-s
    Use stream (TCP) transport.

-v
    Increase verbosity.

-x
    Exit immediately if the ntpd server is unreachable.

-p
    Specify an alternate port number.

-H
    Specify an alternate host.

adjtime
    Show local clock parameters.

authinfo
    Show authentication parameters.

clockinfo
    Show clock parameters.

kernel
    Show kernel parameters.

leap
    Show leap status.

loopinfo
    Show loop parameters.

monlist
    Show recent ntpd queries.

peers
    Show list of peers and their status.

readvar
    Read and display values of ntpd variables.

reslist
    Show list of restricted addresses.

running
    Show ntpd is running or not.

showtime
    Show time information.

status
    Show ntpd status.

summary
    Show summary status of ntpd.

sync
    Show synchronization status.

trustkey
    Show list of trusted keys.

DESCRIPTION

ntpctl is a command-line utility designed to interact with the ntpd (Network Time Protocol daemon).

It serves as a client program, enabling users to query the ntpd daemon for status information, control its operation, and monitor its behavior.

ntpctl provides a convenient way to retrieve information about the current time synchronization status, peer information, and other relevant details managed by ntpd. Using ntpctl, administrators can diagnose and troubleshoot time synchronization issues, verify the accuracy of the system clock, and manage the ntpd service.

The tool offers functionalities such as listing peers, monitoring clock offset, and querying variables. It provides a more user-friendly interface than directly interacting with ntpd's control interface.

EXIT STATUS

The ntpctl command exits with a status of 0 on success and 1 on failure.

It also exits with a status of 2 if an invalid command-line option is specified.

SEE ALSO

ntpd(8), ntpq(1), chronyc(1)

Copied to clipboard