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