I am trying to connect to HP Switch via SSH using Net::SSH2 Perl module (Windows OS). The script is able to connect and authenticate to the device, but the output is not getting retrieved. I am getting blank output.
I have tried with Net::SSH2 shell and exec both, but no luck till now. Also tried with Net::SSH::Any, still no result.
Hp Switch Model : HP 5900 - 7.1.045
Code
use strict;
use Net::SSH2;
my $ssh = Net::SSH2->new();
$ssh->connect('xx.xx.xx.xx');
$ssh->auth(username => 'xxxxx', password => 'xxxxxx');
my $channel = $ssh->channel() or die 'Error creating channel';
$channel->blocking(0);
$channel->shell();
print $channel "display supervlan\n";
sleep(5);
while(<$channel>)
{
print $_;
}
$channel->close();
$ssh->disconnect();
Can somebody please help.