Sha256: a3f0a00fa6587e37cc5cc315f49adf90a0c507970252ec338364eb8bab4ab4e0

Contents?: true

Size: 547 Bytes

Versions: 36

Compression:

Stored size: 547 Bytes

Contents

class Riemann::Babbler::Netstat < Riemann::Babbler

  def init
    plugin.set_default(:service, 'netstat')
    plugin.set_default(:interval, 60)
    plugin.set_default(:port, 80)
    plugin.states.set_default(:warning, 300)
    plugin.states.set_default(:critical, 400)
  end

  def collect
    count = shell("netstat -nat4 | egrep -e ':#{plugin.port}\s'  | grep ESTA | wc -l").to_i
    {:service => "#{plugin.service} tcp #{plugin.port}", :metric => count, :description => "count established connects: #{count} to port #{plugin.port}"}
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
riemann-babbler-1.0.7.9 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.7.8 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.7.7 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.7.5 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.7.4 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.1.0pre2 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.7.3 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.7.2 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.7.1 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.7 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.6 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.5.7 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.5.6 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.5.5 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.5.4 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.5.3 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.5.2 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.5.1 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.5 lib/riemann/babbler/plugins/netstat.rb
riemann-babbler-1.0.4 lib/riemann/babbler/plugins/netstat.rb