Sha256: 237bd272a6d62915e283893bc2d63de23fea968c2ea0bdd13a59edcbf75354e4

Contents?: true

Size: 617 Bytes

Versions: 2

Compression:

Stored size: 617 Bytes

Contents

class Riemann::Babbler::Twcli < Riemann::Babbler

  def init
    plugin.set_default(:service, 'twcli')
    plugin.set_default(:cmd, "/usr/sbin/tw_cli /$(/usr/sbin/tw_cli show | grep ^c | cut -f1 -d' ') show | egrep '^[upb]' | grep -v ' OK ' | grep -v ' VERIFYING ' | grep -v ' VERIFY-PAUSED ' | wc -l")
    plugin.states.set_default(:critical, 1)
    plugin.set_default(:interval, 300)
  end

  def run_plugin
    File.exists? '/usr/sbin/tw_cli'
  end

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

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
riemann-babbler-1.0.7.9 lib/riemann/babbler/plugins/twcli.rb
riemann-babbler-1.0.7.8 lib/riemann/babbler/plugins/twcli.rb