Solved

Adtran router reboot via TCL scrip

Posted on 2008-10-23
3
1,091 Views
Last Modified: 2013-11-22
I'm looking for some guidance on a tcl script to reboot a router should an interface go down. Can anyone point me in the right direction?

Thanks,

Brad
0
Comment
Question by:bctel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 22827230
is there a specific reason to do it with Tcl?
0
 
LVL 1

Accepted Solution

by:
tinh20012002 earned 500 total points
ID: 23369360
I used Activetcl 8.4.19 from activestate.com.  Make sure you select the free version package.  
This package.  After installation (on windows). you write the scripts similar to this:
----
package require Expect;
# telnet the to router and check interaface.  #If down reboot router. # need minor modification to fit your #Environment.  
spawn telnet $Router_IP;
      expect "user: "; send "username\r";   expect "Password: "; send "pwd\r";
      expect -re "#"; sleep 3 ; # the "#" here  is the prompt of your router      
      set expect_out(buffer) "";
      send "place the command to checkk routeer interace here";       
      expect -re "#"; sleep 2; set test_buff $expect_out(buffer);
      if { [regexp "down" $test_buff ] == 1 } {
            puts "interface status: $test_buff"
            send "reboot cmd \r";       expect -re "w\confirm";       send "Y \r"
      }      

# you can also use Linux completely, or cywgin for windows.
0

Featured Post

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an OSPF network that automatically (dynamically) reroutes network traffic over other connections to prevent network downtime.
In the world of WAN, QoS is a pretty important topic for most, if not all, networks. Some WAN technologies have QoS mechanisms built in, but others, such as some L2 WAN's, don't have QoS control in the provider cloud.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question