I am trying to interact with Nexus device through Windows via Perl script. These device accept SSH only hence I used Net::SSH2 module.
By using this script it throws nothing for cisco device running IOS-XR or NX-OS but works well for Normal IOS device. .>/p>
After doing debug it prints below lines but I do not know what is this.PPM Call use warnings; use strict; use Term::ANSIColor qw(:constants); use Term::ANSIColor; use Win32::Console::ANSI; #use Text::CSV; use Net::SSH2; Credential declaration / dynamic directory my $user='xxxx'; ### Use your username chomp $user; my $pass='yyyy'; ### Use your Password chomp $pass; my @current_dir=`cd`; $current_dir[0]=~s/\\/\\\\/g; chomp $current_dir[0]; my $ssh = Net::SSH2->new(); #$ssh->debug(1); if(!$ssh->connect('172.16.23.158')){ print BOLD RED "Failed login\n",RESET; } if(!$ssh->auth_password($user,$pass)){ print "Login NOK\n"; } my $channel = $ssh->channel(); $channel->blocking(0); $channel->shell(); print $channel "term len 0\n"; my @junk; push (@junk,"$_") while <$channel>; foreach (@junk) { print BOLD CYAN "$_\n",RESET; }
Can anyone help to move forward?libssh2_channel_open_ex(ss->session, pv_channel_typ Net::SSH2::poll: timeout = 250, array[1] - [0] = channel - [0] events 1 - libssh2_poll returned 0 - [0] revents 0 Net::SSH2::poll: timeout = 250, array[1] - [0] = channel - [0] events 1 - libssh2_poll returned 0 - [0] revents 0 Net::SSH2::Channel::DESTROY Net::SSH2::DESTROY object 0x3604f98"
In reply to Perl Net::SSH2 on Window by livenode
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |