psinfo with -aufx to provide detailed and full information about each process
@@ -175,11 +175,12 @@ class SupportBuilder:
def add_psinfo(self, pyz, file_spec):
# A PS listing of al the python applications running on the machine
temp_file = self._interim_file_path + "/" + "psinfo-{}".format(file_spec)
- a = subprocess.Popen('ps -eaf | grep "foglamp\."', shell=True,
+ a = subprocess.Popen('ps -aufx | egrep "(%MEM|foglamp\.)" | grep -v grep', shell=True,
stdout=subprocess.PIPE).stdout.readlines()
c = [b.decode() for b in a] # Since "a" contains return value in bytes, convert it to string
- c_tasks = subprocess.Popen('ps -eaf | grep "./tasks/sending_process"', shell=True, stdout=subprocess.PIPE).stdout.readlines()
+ c_tasks = subprocess.Popen('ps -aufx | grep "./tasks" | grep -v grep', shell=True,
+ stdout=subprocess.PIPE).stdout.readlines()
c_tasks_decode = [t.decode() for t in c_tasks]
if c_tasks_decode:
c.extend(c_tasks_decode)
