- 论坛徽章:
- 0
|
本帖最后由 zhengsenlin888 于 2014-06-30 14:25 编辑
#!/usr/bin/perl
use MIO::SSH;
my %param = (
max => 32,
user => 'fivetrees',
passwd => 'fivetrees',
port => '36888',
timeout => 10
);
my @node = qw(10.190.237.139 10.190.139.89 10.204.215.57);
my @cmd = qw(uptime);
my $ssh = MIO::SSH->new( map { $_ => \@cmd } @node );
my $result = $ssh->run(%param);
my $output = $result->{output};
my $error = $result->{error};
运行结果:
$ perl miossh.pl
warning: Connecting to 10.190.237.139 failed: Connection Refused
warning: Connecting to 10.190.139.89 failed: Connection Refused
warning: Connecting to 10.204.215.57 failed: Connection Refused
请问下哪里有问题?谢谢。
MIO::SSH模块的介绍
https://metacpan.org/pod/MIO::SSH
MIO::SSH SSH.PM
http://cpansearch.perl.org/src/KAN/pantheon-0.58/lib/MIO/SSH.pm |
|