Sha256: df72194f3f90f018a9a71a175ac0f5b6febca04b53a2a096dd7a4f132e8a72c3

Contents?: true

Size: 549 Bytes

Versions: 5

Compression:

Stored size: 549 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

5 entries across 5 versions & 1 rubygems

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