The ADSL Modem hangs every now and then.. a reboot work all the time.. this is a issue if there is nobody to reset the modem or the site is remote.
The solution is a simple script in Python which check if “Google” is accessible every 5 min, if google is not available then reboots the ADSL Router, { Not included in the script due to dependencies: you could also send a email or syslog event at every reboot or send the copy of the log File end of the Day}
The Python Script Runs on a Linux Box.. nothing great and simple box. using Python and pExpect, the script logs into the modem whenever it cannot ping http://www.google.com and send a reboot command to the router. A log of the Reboot is maintained.
The CRON is enabled to periodically check availability of internet access through the modem.. every 5Mins.. (for India with BSNL) but any larger time frame can be used, as required
Continue reading