RE: [Ssh-sftp-perl-users] Anyone have an example of SSH2 to Cisco?
Brought to you by:
dbrobins
From: Eric L. <net...@er...> - 2006-05-17 00:42:22
|
> Behalf Of Matthew J. Salerno > Did you read the error message or just post it? > > "exec is not a valid Net::SSH2 macro at ./ssh2.pl line 44" > > Read the docs. There is no reference to exec. Your e-mail > is not even asking a question! > > http://search.cpan.org/~dbrobins/Net-SSH-Perl-1.30/lib/Net/SSH/Perl.pm > > Look at the given example. Matthew, The actual Link should be http://search.cpan.org/~dbrobins/Net-SSH2-0.08/lib/Net/SSH2.pm since Mark is trying to work with Net::SSH2, not Net::SSH::Perl. Mark is trying to use the new module. Mark, The problem with your script is that you are calling execute on the ssh2 object and not the channel object. Changing this: my $chan = $ssh2->channel(); $ssh2->exec('sh ver'); To this: my $chan = $ssh2->channel(); $chan->exec('sh ver'); Should take care of the problem with the invalid macro. Hope this helps. |