Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Looking for Script for Auto login to router via ssh & command output

                   Hi expert,

I am looking for some solution.

We have around 8 router, everyday twice,we need to login(SSHv2) to each router runc 2-3 command(Ping some interface for Latency checking,router uptime)

I am looking for some script/tool so that work can be minimized/aitomatic.

Something Like auto login to router, command will run automatically & output will be showing on screen/some batch file kind of output

Pls suggest script/toll for the requirement

1 ACCEPTED SOLUTION

Accepted Solutions
VIP Purple

Looking for Script for Auto login to router via ssh & command ou

Hi Bang-2,

If you are using Linux OS then :

it should work :

-------------------------------------

#!/usr/bin/expect

set timeout 20

spawn telnet 10.1.1.1

expect "Username:"

send "test\r"

expect "Password:"

send "test\r"

expect "*#"

interact

exit

---------------------------------

Regards

Please rate if it helps.

2 REPLIES
VIP Purple

Looking for Script for Auto login to router via ssh & command ou

Hi Bang-2,

If you are using Linux OS then :

it should work :

-------------------------------------

#!/usr/bin/expect

set timeout 20

spawn telnet 10.1.1.1

expect "Username:"

send "test\r"

expect "Password:"

send "test\r"

expect "*#"

interact

exit

---------------------------------

Regards

Please rate if it helps.

New Member

Looking for Script for Auto login to router via ssh & command ou

Hi..

Pls share in case of Login from Windows xp /vista system

2229
Views
0
Helpful
2
Replies
CreatePlease to create content