Browse Source

netstat to ss

windows^2
Florian N 12 years ago
parent
commit
9a3ec9383e
  1. 1
      main/.#views.py
  2. 3
      main/views.py
  3. 4
      templates/main.html

1
main/.#views.py

@ -0,0 +1 @@
root@pydash.hostechs.com.30609

3
main/views.py

@ -299,11 +299,12 @@ def get_netstat():
Get ports and applications
"""
try:
pipe = os.popen("netstat -tlnp |" + "grep 'LISTEN' |" + "awk '{print $4, $5, $7}'")
pipe = os.popen("ss -tlnp | awk '{print $4, $5, $6}'")
data = pipe.read().strip().split('\n')
pipe.close()
data = [i.split(None, 3) for i in data]
del data[0]
except Exception, err:
data = str(err)

4
templates/main.html

@ -289,8 +289,8 @@
<table class="table table-hover table-condensed table-bordered">
<thead>
<tr>
<th>Local Address</th>
<th>Foreign Address</th>
<th>Local</th>
<th>Foreign</th>
<th>PID/Program Name</th>
</tr>
</thead>

Loading…
Cancel
Save