2

Is there a cross-machine top -u myUsername command that I can see my processes (along with their CPU usages) across all the specified machines?

If not, I have an idea in mind. I can write a script that SSH into a machine, top -u myUsername, then SSH into the next machine, top -u myUsername again, ..., finally compile everything and display on my current logged in machine. I am not sure how I can "return" the top results from a secondary session to my current session.

Is there a better or more elegant way?

1
  • Use top -b as batch mode. Commented Mar 19, 2017 at 19:08

1 Answer 1

0

Try something like this:

for i in $(cat server_list); do ssh $i 'hostname;top -b -n1 -u myUsername'; done >> mytop.out 
1
  • Thanks! Hmmm, I would like something dynamic, like top itself. Keeping refreshing in a terminal window. Commented Mar 19, 2017 at 21:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.