Browse Source

Merge branch 'master' of https://github.com/k3oni/pydash

windows
root 12 years ago
parent
commit
11cc1ccf20
  1. 5
      README.md
  2. 5
      main/views.py

5
README.md

@ -1,4 +1,4 @@
pyDash
pyDash - v1.2
====== ======
A small web monitoring dashboard for your linux pc/server writen in Python and Django + Chart.js. A small web monitoring dashboard for your linux pc/server writen in Python and Django + Chart.js.
@ -9,7 +9,7 @@ The dashboard is built using only Python libraries available in the main Python
Current dependencies: Current dependencies:
- == Django 1.6.1 - == Django 1.6.1
- >= Python 2.6
__[View Demo](http://pydash.hostechs.com/)__ __[View Demo](http://pydash.hostechs.com/)__
@ -48,6 +48,7 @@ pyDash was tested and runs under the following OSs:
- Debian - Debian
- Raspbian - Raspbian
- Pidora - Pidora
- Arch Linux
Might work under others, but didn't get to test any other OSs just yet. Might work under others, but didn't get to test any other OSs just yet.

5
main/views.py

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

Loading…
Cancel
Save