Examples
banshee/examples-collection/examples/protocols/
ntp-time
Example: ntp.time and time.now; a time server against the poller's clock.
by banshee1 installation1 version
Published on October 27, 2026. First version in this collection.
Protocol: ntp.time
ntp.time asks a time server for its time, in seconds since 1 January 1970 UTC, to the millisecond, the round trip compensated. Here, a time server is watched: it answers, and its time agrees with the poller's clock.
How to read it
need('protocol:ntp')is required byntp.time: it brings "Time server" and its delay. The server asked is the one of "Time server", never the address of the host: to watch the host as a time server, set "Time server" to its address on the probe.- The time returned is the server's at the arrival of its answer:
time.now(), the poller's time read just after, is the one to compare with. - A server that says it is not synchronised, or refuses to answer, stops the collector, unreachable (
ntp_answer_invalid).
To adapt it
- To check the clock of a machine against a time server, read the machine's time too, by SSH or SNMP:
linux/ssh/clockandlinux/snmp/clockof the Linux collection do it.