This repository is no longer maintained.
Checks NTP offset against several NTP servers and allows pushing of offset stats via statsd
Add this line to your application's Gemfile:
gem 'net-ntp-check'And then execute:
$ bundle
Or install it yourself as:
$ gem install net-ntp-check
require 'net/ntp/check'
offsets = Net::NTP::Check.get_offsetsrequire 'net/ntp/check'
offsets = Net::NTP::Check.get_offsets_filteredrequire 'net/ntp/check'
client = Net::NTP::Check::StatsdClient.new
client.send_offset_stats- 0 - Success
- 1 - Unknown Error
- 2 - Timeout Error
- 3 - Socket Error (failed DNS resolution)
- Fork it ( https://github.com/pagerduty/net-ntp-check/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request