#!/usr/bin/perl -w
use strict;
use Net::SSH::Perl;
my $command="sh ver";
my $router= 'routername';
my(@sshout, $stderr, $exit);
my $ssh = Net::SSH::Perl->new($router,debug => 1, protocol => '2,1',use_pty
=> 1 );
$ssh->login('username','password');
(@sshout, $stderr, $exit) = $ssh->cmd("$command");
print @sshout;
this small program allows you to connect to a router via ssh.
it look fine except that the result of the command is not shown.
any help
|