Sha256: feb4890e2d82bf15bdd310afb95f25e1d2fe71119250502d1a43af192cd0f59a

Contents?: true

Size: 597 Bytes

Versions: 30

Compression:

Stored size: 597 Bytes

Contents

class Riemann::Babbler::TwCli < Riemann::Babbler

  def init
    plugin.set_default(:service, 'twcli')
    plugin.set_default(:cmd, "/usr/sbin/tw_cli show | awk '/^c/{print $1}' | xargs -rI{} /usr/sbin/tw_cli /{} show | awk '/^[upb]/&&!/[ \t](OK|VERIFYING|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

30 entries across 30 versions & 1 rubygems

Version Path
riemann-babbler-1.4.0 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.9.7 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.9.6 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.9.5 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.9.4 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.9.3 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.9.1 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.9 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.8 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.7 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.6 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.5 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.4 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.3 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.2 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.1 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.3.0 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.2.9 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.2.8 lib/riemann/babbler/plugins/tw_cli.rb
riemann-babbler-1.2.7 lib/riemann/babbler/plugins/tw_cli.rb