NTP server (ntp)
Asks an NTP server for the time in client mode (SNTP, RFC 4330) and reports how far its clock is from the probe's, how long the round trip took, its stratum and its leap indicator. A server that says its own clock is not synchronised is Down.
Use it on the time servers that the other machines of the network depend on: a server whose clock drifted, lost its upstream, or started answering with a stratum of 16 is found before the machines that follow it are.
What it looks like

The sensor's page after a few polls, asking an NTP server of a lab network. In the dark theme: the sensor's page. The form for adding it, with its parameters filled in: light, dark.
Channels
| Key | Name | Unit | Default limits |
|---|---|---|---|
offset_ms | Offset from the probe's clock | ms | warning outside -100 to 100, error outside -1000 to 1000 |
delay_ms | Round-trip delay | ms | warning above 250, error above 1000 |
stratum | Stratum | none | warning above 5, error above 15 |
leap | Leap indicator | none | none (0 Synchronised, 1 leap second to be added, 2 to be removed, 3 Not synchronised) |
The offset is against the probe's clock. A positive value means the server is ahead of the probe, a negative one that it is behind. The sensor cannot tell whose clock is wrong: if the probe's own is off, every NTP sensor on it shows the same offset. Keep the probe host synchronised, ideally to a source other than the servers you monitor with it, and read the offsets of several servers together: one that differs from the rest is the one that is wrong.
The offset is computed as RFC 4330 does, from the four timestamps of the exchange, ((T2 - T1) + (T3 - T4)) / 2, so the network delay does not count against the server as long as it is the same both ways. The delay is (T4 - T1) - (T3 - T2). A path with different delays in each direction makes an offset error of up to half the difference.
Down without a limit. A leap indicator of 3 or a stratum of 16 means the server has no source and says so; the sensor is Down whatever its other values are. A leap indicator of 1 or 2 only announces a leap second at the end of the day, which is noted in the message and is healthy.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
port | 123 | UDP port of the NTP server. |
Suggested interval: 300 seconds. No credential. NTP servers rate-limit clients that ask too often; a few minutes between polls is kind to them.
On the target
An NTP server that answers client-mode requests from the probe's address (most do; some are restricted to the networks they serve). Nothing is installed.
Failures
| Message | Meaning |
|---|---|
<server> did not answer within N ms (kind timeout) | No server there, a firewall, or a server that does not serve this client. |
the server refused to answer with the kiss-of-death code "RATE" (kind protocol) | The server rate-limits this client: poll less often. DENY and RSTR mean the server does not serve this address. |
the answer does not echo the request's timestamp and the other messages of kind protocol | The datagram was not the answer to this request. Stray datagrams are ignored while waiting, so this means the server itself answered wrongly. |
... is not synchronised to any time source | A successful poll that is Down. |
Verification
Run against chrony in a container on a test network, and a server the tests start themselves that answers with a clock error of two seconds, a stratum of 3 and a datagram that is not an answer. The timestamp arithmetic is checked with worked examples, a server behind the probe, and the kiss-of-death and damaged packets are refused.
The live test reads its target from the environment and says so and returns when it is not set:
| Variable | Meaning |
|---|---|
PROBEWARD_TEST_NTP_HOST | The server's address. It must be synchronised, and the probe's clock must be right to within a minute. |
cargo test -p probeward-sensors --test live_protocols ntp -- --nocapture