I am used to restart my servers on a scheduled basis. Now I want the same for my ADSL router.

This is my reason: When a random failure occurs, I am used to normally try to reboot the servers , interfaces and related equipments (if possible) as the first step before any other troubleshooting (e.g: changing configurations, etc). In fact there are times that this corrects the problem (The service starts working as expected). This may be because when a system is long time up (sometimes, depending on the software and services), it may become unresponsive or faulty. May be the software fails to release some memory, unlock some resources , etc

Now for some services which scheduled down time is acceptable during non-work hours, I schedule the automatic restart. This way, such type of problems appear less frequently. And now if a problem occurs during work-hours, I don't need to restart the whole service, instead I will resume troubleshooting like after I had restarted them.

What we have

This is a Billion 5000 Series router and supports TELNET, HTTP and SNMP for management.

Telnet method (Updated)

This is possible to reboot the router via telnet command:

    router>set reboot

So near, just need a script that automatically telnets, pushes password characters and issues the 'set reboot' command. [The approach of using expect suggested by SvenW]

HTTP method

Good to mention that I utilize a software[1] application for monitoring my ADSL connection speed and noise margin via HTTP interface (the software itself, instead of a browser application, connects, logs in unattendedly and reads the values from HTTP interface and display them in a graph!).

I wonder if it is possible to achieve the SysRestart with similar approach (A script that automatically logs in and clicks the SysRestart button!)

The restart page:

  • Picture of the page: HTML Page with restart button
  • The source HTML of the page:

    <meta http-equiv=Content-Script-Type content=text/javascript>
    <meta http-equiv=Content-Style-Type content=text/css>
    <meta http-equiv=Content-Type content="text/html; charset=
    <link rel="stylesheet" href="../css/style.css" type="text/css">
    <script language="JavaScript"> 
    function doRefresh()
        alert("Reboot Complete");   parent.navigation.location.href = "/navigation-status.html";
        window.location.href = "../status/status_deviceinfo.htm";
    function doLoad()
    </head><body onload="doLoad()">
    <FORM METHOD="POST" ACTION="/Forms/tools_system_1" name="System_Restore">
    <table width="760" border="0" align=center cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
          <td height="5" class="light-orange" colspan="5">&nbsp;</td></tr><tr>
        <td width="150" height="30" class="title-main">
        <font color="#FFFFFF">System Restart</font>    </td><td width="10" class="black">&nbsp;</td><td width="150"></td><td width="10"> </td><td width="440"></td></tr><tr>
        <td class="light-orange">&nbsp;</td><td class="light-orange"></td><td class="tabdata"><div align=right>
        <font color="#000000">System Restart with</font>    </div></td><td class="tabdata"><div align=center>:</div></td><td class="tabdata">
            <INPUT TYPE="RADIO" NAME="restoreFlag" VALUE="0" CHECKED>       <font color="#000000">Current Settings</font>       </td></tr><tr>
        <td class="light-orange">&nbsp;</td><td class="light-orange"></td><td class="tabdata">&nbsp;</td><td class="tabdata">&nbsp;</td><td class="tabdata">
            <INPUT TYPE="RADIO" NAME="restoreFlag" VALUE="1">       <font color="#000000">Factory Default Settings</font>       </td></tr><tr>
        <td class="light-orange">&nbsp;</td><td class="light-orange"></td><td width="150">&nbsp;</td><td width="10">&nbsp;</td><td width="440">&nbsp;</td></tr></table><table width="760" border="0" align=center cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <td width="160" class="black" height="42" >&nbsp;</td><td width="160" class="orange">&nbsp;</td><td width="440" class="orange">
            <INPUT TYPE="SUBMIT" NAME="Restart" VALUE="RESTART">    </td></tr></table></div></form>

SNMP Method

The router also has support for SNMP v2 read and write communities. I thought it might be possible to perform it this way.

In fact, by some search I found[2] that some people use SNMP to restart their devices (But I can't find an OID for my router to pass for performing a reset)

For example it appear that those who have one of these devices can reboot them using these OIDs:

'.',    # Allied Telesyn restart
'.', # Hewlett-Packard hpicfReset
'.',        # Cisco CatOS sysReset
'.',          # Cisco IOS tsMsgSend
'.'         # Ascend sysReset


Using SNMP walk I could get a list of more than five hundred OIDs such as:

...etc (568 more)...

But I have currently no idea how can I pick one among them (specially afraid to test snmp-write on them!).

Some more info

Some other (walked) OID and values that might help:

.; Trendchip TC3162 T14F7_3.0
.; www.huawei.com
.; Ras Ver:   DMT Ver:

How can you help ?

  • Suggesting a way to script a restart via SNMP (Requires finding the OID first!?)
  • Suggesting a way to script a restart via HTTP
  • Suggesting a way to script a restart via telnet
  • Suggesting a way to script a restart (any other ways!)


  • Provide source code of web page where you see the restart button, so that anyone could help you with the script.
    – John
    Dec 23, 2012 at 12:47
  • @John: Image and source code of webpage added to the question text
    – F.I.V
    Dec 24, 2012 at 9:41

1 Answer 1


Without a proper MIB file for SNMP your best bet will to either find some telnet command that does the restart and maybe use it with the help of the expect tool or to use something like curl to use the web interface.

Using curl might require multiple calls to it to first login and save a session cookies and then to do the actual restart.

I do wonder though - do you have an actual problem with the device you try to fix with a regular restart? If not, I can't see the reason to do so.


Basic example for an expect script. Call it with scriptname hostname password or alter the variable assignments to contain the actual hostname and password:


set timeout 15
set hostname [lindex $argv 0] 
set password [lindex $argv 1] 

spawn telnet $hostname 

expect "Password:" 
send "$password " 
expect "router>" 
send "set reboot "
  • The telnet section updated with showing the command to execute the reboot. Also the background section updated to show the reason behind doing this scheduled reboot.
    – F.I.V
    Dec 24, 2012 at 9:42
  • @AliFakoor: See my edit for an expect example. More infos via man expect and Google.
    – Sven
    Dec 24, 2012 at 10:09
  • This is exactly what I was looking for. I should have mentioned that it is a windows host connected to router, but thats fine, I will go do the rest (finding / compiling expect port for windows, etc). Tnx a lot
    – F.I.V
    Dec 25, 2012 at 5:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.