diff --git a/main/views.py b/main/views.py index ea74bdd..ec3b24f 100755 --- a/main/views.py +++ b/main/views.py @@ -299,11 +299,11 @@ def get_netstat(): Get ports and applications """ try: - pipe = os.popen("ss -tnp | grep ESTAB| awk '{print $4, $5}'") + pipe = os.popen("ss -tnp | grep ESTAB | awk '{print $4, $5}'| sed 's/::ffff://g' | awk -F: '{print $1, $2}' | sort -n | uniq -c") data = pipe.read().strip().split('\n') pipe.close() - data = [i.split(None, 3) for i in data] + data = [i.split(None, 4) for i in data] except Exception, err: data = str(err) diff --git a/templates/main.html b/templates/main.html index d69046a..2d54372 100644 --- a/templates/main.html +++ b/templates/main.html @@ -289,7 +289,9 @@
| Local | +Count | +Local IP | +Local Port | Foreign |
|---|---|---|---|---|
| '+item[0]+' | '+item[1]+' | |||
| '+item[0]+' | '+item[1]+' | '+item[2]+' | '+item[3]+' |