Since I moved I've had a lot of problems with my ADSL connection intermittently dropping out for as much as 10-15 seconds. While any drop-out is annoying because it interrupts my browser, gmail, loses my IRC and iChat connections and so on, it's back quickly enough that I'm not motivated to complain. Last Friday, however, it dropped out for nearly 30 minutes and that's over the line.
Three months ago when the BT engineer came to install my line (the previous tenant having moved it elsewhere) he tested it and told me it was good for a line of this length (I'm about 1.5km from the exchange IIRC). However testing on Friday the Nildram engineer told me that the signal-to-noise ratio was too low.
I have a DG834v1 ADSL router with a web interface. Whenever I went and checked the noise margin was about 6db. According to the engineer 6 is very marginal and is the lower limit the DSLAM requires to hold onto the ADSL connection. During testing I saw it drop below 6. Presumably this is the reason for my dropouts.
He thought that the intermittent nature of the problem meant it was most likely my line but suggested swapping my line filter as a precaution.
After changing the line filter I noticed this morning that my noise margin was 9. Then it was 4. Then it was 9 again. I decided it was time to get serious about tracking this. I didn't fancy scraping the website, but It turns out that the DG834 has a
telnet interface that you can turn on.
The DG834 runs linux and, with some reading, I was able to find the right file containing the ADSL stats (most instructions are for the v3, mine is a v1). From there it was childs play to cook up a Ruby daemon that makes a telnet connection to the router and periodically captures the ADSL line info to a file.
In case it's of interest I've put my dg834statsd code up on github. Every 10 seconds it logs the ADSL line info to disk in both CSV and JSON formats. Here's a sample of the output:
1219054558,5440,39,7,646766160,832,25,6,189435360 1219054568,5440,39,9,646766448,832,25,6,189435600 1219054578,5440,39,9,646766928,832,25,6,189435936 1219054588,5440,39,9,646774800,832,25,6,189441360 1219054598,5440,39,5,646775328,832,25,6,189441696 1219054608,5440,39,9,646776240,832,25,6,189442320
The columns are
downstream line speed,
upstream line speed,
Now I can easily track my S/N margin in semi-realtime and will have some useful stats for the Nildram guys when I phone them back.