Basically I need to make a bash script that acts as a handy tool for diagnosing performance issues. The script needs to first determine each unique process owner on the system, and then for each user that has current processes on the system it needs to:
- Determine the number of processes owned by that user
- Determine the sum of memory for all processes owned by that user (SZ)
- Determine the sum of the current CPU usage for all processes owned by that user (C)
- Determine the cumulative time (TIME) and process name (CMD) of the process with the highest cumulative time owned by that user (Hog: process)
I guess the first step would be to determine all of the unique process owners on the system, and then loop through each?