Sha256: 7e69a12f3b8d0ee6f377ef0a51b9da592cfc809a6dca3dfa7cf15a151f49e50b

Contents?: true

Size: 607 Bytes

Versions: 2

Compression:

Stored size: 607 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(:, 5)
  end

  def collect
    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

2 entries across 2 versions & 1 rubygems

Version Path
riemann-babbler-1.0.8.4 lib/riemann/babbler/plugins/status_file.rb
riemann-babbler-1.0.8.3 lib/riemann/babbler/plugins/status_file.rb