Getting Debian router to notify via HTTP if internet is down
I'm running a Debian box that is serving as a internet gateway/router/server host.
The internet comes from a cable connection on eth0 and is then routed appropriately out to eth1 by the Debian system. ip's are given to computers behind this box via dhcp (udhcpd). the Debian system itself gets its ip via dhcp. Everything is setup and works fine.
However, at times the cable connection will go down. Nothing I can do about it, it's a provider issue. However, what I would like to do is if the outage occurs while computers behind the Debian system are browsing the web, that the Debian box can redirect HTTP requests from the internal network to an internal webpage indicating the internet is down temporarily.
I can access the cable modem's diagnostic page to figure out if the connection is up or down. And redirecting HTTP requests to an internal page would have to be done by some sort of HTTP proxy server, correct? I've looked through various proxy servers and am thinking that tinyproxy would be the best one.
I'm thinking I will have to setup a script/program to execute on a regular basis (say, every minute) and check the cable modem's diagnostic page. If it indicates no connection, then reconfigure/restart the proxy to return a descriptive page. If it indicates a connection, reconfigure/restart the proxy to pass through.
However, is there some tool or combination thereof that can do this similar task better? Any suggestions or ideas?