A bit of irony (with respect to DSL providers)

David Wolfskill david at catwhisker.org
Thu Sep 15 05:29:49 PDT 2005


I had sent Robert a private note stating that my Pac*Bell residential
DSL (with a grandfathered static /32) has been pretty good for the last
several years -- though I still ran a Perl script on my firewall box
that does periodic reality checks on connectivity, initiates evasive
action if called for, and logs its activities.

The log in question is one of the logs I check every morning.  And this
morning, I see:

Sep 15 01:56:00 janus dsl_mon: DSL now down
Sep 15 01:56:15 janus dsl_mon: DSL still down after ifconfig (00:00:15 so far)
Sep 15 01:56:16 janus dsl_mon: Got RC 0 from turning DSL MODEM off
Sep 15 01:56:47 janus dsl_mon: Got RC 0 from turning DSL MODEM on
Sep 15 01:58:02 janus dsl_mon: DSL now back up after 00:02:02

(This is the first time I've seen anything in that log other than the
note that newsyslog rotated it in months.)

It is rather nice to finally(!) have things in place to take that
evasive action automatically.  Of course, it's ideal to not need it, but
not running it would appear to be foolish.  :-}

(The original version, from November 2001, would wake up periodically
and actively ping the DSLAM.  It wasn't until June 2003 that figured
out that I could just look at the NIC counters, and if they were
increasing from one look to the next, that was a clear indication
that traffic had been flowing during the interval.  So now it checks
the NIC counters, and if they fail to show traffic flowing, then
it tries an active ping.  (At any point, if the maneuver succeeds,
it goes back to sleep -- after logging everything, of course.)  If
the ping also fails, it uses ifconfig to bring the NIC down, then
back up.  (The box is a P-150 with 64 MB RAM; it also does my SMTP
service, including anti-virus/anti-spam checks in milters:  sometimes
mbufs get to be scarce resources.)

Finally, if bouncing the NIC with ifconfig still fails to allow the ping
to work, it uses a bit of X10 (home automation) hardware to drop power
to the DSL MODEM for 30 seconds, then powers it back up (at which point
the script goes back to sleep, as there's little point in having it wait
actively for the DSL MODEM to re-sync itself).

And the next time it wakes up, it does its check, and if the link is
still down or it changed state, that's logged... as you see.  :-}

So it's not on-topic for the original discussion, but I thought some of
y'all might find it amusing.  And yes, I can make the script available
for folks who want to play with it.  It was cobbled up in a FreeBSD
environment, and depends on /usr/ports/misc/bottlerocket -- the program
to handle the X10 stuff via serial interface comes from that.

Peace,
david
-- 
David H. Wolfskill				david at catwhisker.org
Prediction is difficult, especially if it involves the future. -- Niels Bohr

See http://www.catwhisker.org/~david/publickey.gpg for public key.



More information about the Baylisa mailing list