Add metrics from SNTPv4 packet to ntp collector & add ntpd sanity check (#655)
* Add metrics from SNTPv4 packet to ntp collector & add ntpd sanity check 1. Checking local clock against remote NTP daemon is bad idea, local ntpd acting as a client should do it better and avoid excessive load on remote NTP server so the collector is refactored to query local NTP server. 2. Checking local clock against remote one does not check local ntpd itself. Local ntpd may be down or out of sync due to network issues, but clock will be OK. 3. Checking NTP server using sanity of it's response is tricky and depends on ntpd implementation, that's why common `node_ntp_sanity` variable is exported. * `govendor add golang.org/x/net/ipv4`, it is dependency of github.com/beevik/ntp * Update github.com/beevik/ntp to include boring SNTP fix * Use variable name from RFC5905 * ntp: move code to make export of raw metrics more explicit * Move NTP math to `github.com/beevik/ntp` * Make `golint` happy * Add some brief docs explaining `ntp` #655 and `timex` #664 modules * ntp: drop XXX comment that got its decision * ntp: add `_seconds` suffix to relevant metrics * Better `node_ntp_leap` comment * s/node_ntp_reftime/node_ntp_reference_timestamp_seconds/ as requested by @discordianfish * Extract subsystem name to const as suggested by @SuperQ
This commit is contained in:
parent
b0d5c00832
commit
c169b4b1c5
169 changed files with 10650 additions and 64 deletions
12
vendor/github.com/beevik/ntp/README.md
generated
vendored
12
vendor/github.com/beevik/ntp/README.md
generated
vendored
|
|
@ -7,14 +7,18 @@ ntp
|
|||
The ntp package is an implementation of a simple NTP client. It allows you
|
||||
to connect to a remote NTP server and request the current time.
|
||||
|
||||
To request the current time using version 4 of the NTP protocol, simply do the
|
||||
following:
|
||||
To request the current time, simply do the following:
|
||||
```go
|
||||
time, err := ntp.Time("0.pool.ntp.org")
|
||||
time, err := ntp.Time("0.beevik-ntp.pool.ntp.org")
|
||||
```
|
||||
|
||||
To request the current time along with additional metadata, use the Query
|
||||
function:
|
||||
```go
|
||||
response, err := ntp.Query("0.pool.ntp.org", 4)
|
||||
response, err := ntp.Query("0.beevik-ntp.pool.ntp.org")
|
||||
```
|
||||
|
||||
NB: if you want to use the NTP Pool in your software you should request your
|
||||
own [vendor zone](http://www.pool.ntp.org/en/vendors.html). You **must
|
||||
absolutely not use the default pool.ntp.org zone names** as the default
|
||||
configuration in your application or appliance.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue