diff --git a/main/views.py b/main/views.py index f30e552..eb32022 100755 --- a/main/views.py +++ b/main/views.py @@ -305,12 +305,12 @@ def get_netstat(): Get ports and applications """ try: - pipe = os.popen("ss -tnp | grep ESTAB | awk '{print $4, $5}'| sed 's/::ffff://g' | awk -F: '{print $1, $2}' | sort -n | uniq -c") + pipe = os.popen("ss -tnp | grep ESTAB | awk '{print $4, $5}'| sed 's/::ffff://g' | awk -F: '{print $1, $2}' | awk 'NF > 0' | sort -n | uniq -c") data = pipe.read().strip().split('\n') pipe.close() data = [i.split(None, 4) for i in data] - + except Exception, err: data = str(err)