banshee/linux-collection/linux/ssh/
clock
Offset of a Linux clock from a time server: date by SSH against NTP.
par banshee1 installation2 versions
v2Dernière
Publiée le 28 octobre 2026. One naming convention across collections; documentation completed.
Clock of a Linux, by SSH
Returns the offset of the machine's clock from a time server, with and without its sign. Positive, the clock is ahead; negative, it is behind.
Versions
Generic: date +%s is known by BusyBox and GNU coreutils, and gives UTC seconds with no time zone to guess.
How it works
The collector runs date +%s on the machine (the seconds since 1 January 1970 UTC), then asks the time server named by protocol:ntp:server (pool.ntp.org when empty) with one NTP client request.
- The server's time is brought back to the middle of the SSH call, measured by the poller's clock: neither the SSH round trip nor the time between the two readings counts in the offset, nor the poller's own clock error.
datetruncates to the second: half a second is added, the middle of the second the true time lies in.- Nothing is written on the target.
Prerequisites
- an SSH account for monitoring, without write rights;
- the fingerprint of the server's host key, set in
protocol:ssh:fingerprint(not needed when the Security settings trust the first SSH fingerprint presented); - the poller reaching the time server on UDP port 123.
Outputs
| Name | Label | Unit | Per instance |
|---|---|---|---|
offset | Offset from the time server | s | no |
drift | Offset, without its sign | s | no |
Watches
| Name | Title | Kind | Defaults | Checked by default |
|---|---|---|---|---|
clock-drift | Clock off | above a threshold, on drift | warning above 5 s, critical above 60 s | yes |
Limits
- The offset is read to about one second: the SSH call, connection included, is a second long at worst. The default thresholds stay far above it.
- A time server that does not answer stops the collector
unreachable.