ashok.g has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use Net::OpenSSH::Parallel; my @hosts=('192.168.0.19','192.168.0.18'); my $pssh = Net::OpenSSH::Parallel->new(); sub task() { print "Hi\n"; } foreach my $host ( @hosts ) { $pssh->add_host($host,user =>'root',passwd=>'access',on_error=>($p +ssh, $host, 'OSSH_ON_ERROR_IGNORE',task())); } my $path='/tmp/a.txt'; my $destination='/tmp/a.txt'; $pssh->push('*', scp_put => $path, $destination) or print "UNABLE to P +USH"; $pssh->run or print "RUN FAILED";
[root@station182 Perl]# perl SSH_Parallel.pl Hi Hi
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::OpenSSH::Parallel documentation
by repellent (Priest) on Apr 10, 2012 at 07:07 UTC | |
by ashok.g (Beadle) on Apr 10, 2012 at 14:48 UTC | |
by repellent (Priest) on Apr 10, 2012 at 16:40 UTC | |
by ashok.g (Beadle) on Apr 16, 2012 at 22:32 UTC | |
|
Re: Net::OpenSSH::Parallel documentation
by osbosb (Monk) on Apr 10, 2012 at 14:33 UTC | |
by ashok.g (Beadle) on Apr 10, 2012 at 14:49 UTC | |
by salva (Canon) on Apr 10, 2012 at 15:24 UTC |