Re: exception in thread? in Net::SSH::Multi



Hi Brian,

Thanks a lot for your work, I really appreciate your effort. :-)

Brian Candler a écrit :
Sylvain Viart wrote:

Works, but I still don't know why the exception are not handled in the
lib Net::SSH::Multi which may be specific to this lib.


Show the backtrace! Otherwise, nobody is going to be able to help you.

Sorry for that, I'm not enough backtrace friendly. :-\

----------------------------8<----------------------- t3.rb
require 'rubygems'
require 'net/ssh/multi'

Net::SSH::Multi.start(:on_error => :warn) do |session|
# define the servers we want to use
session.use 'root@srv-04'
session.use 'root@srv-07'
session.use 'root@srv-08'
session.use 'root@xxxxxxxxxxxxx'

# execute commands on all servers
session.exec( "hostname" )


# run the aggregated event loop
session.loop
end
----------------------------8<-----------------------


ruby t3.rb
error connecting to root@srv-04: Net::SSH::AuthenticationFailed
(root@srv-04)
Text will be echoed in the clear. Please install the HighLine or Termios
libraries to suppress echoed text.
Password:
/var/lib/gems/1.8/gems/net-ssh-2.0.4/lib/net/ssh/transport/session.rb:65:in
`initialize': No route to host - connect(2) (Errno::EHOSTUNREACH)
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:37:in
`join'
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:37:in
`sessions'
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:37:in
`each'
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:37:in
`sessions'
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:81:in
`open_channel'
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi/session_actions.rb:120:in
`exec'
from t3.rb:12
from
/var/lib/gems/1.8/gems/net-ssh-multi-1.0.0/lib/net/ssh/multi.rb:62:in
`start'
from t3.rb:4

shell returned 1

I think you're right and this kind of exception is not handled by the lib.
I've to reread the lib, but its doc is confusing.

Regards,
Sylvain.


.



Relevant Pages

  • Re: nessus scan
    ... Null sessions do NOT allow unauthenticated access to data on ... > when XP Pro users try to change their domain passwords at logon. ... > downlevel clients to access those servers. ... > auditing for account logons events and account management on domain ...
    (microsoft.public.win2000.security)
  • Re: How to protect my terminal servers?
    ... If I turn this all on from the console, will it apply it to all user sessions? ... hassle of downed or rebuilt servers because someone clicked the wrong things. ... I currently have not given users internet access from the TS ... time even with protection. ...
    (microsoft.public.windows.terminal_services)
  • RE: Remote Administration problem after upgrading to 2003
    ... > problem disappears when you remove the server from the domain, ... all of the "built-from-scratch" servers use their ... Edit, but I could see it in the RSOP listing.) ... Changed max sessions to 2, and all the servers are now happy. ...
    (microsoft.public.windows.terminal_services)
  • Allowing internet access in Terminal sessions...
    ... MS 2003 server with Terminal servers, IE explorer 7. ... I want to allow my TS users to have internet access from the Terminal ... sessions so that links to web sites etc from within apps are active. ...
    (microsoft.public.windows.terminal_services)
  • Where do you put your modules?
    ... enough to package into separate modules and publish on CPAN. ... in a module call KOBagOTrix.pm and just use a "use lib" statement to ... accounts on those servers. ...
    (perl.beginners)