Sha256: 025d2236a7a0369f0e2b27986e988d918190a5f08845746809fc831300218e15
Contents?: true
Size: 691 Bytes
Versions: 51
Compression:
Stored size: 691 Bytes
Contents
class Riemann::Babbler::Plugin::StatusFile < Riemann::Babbler::Plugin def init plugin.set_default(:service, 'check state file') plugin.states.set_default(:critical, 1) plugin.set_default(:file, '/var/tmp/error.txt') plugin.set_default(:interval, 60) plugin.set_default(:max_lines, 100) plugin.set_default(:report_lines, 5) end def collect return [] unless File.exists? plugin.file content = File.read(plugin.file).split("\n").delete_if { |x| x.strip.empty? } { :service => plugin.service + " #{plugin.file}", :description => content.last(plugin.report_lines).join("\n"), :metric => content.count } end end
Version data entries
51 entries across 51 versions & 1 rubygems