SSH Expect skipping "more" prompt on router -



SSH Expect skipping "more" prompt on router -

after testing several modules sending ssh commands perl, selection net::ssh::expect module (able send mutiple commands unique connection)

i still testing functions on it, here's code :

use net::ssh::expect; $user="myuser"; $host = "126.30.186.249"; $passwd = "mypasswd"; $ssh = net::ssh::expect->new(host => "$host", password=> "$passwd", user => "$user", raw_pty => 1 ); $login_output = $ssh->login(); $ssh->send("sh arp"); $line ; while ( defined ($line = $ssh->read_line()) ) { print $line . "\n" ; }

here's issue : when using "exec" function instead of "send" :

sh arp protocol address age (min) hardware addr type interface net 126.30.186.3 112 0080.9f8b.fc1a arpa gigabitethernet0/1.186 net 126.30.186.6 163 0080.9f8b.fc1a arpa gigabitethernet0/1.186 net 126.30.186.247 - e4c7.2291.5181 arpa gigabitethernet0/1.186 net 126.30.186.248 33 885a.9291.c7e1 arpa gigabitethernet0/1.186 net 126.30.186.249 - 0000.0c07.ac65 arpa gigabitethernet0/1.186 net 126.30.186.250 - 0000.0c07.ac66 arpa gigabitethernet0/1.186 net 126.30.187.241 38 0017.e05d.b144 arpa gigabitethernet0/1.230 net 126.30.187.242 96 0012.dada.65c1 arpa gigabitethernet0/1.230 net 126.30.187.243 96 f025.7275.63c1 arpa gigabitethernet0/1.230 net 126.30.187.250 - 0000.0c07.ac00 arpa gigabitethernet0/1.230 net 126.30.187.251 - e4c7.2291.5181 arpa gigabitethernet0/1.230 **--more--**

this "more" prompt problem. can see, tried "send" , made while loop. result given same, without --more-- prompt. need skip "more" prompt , see result. net::openssh giving me result when sending "capture". searched functions skipping automatically "more" prompt... not results :( can help me on ? thanks.

adding

my $out2 = $ssh->exec ("term le 0");

before executing command working. allows terminal emulated ssh connection not limit line buffer working on cisco/hp materials. don't know if it's working on other.

ssh expect router net-ssh

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -