On Sat, Mar 31, 2007 at 10:40:15PM +0900, Robert Dober wrote:
> >Not that I'm aware of. But if you discover something please let me know -
> >I'm going to have to do this myself in the next few weeks too.
> >
> >I was planning just to use plain Net::Telnet, which I think is good enough
> >for what I need.
> Please kindly let me know about this, I was trying to do this with
> Catalyst 29xx series Switches and a 2600 router, no luck so far, I
> guess the prompt, timeout selection is quite tricky :(

The best documentation is the source, /usr/lib/ruby/1.8/net/telnet.rb

Make sure you call your code with a debug block, e.g. (untested)

   n = Net::Telnet(...)
   blk = proc { |str| $stderr << str }
   n.login("user", "password", &blk)
   n.cmd("show users", &blk)

By adding &blk to all of the Net::Telnet methods, you'll get debugging
output to the screen and you can see how far it's getting.

IIRC, the default regexp for a prompt looks for '# ' and '> ' (i.e. with a
trailing space). Typical Cisco prompt is 'router>' without the trailing
space. So easy enough to fix: just pass in a suitable prompt regexp.

Brian.