Solved

Adtran router reboot via TCL scrip

Posted on 2008-10-23
3
1,017 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
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

We've been using the Cisco/Linksys RV042 for years as: - an internet Gateway - a site-to-site VPN device - a leased line site-to-site subnet-to-subnet interface (And, here I'm assuming that any RV0xx behaves the same way as an RV042.  So that's …
The Cisco RV042 router is a popular small network interfacing device that is often used as an internet gateway. Network administrators need to get at the management interface to make settings, change passwords, etc. This access is generally done usi…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now