in reply to Net::Telnet on routers and switches

For reasons I never took the time to fully investigate, I could never get Net::Telnet or Net::Telnet::Cisco to work for this either. Since I was short on time I ended up using Expect to automate a real telnet process, and in the end this worked better than the original plan anyway (among other things, when I ran into a switch that had telnet access disabled and only allowed access via ssh, it was a one-line change to make the command that the script called be configurable).


We're not surrounded, we're in a target-rich environment!
  • Comment on Re: Net::Telnet on routers and switches

Replies are listed 'Best First'.
Re^2: Net::Telnet on routers and switches
by pbwiz1970 (Initiate) on Mar 06, 2007 at 17:22 UTC
    Thanks for all the replies. I was able to get it to work, by modifying the Prompt setting on the cmd call. For some reason, this prompt setting did not work,
    Prompt => '/[>|#|\)|:]\s*$|\s/'
    although it works elsewhere using the same method. Not sure I understand why, but my experience is that Perl is funny that way. Anyway, I was able to use
    Prompt => '/#/'
    I will have to expand on that for the 1% of devices whose prompts are not standard for our environment. Thanks again