Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Beatnik (493)

  (email not shown publicly)

A 29 year old belgian who likes Mountain Dew, Girl Scout Cookies, Tim Hortons French Vanilla Flavoured Cappucinno, Belgian beer, Belgian chocolate, Belgian women, Magners Cider, chocolate chipped cookies and Perl. Likes snowboarding, snorkling, sailing and silence. Bach can really cheer him up! He still misses his dog.

Project Daddy of Spine [], a mod_perl based CMS.

In his superhero time (8.30 AM to 5.30 PM), he works on world peace.

Journal of Beatnik (493)

Tuesday June 20, 2006
06:08 AM

Net::SSH::Perl and Cisco

[ #29974 ]
Trying to get Net::SSH::Perl to connect to a Cisco switch is a pain in the ass. Before, I used Net::Telnet::Cisco but since the customer decided to move everything to a new IOS version, we're stuck with adding support for Net::SSH::Perl. Initially, it seemed like there was nothing we could do but port the scripts to expect but as it turned out, there were some comments on CPAN Forum. Unfortunatly, the suggested patches only work if you want to run a single command.. and not if you have to run enable mode first. Looks like I'll have to get my Expect shoes out anyway :(
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • it turns out i have to deal with this this week as well. i think this will become an increasingly common problem, and what we should do is fashion appropriate modifications into the command structure of Net::Telnet so it can be used as a drop-in replacement rather than having to rewrite everything via Expect (although that may get called on the backend).. anyway, let me know please if you have made progress on this yet.
    • I'm having the same problem. I have a bunch of Net::Telnet::Cisco scripts that need to be converted for SSH only use; the US DOD mandates that telnet never be used for switch management functions so we're having to convert everything. Did you guys make any headway? I'm not a big fan of expect either...
      • Expect worked fine for us.. but then a co-worker pointed out to me that he got stuck in a similar and got a way out by actually just RTFM. He found the solution in the Net::Telnet [] example. It included an example with forking SSH. I still have to implement this solution but it worked for him :)
      • I know this is an old thread... but automating Cisco things has popped to the top of some people's stacks with these recent IOS expliots being announced.

        Anyway, check out my module for this, which is a wrapper around Net::Telnet and supports Telnet, SSH and Serial line scripted command sequences.

        Net::Appliance::Session 0.09 [] (0.12 will be out this week, with some nice new features)