blob: eeac1b27c5004a957df899c82aed147c0c6ae5bd (
plain)
1
2
3
4
5
6
7
8
9
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
|