Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Adtran router reboot via TCL scrip

Posted on 2008-10-23
3
Medium Priority
?
1,112 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 2000 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

The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

Question has a verified solution.

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

Problem Description:   Couple of months ago we upgraded the ADSL line at our branch office from Home to Business line. The purpose of transforming the service to have static public IP’s. We were in need for public IP’s to publish our web resour…
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…
The viewer will learn how to count occurrences of each item in an array.
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 …

719 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