jeanmichel-gh / expect4r

Other
29 stars 6 forks source link

login issue #4

Open ghost opened 11 years ago

ghost commented 11 years ago

I'm having this issue with login. Here is the output with debug

On Juniper via ssh:

IO.select is debug: IO.select is NIL (TIMEOUT=13) /usr/lib/ruby/gems/1.8/gems/expect4r-0.0.9/lib/expect/io.rb:319:in login': Expect4r::ConnectionError (Expect4r::ConnectionError) from /usr/lib/ruby/gems/1.8/gems/expect4r-0.0.9/lib/router/juniper/junos/junos.rb:17:inlogin' from juniper:21 debug: readbuf: _io_exit?

On Cisco via telnet:

/usr/lib/ruby/gems/1.8/gems/expect4r-0.0.9/lib/expect/io.rb:319:in login': Expect4r::ConnectionError (Expect4r::ConnectionError) from /usr/lib/ruby/gems/1.8/gems/expect4r-0.0.9/lib/router/cisco/ios/ios.rb:38:inlogin' from cisco:20 debug: readbuf: _io_exit?

jeanmichel-gh commented 11 years ago

Hi,

Could you turn on debug before login and send me the output?

r = Ios.new exp_debug :on r.login

Thanks

ghost commented 11 years ago

I had already enabled debug for the first post. I didn't get much information out of it. These were the messages:

IO.select is debug: IO.select is NIL (TIMEOUT=13) debug: readbuf: _io_exit?

thanks for the reply

jeanmichel-gh commented 11 years ago

this tells you that expect4r was unable to see a known prompt, and timed out waiting for one.

On Tue, Jun 4, 2013 at 7:37 AM, foronine notifications@github.com wrote:

I had already enabled debug for the first post. I didn't get much information out of it. These were the messages:

IO.select is debug: IO.select is NIL (TIMEOUT=13) debug: readbuf: _io_exit?

thanks for the reply

— Reply to this email directly or view it on GitHubhttps://github.com/jesnault/expect4r/issues/4#issuecomment-18913136 .

ghost commented 11 years ago

Can you see anything odd with either of these prompts that would trip up expect4r.

cisco:

telnet 172.16.3.98
Trying 172.16.3.98...
Connected to 172.16.3.98.
Escape character is '^]'.

User Access Verification

Password: 
Cisco3750G>

juniper:

ssh jadmin@172.16.3.205
jadmin@172.16.3.205's password: 
--- JUNOS 11.3R1.7 built 2011-08-30 11:50:11 UTC
{master:0}
jadmin@GIRAFFE>
jeanmichel-gh commented 11 years ago

nothing odd here:

"Cisco3750G> " =~ /(.)(>|#|\$)\s$/ => 0

/(^|\r\r)([-a-zA-z@_~=.()\d]+(>|#|%)|%|\$) $/

jmes-MacBook-Pro-1TB:junos jme$ rbenv local system jmes-MacBook-Pro-1TB:junos jme$ ruby -v ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0] jmes-MacBook-Pro-1TB:junos jme$ irb irb(main):001:0> puts RUBYVERSION 1.8.7 => nil irb(main):002:0> "jadmin@GIRAFFE> " =~ /(^|\r\r)([-a-zA-z@~=.()\d]+(>|#|%)|%|\$) $/ => 0 irb(main):003:0> exit jmes-MacBook-Pro-1TB:junos jme$ rbenv local 1.9.3-rc1 jmes-MacBook-Pro-1TB:junos jme$ irb irb(main):001:0> puts RUBYVERSION 1.9.3 => nil irb(main):002:0> "jadmin@GIRAFFE> " =~ /(^|\r\r)([-a-zA-z@~=.()\d]+(>|#|%)|%|\$) $/ => 0 irb(main):003:0>