mirror of https://github.com/cppla/ServerStatus
fix
parent
ba5914a434
commit
3d71ce1dbc
|
@ -78,12 +78,12 @@ def tupd():
|
||||||
:return:
|
:return:
|
||||||
'''
|
'''
|
||||||
try:
|
try:
|
||||||
if 'linux' in sys.platform:
|
if sys.platform.startswith("linux") is True:
|
||||||
t = int(os.popen('ss -t|wc -l').read()[:-1])-1
|
t = int(os.popen('ss -t|wc -l').read()[:-1])-1
|
||||||
u = int(os.popen('ss -u|wc -l').read()[:-1])-1
|
u = int(os.popen('ss -u|wc -l').read()[:-1])-1
|
||||||
p = int(os.popen('ps -ef|wc -l').read()[:-1])-2
|
p = int(os.popen('ps -ef|wc -l').read()[:-1])-2
|
||||||
d = int(os.popen('ps -eLf|wc -l').read()[:-1])-2
|
d = int(os.popen('ps -eLf|wc -l').read()[:-1])-2
|
||||||
elif 'win' in sys.platform:
|
elif sys.platform.startswith("win") is True:
|
||||||
t = int(os.popen('netstat -an|find "TCP" /c').read()[:-1])-1
|
t = int(os.popen('netstat -an|find "TCP" /c').read()[:-1])-1
|
||||||
u = int(os.popen('netstat -an|find "UDP" /c').read()[:-1])-1
|
u = int(os.popen('netstat -an|find "UDP" /c').read()[:-1])-1
|
||||||
p = len(psutil.pids())
|
p = len(psutil.pids())
|
||||||
|
|
Loading…
Reference in New Issue