diff --git a/main/views.py b/main/views.py index b2dddad..cf9ad72 100755 --- a/main/views.py +++ b/main/views.py @@ -142,7 +142,7 @@ def get_traffic(request): data = pipe.read().strip().split(':',1)[-1] pipe.close() - if data == ' 0': + if not data[0].isdigit(): pipe = os.popen("cat /proc/net/dev |" + "grep " + request + "| awk '{print $2, $10}'") data = pipe.read().strip().split(':',1)[-1] pipe.close() @@ -169,6 +169,9 @@ def get_platform(): osname = " ".join(platform.linux_distribution()) uname = platform.uname() + if osname == ' ' + osname = uname[0] + data = {'osname': osname, 'hostname': uname[1], 'kernel': uname[2] } except Exception,err: