[plug] Unattended reset of ADSL modem

Daniel Pittman daniel at rimspace.net
Thu Feb 19 13:10:33 WST 2009

Steve Boak <sboak at westnet.com.au> writes:
> On Thu, 19 Feb 2009 10:15:04 am Steve Baker wrote:
>> Steve Boak wrote:
>> > Several hours later it was resolved, but no idea what was done to
>> > fix it.  Steve
>> Is this a permanent solution?  Or are you still going to have to do
>> some soldering hocus-pocus?
> At this stage, I am assuming the problem will recur at some random
> time in the future.
> So, I'm going to write a script to detect outages with a ping and soft
> reset the modem first. If that doesn't work I will try the relay
> approach.
> Does anyone know of a good library to parse web pages, enter text into
> fields, and press buttons? Something like a chat script for web pages?

I use WWW::Mechanize, a Perl module for that sort of scripting myself.
It pretends to be a web browser fairly effectively, so I can interact
with the remote page at a fairly high level.

For the reset, though, you should be able to view the HTML source of the
form, then just POST (or GET) the corresponding target directly.  Since
you are working with an appliance you can be confident that the CGI is
not going to change much. :)

That means no form filling, no clicking, no waiting, just send the
request and have the result. :)

> I also noticed the modem supports SNMP. Not knowing much about SNMP,
> can it be used to control devices, or is it only a status reporting
> system?

It can be, but I don't think most consumer grade modems allow you to do
anything useful via SNMP in terms of configuration.[1]

What you may be able to do, though, is verify the state of the modem via
SNMP, which could make your script less sensitive to resetting the
device when (for example) the ADSL phy is down.


[1]  Actually, I can't think of any device I dealt with that would allow
     a reset via SNMP, but there isn't a technical reason you couldn't
     hook it up.

More information about the plug mailing list