cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7346
Views
0
Helpful
2
Replies

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

accenture-bang2
Level 1
Level 1

                   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

Sandeep Choudhary
VIP Alumni
VIP Alumni

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.

View solution in original post

2 Replies 2

Sandeep Choudhary
VIP Alumni
VIP Alumni

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.

Hi..

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: