Hi, i wonder if someone can help me with this,
I am trying to get the results of top across multiple machines at the same time. I only care about the first process listed by 'top'. I can't figure out how to make this happen. I have got passwordless SSH, and have made the following script to extract the entry i care about from top.
#!/bin/sh
top | sed -n '
#Dont print all lines
/PID/ {
#if PID is found
n
#get the next line
p
#print it
}'
I dont know how to proceed to make it a) work across multiple machines simultaneously, if i ssh into another machine i get an error such as 'TERM environment variable not set', and if i run it in the background with & it just stops. b) make the output go onto the same line each time, instead of filling up my console with line after line of the same kind of output. The type of output i would like would be similar to top, just refreshing the output over the same lines.
Any kind of input towards helping me with either problem would be greatly appreciated!
Cheers,
Phil