Wanted - program to log the noise margin of a router

Discussion in 'Broadband' started by Chris, Dec 7, 2005.

  1. Chris

    Chris Guest

    It would be really useful to have a program which would interrogate the
    router every minute and keep a log of the SNR. That would make
    pattern-spotting easier. Does anyone know of such a program?
    Or has anyone the programming ability to make one?

    My router is a Netgear DG834 version 2 ... and so that's the one I'm
    particularly interested in ... but, because that router is so widely
    used, if any kind (and skilled) person did come up with such a program
    or script, it would certainly be appreciated by an enormous number of
    users.
     
    Chris, Dec 7, 2005
    #1
    1. Advertisements

  2. Chris

    Tony Guest

    If that router has a Syslog capability, enable it (sending the output to
    your PC; you may need to fix its IP address, and allow it through any
    software firewall). A good freeware Syslog server program is Kiwi Syslog
    Daemon <http://www.kiwisyslog.com/info_syslog.htm>.

    Hopefully, you will find ADSL Status syslog entries including SNR in
    amongst loads of other stuff. The freeware version of Kiwi allows enough
    filtering of log output to file to capture just the ADSL Status from my
    Vigor router.

    You can then import the tabbed file logs from Kiwi into Excel and plot
    SNR v. date/time.
     
    Tony, Dec 7, 2005
    #2
    1. Advertisements

  3. Chris

    Iwan Davies Guest

    I did this with my X3 and a simple bash script running on a Linux box on my
    network (but you could do it in Windows, too). The script used wget to save
    the router stats page locally, then parsed the page it had downloaded to
    obtain the relevant values (the X3 uses Javascript to build its stats page,
    so rather handily, each stat is assigned to a variable in Javascript which
    makes extraction fairly simple). Finally, it wrote the values it had parsed
    to a csv file and slept for 10 seconds before deleting the downloaded stats
    page, wgetting the page again and repeating the parser process. In other
    words, you just need to look at the source code for the stats page and work
    out how to extract the relevant data. On Windows you should be able to do
    it all using a VBScript that runs in the background. Google should be your
    friend.

    The parser part of my script was:

    SNR=`cat adsl.htm | grep st_dw_snr -m 1 | cut -d \" -f 2`
    ATTN=`cat adsl.htm | grep st_dw_line_attenuation -m 1 | cut -d \" -f 2`
    MOD=`cat adsl.htm | grep st_modulation -m 1 | cut -d \" -f 2`
    ERR2=`cat adsl.htm | grep st_dw_errored_seconds -m 1 | cut -d \" -f 2`
    CRC=`cat adsl.htm | grep st_dw_crc -m 1 | cut -d \" -f 2`
    LINE=`date +%x`" "`date +%H:%M:%S`",$SNR,$ATTN,$MOD,$ERR2,$CRC"
    echo $LINE>>values.csv

    Iwan
     
    Iwan Davies, Dec 7, 2005
    #3
  4. Chris

    Chris Guest

    Thanks, Tony. I haven't yet been able to find out whether the Netgear
    DG834 has a Syslog capability. Does anyone know?

    That Kiwi Syslog Daemon <http://www.kiwisyslog.com/info_syslog.htm>
    you mentioned looks useful - if I can use it with the DG834.

    Has anyone tried this with the DG834?
     
    Chris, Dec 7, 2005
    #4
  5. Chris

    Chris Guest

    It's good to see that this newsgroup is populated by such competent
    people! I am impressed by your expertise - and yet, for my use, things
    would need to be simplified a bit, to put it mildly.
    You make me feel I have the brain of a cat!

    Can anyone translate this for a bear of little brain?

    I suppose there would have to be some way the program would log into the
    router, putting in username and password, and then doing the equivalent
    of going to the router status page and pressing the "statistics" button.

    Has anyone managed to do anything like this with a Netgear DG834 and
    Windows XP?
     
    Chris, Dec 7, 2005
    #5
  6. Chris

    Tony Hogarty Guest

    It does - look under the logs option and you'll see it there.
     
    Tony Hogarty, Dec 7, 2005
    #6
  7. I've just written a small program that logs my routers stats every 15
    minutes and the traffic stats once a day. Unfortunately for you I
    haven't got a Netgear router so it won't be much use to you - it's very
    router specific. If nobody else comes up with a suggestion then mail me
    and I'll see if I can convert it.

    Quite interesting though. I've got a stable 2MB line (famous last
    words?) but from a short run the downstream noise does seem to wander
    about a bit (15.9 dB to 17.5 dB over a couple of minutes).
     
    Ian Bartholomew, Dec 7, 2005
    #7
  8. Chris

    Chris Guest

    Chris, Dec 7, 2005
    #8
  9. Chris

    Kraftee Guest

    Think you'll find it's more the setting up of the router to broadcast
    the logs which you have to do the Kiwi program will just receive what is
    sent to the PC it's on..
     
    Kraftee, Dec 7, 2005
    #9
  10. Chris

    Iwan Davies Guest

    Don't be impressed - it was all learned off the web and what I know about
    Linux scripting could be written on a matchbox. Which just goes to
    illustrate, really, what a really cool thing the Internet is :)

    Besides, I think a cat's brain is probably quite impressive, especially in
    terms of geographical intelligence. :)

    Iwan
     
    Iwan Davies, Dec 7, 2005
    #10
  11. I use LinkLogger
    http://www.linklogger.com/

    Includes good setup instructions
     
    Nicola Redwood, Dec 9, 2005
    #11
  12. Chris

    Chris Guest

    I have installed the Kiwi Syslog Daemon - and it looks a very useful
    program. Thanks for your recommendation.

    But how do I get the router statistics included in the log?
    When I go into the Netgear DG834 configuration page, I have to go to the
    Router Status tab and click on the Statistics button to actually see the
    Noise Margin figure, which, by default, gets refreshed every five
    seconds.
    But it doesn't come out in the normal router log ... so how can this
    information be sent to the Kiwi Syslog Daemon?

    (Has anyone who uses a Netgear DG834 tried the Kiwi Syslog Daemon?)
     
    Chris, Dec 10, 2005
    #12
  13. Chris

    Tony Guest

    In my DrayTek Vigor2600G router, the noise margin info is obtainable
    both via the web interface (similar to what you mention) and also via
    syslog in the logged output (without any configuration being needed
    beyond turning on syslog and directing it to a PC's IP address).
    I had a quick look at the DG834v2 "Reference Manual for Firmware Version
    2.10.22" downloadable from
    <http://kbserver.netgear.com/products/dg834v2.asp>, but it didn't
    mention noise margin anywhere at all, so maybe I looked at the wrong
    manual? My hope was that ADSL status was included in the logged output.
    However, pages 5-9 to 5-12 talked about logging but mentioned only
    administration and security information, with nothing about the
    WAN/ADSL/modem side of the device.
    I do hope that a DG834 user can confirm one way or another.
     
    Tony, Dec 10, 2005
    #13
  14. Chris

    Chris Guest

    A search came up with this perl script.
    Can anyone make it work for a Netgear DG834?



    ##### start code #####
    # --- VARIABLES --- #
    # url to stats page - replace user & pass with the router username &
    # password
    my $url =
    'http://admin:***password***@172.24.0.1/adsl_status_main.stm?next_file=st
    att
    bl.htm';
    # output file
    my $log = 'c:/router-stats.txt';
    # --- PROGRAM --- #
    # connect to router and get raw html
    use LWP::UserAgent;
    my $ua = new LWP::UserAgent;
    my $req = HTTP::Request->new(GET => $url);
    my $response = $ua->request($req);
    my $html = $response->content;
    # get date/time & format
    my ($sec, $min, $hour, $mday, $mon, $year) = localtime(time());
    my $dt =
    sprintf("%04d%02d%02d%02d%02d",1900+$year,$mon+1,$mday,$hour,$min);
    # extract statistic
    $html =~ s/(\s|\n)+//g;
    my($stat) = $html =~
    m!NoiseMargin</td><tdwidth=185class=textCell>[^&]+ dB</td><tdwidth=185c
    lass=textCell>([^&]+)!;
    # print to file
    open(FH,">>$log");
    print FH "$dt $stat\n";
    close(FH);
    ##### end code #####
     
    Chris, Dec 12, 2005
    #14
  15. As I mentioned before I've written a little program that accesses my
    routers stats page[1], removes various bits of information and stores
    the results in a log file.

    I'm willing to update it for your router but it will need to
    - run on XP
    - be able to access the router's log via a direct url (no passwords or
    intervening pages).

    If you want me to try then mail me the url and a copy of the source of
    your router's stats page (so I will know which bits to extract) and I'll
    create you an exe file.

    [1] I monitored my router over the whole weekend at 15 min intervals and
    the noise didn't vary by much more than 1dB. Really boring :-(
     
    Ian Bartholomew, Dec 12, 2005
    #15
  16. Chris

    Chris Guest

    That sounds very useful.
    What make and model of router are you using?
    That's fine.
    I can't understand how that would be possible.
    To access the Netgear DG834 router's main html page I have to enter
    username and password.
    Then I have to click on Router Status.
    Then I have to click on Statistics.
    How could the statistics page be accessed more directly?
    Thanks for the offer, which I may well take you up on - but from the
    above conditions I don't know if it would be any good.
    What do you reckon?
    BTW what language did you write it in?
    I must say that my connection has been a lot better since I completely
    re-did my extension wiring - using twisted pair ethernet cable - and
    routing along the skirting board inside the house instead of on the wall
    outside.

    But I would really love to be able to get this logging working.
    It would benefit very many other people as well. Most people I know use
    the Netgear DG834.
     
    Chris, Dec 13, 2005
    #16
  17. I've got a BT Voyager 240
    On the Voyager 240 only the "settings" pages are behind a password, the
    "status" pages are visible just by accessing a page within the router.
    If I go in via the start page I have to select
    Advanced
    Advanced
    Status
    Broadband Line
    to get to the right page _but_ when I hover over the "Broadband line"
    link then FireFox shows me the target url in the status bar. If I use
    that url at the start then I avoid all the menu selections and go
    directly to the line stats page.
    If you have to go through a password page then it's probably not worth
    trying to do remotely. I'm sure it could be done - but not without
    being able to sit down and experiment.
    Dolphin Smalltalk 6.0
    It does make a difference. When I decided to change to broadband I had
    a modem that was struggling to connect reliably at 42K. Before
    broadband arrived I redid the whole house wiring, which I admit was a
    bit of a mess, and the modem immediately started giving solid 50K
    connections.
     
    Ian Bartholomew, Dec 13, 2005
    #17
  18. Chris

    Andy Furniss Guest

    I have to look at 1 sec resolution to see anything happen.

    Andy.
     
    Andy Furniss, Jan 12, 2006
    #18
  19. Chris

    Chris Guest

    Mine varies quite a bit at the default 5 sec interval.
    Haven't a clue why!
    That's why I'd like to log it.
     
    Chris, Jan 13, 2006
    #19
  20. Chris

    barry Guest

    I use the free version of this. it runs as a service too:

    http://www.paessler.com/prtg

    you'll want the snmp oid for SNR too, which is the memorable:
    1.3.6.1.2.1.10.94.1.1.3.1.4.4

    At least thats what it is on my voyager220. You'll obviously need to
    turn snmp on and set the communities correctly etc etc.
     
    barry, Jan 14, 2006
    #20
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.