Menu

Thomson TG585 v7 Modem/Router

Help
Crimblepud
2011-10-20
2013-04-15
  • Crimblepud

    Crimblepud - 2011-10-20

    Wow! THis looks neat… and very useful!
    Would love to see this work for my Thomson TG585 v7 modem/router, but each of the up/down the fields are displayed together in a table cell seperated by a forward slash.
    Also not sure of which fields on my list match yours.
    Here is an example of the page (in text - copied from the web page):

    DSL Connection 
    Link Information
       
    Uptime: 17 days, 12:25:55
    DSL Type: G.992.5 Annex M US 56
    Maximum Bandwidth (Up/Down) : 2,148 / 21,463
    Bandwidth (Up/Down) : 2,143 / 17,383
    Data Transferred (Sent/Received) : 0.00 / 0.00
    Output Power (Up/Down) : 13.0 / 18.0
    Line Attenuation (Up/Down) : 13.5 / 21.5
    SN Margin (Up/Down) : 3.5 / 3.5
    Vendor ID (Local/Remote): TMMB / BDCM
    Loss of Framing (Local/Remote): 11 / 0
    Loss of Signal (Local/Remote): 1 / 0
    Loss of Power (Local/Remote): 0 / 0
    Loss of Link (Remote): 0
    Error Seconds (Local/Remote): 65 / 0
    FEC Errors (Up/Down): 3,694 / 2,305,916
    CRC Errors (Up/Down): 3,694 / 3,978
    HEC Errors (Up/Down): 4,819 / 3,145

    Any chance you can have a look at this with a view of adding my modem router to the list???
    Willing to do any testing required :-)
    Regards,
    John Campbell

     
  • Crimblepud

    Crimblepud - 2011-10-20

    Wow, not really much of a PERL man myself, but managed to get your code working!

    Issues I had to resolve were:
    1: Values were contained in table cells represented both up & down values, delineated with a forward slash character.
    2: Values in the array @stats needed to be trimmed, else they created "float not complete" errors in RRD.
    3: Values the array @stats had comma seperators, which also created "float not complete" errors in RRD.

    In the method getstats(), i changed this section:

          @html = split /^/m, $html; # postprocess: remove lines containing only whitespace
          $data = join "", @html; # make one long string
          @stats = split (/:/, $data); # split fields up on :

    to

          $html =~ s/,//g; # JC - REMOVE ALL COMMAS.
          $html =~ s/\s:/:/g; # JC - REMOVE ALL SPACES PRECEEDING A COLON.
          $html =~ s/:\s/:/g; # JC - REMOVE ALL SPACES AFTER A COLON.
          $html =~ s/\s\//\//g; # JC - REMOVE ALL SPACES PRECEEDING A FORWARD SLASH.
          $html =~ s/\/\s/\//g; # JC - REMOVE ALL SPACES AFTER A FORWARD SLASH.
          @html = split /^/m, $html; # postprocess: remove lines containing only whitespace
          $data = join "", @html; # make one long string
          @stats = split (//, $data); # split fields up on : (JC - AND ALSO ON /)

    And this rough hack seems to work :-)

    I also discovered that if any values were left blank, when running adslstats.pl is was getting "Argument "" isn't numeric in array element" errors.
    Not sure of the best way to resolve this, bar ensuring that all fields have a valid value.

    I bet it could be quite a nightmare to incorporate parsing of all the different formats of these router information pages, but would be great it you could consider my comments here and update your code to incorporate my particular requirements.
    If you need it, I can send you the complete HTML output of the page, if that helps?

    Regards,
    John

     

Log in to post a comment.