From d2a5752b6ed0048216ead3d53e694bb8b84b6e34 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Sun, 10 Apr 2016 18:51:18 -0400 Subject: move data to its folder --- get-client-cpu-mem.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'get-client-cpu-mem.py') diff --git a/get-client-cpu-mem.py b/get-client-cpu-mem.py index 7dc9f26..ba5049a 100644 --- a/get-client-cpu-mem.py +++ b/get-client-cpu-mem.py @@ -1,6 +1,8 @@ import commands +import urllib +import psutil -pid = commands.getoutput('ps x | grep "server-solsync" | head -n 1 | cut -d " " -f 2') +pid = urllib.urlopen('http://localhost:8080/pid').read() res = commands.getoutput("ps -p " + pid + " -o \%cpu,\%mem") splitted = res.split() cpu = splitted[2] -- cgit v1.2.3