in reply to Telnet to Cisco command prompt...
Given this, I do not understand your question. Why do you think that you are still not logged in? If this is the end of the script, then of course you will no longer be logged in. The telnet session is within the context of the perl script. Once the perl script ends, the telnet session goes away.#!/usr/bin/perl use Net::Telnet::Cisco ; my $switch = $ARGV[0] ; print "$switch \n" ; my $session = Net::Telnet::Cisco->new(Host => 'ba1-1'); $session->login('charlie', 'letmein'); if ($session->enable("letmein") ){ @output = $session->cmd('show privilege'); print "My privileges: @output\n"; } else { warn "Can't enable: " . $session->errmsg; }
If there is more to the script that you have not provided that seems to indicate that the login has terminated, I/we need to see it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Telnet to Cisco command prompt...
by WearyTraveler (Novice) on Sep 25, 2008 at 02:41 UTC | |
by Illuminatus (Curate) on Sep 25, 2008 at 16:08 UTC |