# HG changeset patch # User Daniel O'Connor # Date 1384953938 -37800 # Node ID b1048f889ef8420fc58ef8e02c6ab6f6cccacb7d # Parent 98fe11ea4c82ec6a5dcd56b386a23cead9ae98f1 Newer Billion modem diff -r 98fe11ea4c82 -r b1048f889ef8 adsl.html --- a/adsl.html Sat Mar 28 17:53:25 2009 +1030 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ADSL
Parameters
ADSL Mode - -
Modulator - -
DSP FirmwareVersionDMT FwVer: 3.7.6.98_A_TC, HwVer:T14F7_1.0 - -
DMT StatusUp -
Operational ModeADSL2 -
Upstream1001 kbps -
Downstream6094 kbps -
Noise Margin (Upstream)6.3 db -
Noise Margin (Downstream)6.2 db -
Attenuation (Upstream)35.2 db -
Attenuation (Downstream)46.0 db -
-
-  - -
- - - diff -r 98fe11ea4c82 -r b1048f889ef8 adslstats.py --- a/adslstats.py Sat Mar 28 17:53:25 2009 +1030 +++ b/adslstats.py Wed Nov 20 23:55:38 2013 +1030 @@ -57,20 +57,10 @@ (options, args) = opts.parse_args() -statsurl = "http://%s/adsl.asp" % (options.name) +statsurl = "http://%s/status/status_deviceinfo.htm" % (options.name) rrdname = "%s.rrd" % (options.base) graphbasename = options.base -matchnum = re.compile('([0-9]+(\.[0-9]+)?)') -statsdict = { - 7 : 'Upstream', - 8 : 'Downstream', - 9 : 'Noise Margin (Upstream)', - 10 : 'Noise Margin (Downstream)', - 11 : 'Attenuation (Upstream)', - 12 : 'Attenuation (Downstream)' } - - class ADSLStats(object): def __str__(self): return """Line Rate - Up: %d kbits, Down %d kbits @@ -79,28 +69,29 @@ self.nmup, self.nmdown, self.attenup, self.attendown) -def cleannum(s): - s1 = matchnum.match(s).groups()[0] - try: - return int(s1) - except ValueError: - return float(s1) - def getstats(f): s = BeautifulSoup(f) - a = s.findAll('tr') + a = s.findAll('td') - for i in statsdict: - assert a[i].td.contents[0].contents[0] == statsdict[i] + # Sanity check in case the firmware changes page layout + assert(a[122]('font')[0].contents[0] == 'SNR Margin') + assert(a[129]('font')[0].contents[0] == 'Line Attenuation') + assert(a[136]('font')[0].contents[0] == 'Data Rate') + + # Check if the modem is offline + if a[124].contents[0].strip() == 'N/A': + return None stats = ADSLStats() - - stats.upstream = cleannum(a[7].td.findNext('td').contents[0].contents[0]) # kbits - stats.downstream = cleannum(a[8].td.findNext('td').contents[0].contents[0]) # kbits - stats.nmup = cleannum(a[9].td.findNext('td').contents[0].contents[0]) # dB - stats.nmdown = cleannum(a[10].td.findNext('td').contents[0].contents[0]) # dB - stats.attenup = cleannum(a[11].td.findNext('td').contents[0].contents[0]) # dB - stats.attendown = cleannum(a[12].td.findNext('td').contents[0].contents[0]) # dB + + stats.nmdown = float(a[124].contents[0]) # dB + stats.nmup = float(a[125].contents[0]) # dB + + stats.attendown = float(a[131].contents[0]) # dB + stats.attenup = float(a[132].contents[0]) # dB + + stats.downstream = float(a[138].contents[0]) # kbit/sec + stats.upstream = float(a[139].contents[0]) # kbit/sec return stats diff -r 98fe11ea4c82 -r b1048f889ef8 status_deviceinfo.htm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/status_deviceinfo.htm Wed Nov 20 23:55:38 2013 +1030 @@ -0,0 +1,120 @@ + + + + + + + +
+ + + + + + + + +
 
+Device Information    +
  
+Firmware Version
:
+2.11.91.0(UE2.C2)3.11.11.52
  
+MAC Address
:
+00:04:ed:bb:a9:66
+LAN 


  
+IP Address
:
+10.0.2.9
  
+Subnet Mask
:
+255.255.255.0
  
+DHCP Server
:
+Disabled
+ + + + + + + + + + + +
+WAN 


+
  
+Virtual Circuit
:
+
 
+Status
:
+Connected
 
+Connection Type
:
+Bridge +
 
+IP Address
:
+N/A +
 
+Subnet Mask
:
+N/A
 
+Default Gateway
:
+N/A
 
+Primary DNS
:
+N/A
 
+Secondary DNS
:
+N/A
+ + + + + + + + + + + + +
+ADSL 


 
+ADSL Firmware Version
:
+ FwVer:3.11.11.52_TC3085 HwVer:T14.F7_3.0
 
+Line State
:
+Showtime
 
+Modulation
:
+ADSL2 PLUS
 
+Annex Mode
:
+ANNEX_A
 


+Downstream +Upstream 
+SNR Margin
:
+6.5 +5.9db
+Line Attenuation
:
+47.9 + 33.5 db
+Data Rate
:
+ 5626 + 990 kbps
   
+ +
   
+ \ No newline at end of file