Fix a bug in monitor.py

This commit is contained in:
zhuyj17 2016-10-06 15:23:59 +08:00
parent 356f609a4a
commit b03018374a
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ class Container_Collector(threading.Thread):
return containers
def get_proc_etime(self,pid):
fmt = subprocess.getoutput("ps -A -opid,etime | grep '^ *%d' | awk '{print $NF}'" % pid).strip()
fmt = subprocess.getoutput("ps -A -opid,etime | grep '^ *%d ' | awk '{print $NF}'" % pid).strip()
if fmt == '':
return -1
parts = fmt.split('-')