Sha256: ab5d32140e9290913b3465224b4739f02cf44e8168b523a540365da0397521a8

Contents?: true

Size: 617 Bytes

Versions: 9

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

9 entries across 9 versions & 1 rubygems

Version Path
riemann-babbler-1.0.8.8 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.0.8.7 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.0.8.6 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.0.8.5 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.0.8.4 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.0.8.3 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.0.8.2 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.0.8.1 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.0.8 lib/riemann/babbler/plugins/twcli.rb