[wellylug] adsl--DSL-504T
David Antliff
david.antliff at gmail.com
Sun Jul 23 21:44:19 NZST 2006
Roger Young wrote:
> I have similar problems with the 504G router.
> It usually drops the connection some time during the
> night. Since that is when IHUG have their "cheap"
> rate I began to wonder if it wasn't all a plot :)
> David, I would like a copy of your script please.
Hi Roger,
I have placed the script here:
http://homepages.ihug.co.nz/~david.antliff/scripts/monitor-dsl504g
It's written in Perl and has configurable parameters near the top. The
comments should help you sort out what to do. Let me know if you can't
get it to work. You might need to install a couple of Perl modules, the
details of this will depend on your Linux distribution.
Net::Telnet
Net::Ping
Term::ReadKey
I run this script inside a 'screen' session. It periodically performs a
"TCP ping" to the specified target every 300 seconds (I use
www.google.com, but you can use anything you want, including a numerical
IP address if you want to avoid temporary DNS failures). If the ping
fails, it checks more often for a duration and then will trigger a
reboot on the router. It's set to email root at localhost when a reboot has
occurred, which is easy to disable if you don't want this.
Note that the router password is held in memory by the script (although
never displayed) so this might be a security issue. If anyone has a
better way to do it, please let me know.
I hope this suits your needs. Feel free to modify of course, and if you
come up with any improvements or a better way to do it, please let me know.
Thanks,
--
David.
More information about the wellylug
mailing list