thanos1983 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I have created a script that can run in parallel multiple ssh connections, I am using the Net::OpenSSH::Parallel module for my task. Well my problem now is that I do not know if there is a way to apply multiple ssh connections to different primary servers, and as a second step I need to apply ssh connections to secondary servers and execute a set of commands.
Update: Primary and secondary servers are first and second line of servers. Further analysis, I have a set of different servers that I need to ssh simultaneously, those are the primary servers. Once I login to the primary servers then as a second step I want to ssh to the secondary servers.
localhost --> Primary 1st --> Secondary 1st localhost --> Primary 2nd --> Secondary 2nd localhost --> Primary 3rd --> Secondary 3rd ... ... ... localhost --> Primary nth --> Secondary nth
So my question, is that possible to be done with Perl?
Update 2: I have found a possible solution, ssh tunnel via multiple hops but I was wondering if it can be done by a module or possibly to be combined with Net::OpenSSH::Parallel module.
It is mandatory and important to me to execute the commands simultaneously at all servers. this is the reason that I am using the Net::OpenSSH::Parallel module.
Once more thank you for your time and effort to assist me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to apply multiple parallel consecutive ssh sessions
by salva (Canon) on Jan 06, 2015 at 23:43 UTC | |
by thanos1983 (Parson) on Jan 07, 2015 at 00:02 UTC | |
by salva (Canon) on Jan 07, 2015 at 09:40 UTC | |
by thanos1983 (Parson) on Jan 07, 2015 at 14:34 UTC | |
|
Re: How to apply multiple parallel consecutive ssh sessions
by jellisii2 (Hermit) on Jan 07, 2015 at 12:45 UTC | |
by thanos1983 (Parson) on Jan 07, 2015 at 14:38 UTC |