Hello all,
I've just joined. I did a google search and your site came up,
I had a look and thought I'd like to become a member.
I'm from Ireland.
I've written a few scripts before, but this new task has me foxed.
I would like to figure out the best approach to achieving the following
A single script that does the following
login to machine a (I typically use putty to do this)
login to machine b (as above)
on machine_a run a command such as "service xxx stop; service xxx start"
on machine_a ps -ef | grep AppName to confirm the app started right
on machine_a run top, and grep for a process by name, and batch the cpu% usage result to a file ( I can do this already)
on machine_b cd to a specific directory
on machine_b run a script that points at machine_a
on machine_b, when the script finishes
machine_a will parse the result file, and confirm the average of the cpu% is less than a threshold
That's pretty much it.
The hard part I suppose would be the single script spawing scripts on two different machines and synchonising them?
Thanks for your help in advance!
Bloke