Net-SSH-Perl - net-ssh-perl hangs an excessive cpu usage

Posted on Fri Aug 4 00:10:45 2006 by opensrcguru
net-ssh-perl hangs an excessive cpu usage
folks, i have a simple script that is to ssh to a remote host and return the output of uname -a. sounds simple enought...right? the script is taking forever to complete and chews up tons of cpu while trying to accomplish my task. do you guys have any idea what the issue may be?
#!/usr/bin/perl use strict; use Net::SSH::Perl; use Net::SSH::Perl::Auth; my %params = ( protocol =&gt 2, interactive =&gt 0, debug =&gt 1, ); my $ssh = Net::SSH::Perl-&gtnew("10.121.121.5",%params); $ssh-&gtlogin("dbc","dbc123"); my($stdout, $stderr, $exit) = $ssh->cmd("uname -a"); print STDOUT "\$stdout = $stdout\n"; print STDOUT "\$stderr = $stderr\n"; print STDOUT "\$exit = $exit\n";
Direct Responses: 2751 | Write a response