Logging is here!

NTP

Agent CheckAgent Check
NTP Graph

Overview

The Network Time Protocol (NTP) integration is enabled by default and reports the time offset from an ntp server every 15 minutes. When the local agent’s time is more than 15 seconds off from the Datadog service and the other hosts that you are monitoring, you may experience:

  • Incorrect alert triggers
  • Metric delays
  • Gaps in graphs of metrics

Setup

Installation

To install the check on the agent:

/opt/datadog-agent/embedded/bin/pip install .

Development

Create a dedicated virtualenv and follow the instructions in this paragraph to work with the check.

To install the check in dev mode:

pip install -e .[dev]

To run the tests:

python setup.py test

Once installed, the check is available as:

import check.ntp

To build the wheel package:

python setup.py bdist_wheel

Configuration

The Agent enables the NTP check by default, but if you want to configure the check yourself, create a file ntp.yaml in the Agent’s conf.d directory. See the sample ntp.yaml for all available configuration options:

init_config:

instances:
  - offset_threshold: 60 # seconds difference between local clock and NTP server when ntp.in_sync service check becomes CRITICAL; default is 60




Configuration Options:

  • host (Optional) - Host name of alternate ntp server, for example pool.ntp.org
  • port (Optional) - What port to use
  • version (Optional) - ntp version
  • timeout (Optional) - Response timeout

Restart the Agent to effect any configuration changes.

Validation

Run the Agent’s info subcommand and look for ntp under the Checks section:

  Checks
  ======
    [...]

    ntp
    -------
      - instance #0 [OK]
      - Collected 1 metrics, 0 events & 0 service checks

    [...]

Compatibility

The NTP check is compatible with all major platforms.

Data Collected

Metrics

ntp.offset
(gauge)
The time difference between the local clock and the NTP reference clock.
shown as second

Events

The NTP check does not include any event at this time.

Service Checks

ntp.in_sync:

Returns CRITICAL if the NTP offset is greater than the threshold specified in ntp.yaml, otherwise OK.

Troubleshooting

Need help? Contact Datadog Support.

Further Reading

Learn more about infrastructure monitoring and all our integrations on our blog