Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Perl Script to enable Cisco

by dasgar (Curate)
on Jul 23, 2012 at 18:13 UTC ( #983220=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Perl Script to enable Cisco
in thread Perl Script to enable Cisco

Since it sounds like you'll need to your script to interactively respond to the remote device, I think that you need to use something like Expect.

I personally have never used expect, so I can't offer up more details on how to use expect. Based on my limited knowledge of expect, I believe that it can be used to issue a command, what for a specific response, and then issue another command based on the response received.


Comment on Re^3: Perl Script to enable Cisco
Re^4: Perl Script to enable Cisco
by Null_Route0 (Initiate) on Jul 23, 2012 at 18:17 UTC
    Ok I'll give it a try, Im pretty stumped right now.

    There is actually a module out there that does what I am trying to do called Net::Telnet::Cisco

    It supports an enable feature specific for Cisco $session->enable("enable_password")

    This would do the trick but the problem is our Ciscos are running SSH not Telnet so I am using Net::SSH::Perl which does not have the same enable option as N::T::C

    Is anyone aware of a way I could modify the NTC module to use SSH instead of telent?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://983220]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2015-07-02 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (33 votes), past polls