def _netstat_linux():
 ret = []
 cmd = 'netstat -tulpnea'
 out = __salt__['cmd.run'](cmd)
 for line in out.splitlines():
  comps = line.split()
  if line.startswith('tcp'):
   ret.append({'proto': comps[0], 'recv-q': comps[1], 'send-q': comps[2], 'local-address': comps[3], 'remote-address': comps[4], 'state': comps[5], 'user': comps[6], 'inode': comps[7], 'program': comps[8]})
  if line.startswith('udp'):
   ret.append({'proto': comps[0], 'recv-q': comps[1], 'send-q': comps[2], 'local-address': comps[3], 'remote-address': comps[4], 'user': comps[5], 'inode': comps[6], 'program': comps[7]})
 return ret

def _netstat_linux ( ) : ret = [ ] cmd = 'netstat -tulpnea' out = __salt__ [ 'cmd.run' ] ( cmd ) for line in out . splitlines ( ) : comps = line . split ( ) if line . startswith ( 'tcp' ) : ret . append ( { 'proto' : comps [ 0 ] , 'recv-q' : comps [ 1 ] , 'send-q' : comps [ 2 ] , 'local-address' : comps [ 3 ] , 'remote-address' : comps [ 4 ] , 'state' : comps [ 5 ] , 'user' : comps [ 6 ] , 'inode' : comps [ 7 ] , 'program' : comps [ 8 ] } ) if line . startswith ( 'udp' ) : ret . append ( { 'proto' : comps [ 0 ] , 'recv-q' : comps [ 1 ] , 'send-q' : comps [ 2 ] , 'local-address' : comps [ 3 ] , 'remote-address' : comps [ 4 ] , 'user' : comps [ 5 ] , 'inode' : comps [ 6 ] , 'program' : comps [ 7 ] } ) return ret
return netstat information for linux distros .