Hi,

I want to check if my local servers are sychronized with NTP servers. Can I 
use ntp collector? And can I use  node_ntp_offset to know the offset 
between local servers' system clock and NTP servers

>From https://github.com/prometheus/node_exporter/blob/master/docs/TIME.md

node_ntp_offset

Clock offset 
<https://en.wikipedia.org/wiki/Network_Time_Protocol#Clock_synchronization_algorithm>
 between 
local time and NTPD time.

ntp.org always sets NTPD time to local clock instead of relaying remote NTP 
time, so this offset is irrelevant for this NTPD.

This value is used in sanity check as part of causality violation estimate.


>From source code https://github.com/beevik/ntp/blob/master/ntp.go#L504

func offset(org, rec, xmt, dst ntpTime) time.Duration {

   // local clock offset

   // offset = ((rec-org) + (xmt-dst)) / 2

   a := rec.Time().Sub(org.Time())

   b := xmt.Time().Sub(dst.Time())

   return (a + b) / time.Duration(2)

}

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/497f01a8-22e1-4433-9491-0fa23a6fb4b8n%40googlegroups.com.

Reply via email to