Sha256: 976ef3ffd632e4e1f9202a82790072ccef92a69433c83a1930e6aa5d7e88beb7

Contents?: true

Size: 508 Bytes

Versions: 6

Compression:

Stored size: 508 Bytes

Contents

class Riemann::Babbler::MegaCli < Riemann::Babbler

  def init
    plugin.set_default(:service, 'megacli')
    plugin.set_default(:cmd, 'megacli -AdpAllInfo -aAll -NoLog | awk -F": " \'/Virtual Drives/ { getline; print $2; }\'')
    plugin.set_default(:interval, 60)
    plugin.states.set_default(:critical, 1)
  end

  def run_plugin
    File.exists? '/usr/bin/megacli'
  end

  def collect
    {:service => plugin.service, :metric => shell(plugin.cmd).to_i, :description => "MegaCli status}" }
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
riemann-babbler-0.9.7 lib/riemann/babbler/plugins/megacli.rb
riemann-babbler-0.9.6 lib/riemann/babbler/plugins/megacli.rb
riemann-babbler-0.9.5 lib/riemann/babbler/plugins/megacli.rb
riemann-babbler-0.9.4 lib/riemann/babbler/plugins/megacli.rb
riemann-babbler-0.9.3 lib/riemann/babbler/plugins/megacli.rb
riemann-babbler-0.9.2 lib/riemann/babbler/plugins/megacli.rb