Sha256: ec09e6e49cfc552c64df5774235a5e0e80118ea80a224a5fa546c8a6953fcd31
Contents?: true
Size: 557 Bytes
Versions: 14
Compression:
Stored size: 557 Bytes
Contents
interval 5 default[:ports] = [80, 3994] collect do filter = nil plugin.ports.each do |port| if filter == nil filter = "\\( src *:#{port}" else filter += " or src *:#{port}" end end filter += " \\) and not dst 127.0.0.1:*" cmd = 'ss -t -4 -n state established ' + filter + ' | wc -l' count = shell!(cmd).to_i - 1 event( :service => "netstat tcp #{plugin.ports.join(', ')}", :metric => count, :description => "count established connects: #{count} to ports #{plugin.ports.join(', ')}" ) end
Version data entries
14 entries across 14 versions & 1 rubygems