diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | get-client-cpu-mem.py | 10 |
2 files changed, 12 insertions, 0 deletions
@@ -1,2 +1,4 @@ __pycache__ *.pyc +*.swp +*.swo diff --git a/get-client-cpu-mem.py b/get-client-cpu-mem.py new file mode 100644 index 0000000..eeac1b2 --- /dev/null +++ b/get-client-cpu-mem.py @@ -0,0 +1,10 @@ +import commands + +pid = commands.getoutput('ps x | grep "[s]erver-solsync" | cut -d " " -f 2') +res = commands.getoutput("ps -p " + pid + " -o \%cpu,\%mem") +splitted = res.split() +cpu = splitted[2] +mem = splitted[3] + +print cpu +print mem |