Sha256: 808abbf5760573a0cb43d69358667def8791b7cb3e1b902f7a85ff01d30cf10e
Contents?: true
Size: 598 Bytes
Versions: 6
Compression:
Stored size: 598 Bytes
Contents
require 'net/ntp' class Riemann::Babbler::Plugin::Ntp < Riemann::Babbler::Plugin def init plugin.set_default(:service, 'ntp') plugin.set_default(:host, 'pool.ntp.org') plugin.states.set_default(:warning, 5) plugin.states.set_default(:critical, 10) end def diff Net::NTP.get(plugin.host, 'ntp', 5).time.to_i - Time.now.to_i end def collect { :service => plugin.service + " #{plugin.host}", :description => "Ntp lag with host #{plugin.host}", :metric => (::Net::NTP.get(plugin.host, 'ntp', 5).time.to_i - unixnow).abs } end end
Version data entries
6 entries across 6 versions & 1 rubygems