Advertisement

01.16.2003 at 11:37AM PST, ID: 20460329
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

net::telnet::cisco problem logging into 6500 switches

Tags: cisco, telnet
I have recently been able to have a script log into our cisco routers and execute commands, but I am unable to get the script to log into our 6506/6509/6513 Catalyst switches.  I suspect this is a problem with the prompt format after the login.  I do see that the script is logging in successfully, but it returns with the following error:

pattern match timed-out at ./backupconfigs.pl line 13

Please note that I've pasted some of this together and it might not all make sense, but this is the (sanitized) code I'm using:


use Net::Telnet::Cisco;

my $backup_host  = "172.xx.xx.xx";
my $device       = "hostname";
my $type         = "switch";
my $ios_version  = 12;
my @out;
my $prompt=Voice;

# Login

my $session = Net::Telnet::Cisco->new(Host => '172.xx.xx.xx');
$session->login('loginname', 'password');



# Enable mode

if ($session->enable("password") ) {
    @output = $session->cmd('show privilege');
    print "My privileges: @output\n";
} else {
    warn "Can't enable: " . $session->errmsg;
}


# Transfer config by TFTP

if ($type eq "router") {
    if ($ios_version >= 12) {
        @out = $session->cmd("copy system:/running-config "
                      . "tftp://$backup_host/$device\n\n\n");
    } elsif ($ios_version >= 11) {
        @out = $session->cmd("copy running-config tftp\n$backup_host\n"
                      . "$device\n");
    } elsif ($ios_version >= 10) {
        @out = $session->cmd("write net\n$backup_host\n$device\n\n");
    }
} elsif ($type eq "switch") {
    @out = $session->cmd("copy system:/running-config "
                  . "tftp://$backup_host/$device\n\n\n");
}

$session->close;


What I need to know is how to change what is expected for the prompt in the login function... in this case, the switch simply returns its hostname with no other characters...

Thanks.
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: coorsman
Solution Provided By: budman85
Participating Experts: 2
Solution Grade: B
Views: 28
Translate:
Loading Advertisement...
01.17.2003 at 03:56AM PST, ID: 7747389

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.17.2003 at 05:27AM PST, ID: 7747707

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.17.2003 at 05:33AM PST, ID: 7747736

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.17.2003 at 07:28AM PST, ID: 7748236

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.17.2003 at 05:00PM PST, ID: 7751244

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.25.2003 at 12:30PM PDT, ID: 9620439

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.27.2003 at 05:01AM PST, ID: 9626570

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29