0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Checks NTP offset against several NTP servers and allows pushing of offset stats via statsd
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
>= 0
>= 0

Runtime

 Project Readme

Deprecated

This repository is no longer maintained.

Net::Ntp::Check

Build Status Gem Version Coverage Status Code Climate

Checks NTP offset against several NTP servers and allows pushing of offset stats via statsd

Installation

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

Usage

Get NTP offsets based on several servers

require 'net/ntp/check'
offsets = Net::NTP::Check.get_offsets

Get NTP offset based on several servers with a 200ms bandpass filter applied

require 'net/ntp/check'
offsets = Net::NTP::Check.get_offsets_filtered

Send NTP offset to statsd

require 'net/ntp/check'
client = Net::NTP::Check::StatsdClient.new
client.send_offset_stats

Statsd Error Codes

  • 0 - Success
  • 1 - Unknown Error
  • 2 - Timeout Error
  • 3 - Socket Error (failed DNS resolution)

Contributing

  1. Fork it ( https://github.com/pagerduty/net-ntp-check/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request