summaryrefslogtreecommitdiff
path: root/get-client-cpu-mem.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-04-10 18:51:18 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-04-10 18:51:18 -0400
commitd2a5752b6ed0048216ead3d53e694bb8b84b6e34 (patch)
tree0af1b093031e3db85321ae0208e46b0c4989b514 /get-client-cpu-mem.py
parentc5de6f188dac491f114861648aafb30737da131f (diff)
move data to its folder
Diffstat (limited to 'get-client-cpu-mem.py')
-rw-r--r--get-client-cpu-mem.py4
1 files changed, 3 insertions, 1 deletions
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]