Sha256: 524fa0bae2a5329b17a1bbe61f0e8e5631d8dd27ac5207ff2cd267af3c3f65e5
Contents?: true
Size: 665 Bytes
Versions: 33
Compression:
Stored size: 665 Bytes
Contents
class Riemann::Babbler::StatusFile < Riemann::Babbler 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
33 entries across 33 versions & 1 rubygems