Technical Discussion
  >> DSL Hardware Discussion


Register (or login) on our website and you will not see this ad.


Pages in this thread: 1 | 2 | (show all)   Print Thread
Standard User Oddball
(fountain of knowledge) Sun 10-Apr-11 08:00:47
Print Post

Bandwidth monitoring on DG834Gv4 (DGTeam)


[link to this post]
 
I've worked out how to get the amount of traffic being sent or recieved on the ADSL port on this router. I use RouterStats stats tab. Basically you times the MTU by the number of packets.

Easy enough.

What I want to do though is have an automated script that will pull this from the router and throw it into something useful and meaningful like how much data was sent and received that day. I did some Googling and found a VBS script that suppsedly did it but it gave me an error in Win7 and a blank log file in XP (It uses something called W3Sockets dll or somesuch).

Please do not suggest TBB Meter or other software meters that run on the LAN side unless they:-
1. Monitor all PC's.
2. Monitor IPv6 tunnel traffic (TBB Meter currently doesn't without disabling it's internet monitoring mode. See caveat below).
3. Does not measure internal LAN file traffic (Sending files etc). If I want TBB Meter to measure internet traffic only this works but it does not measure IPv6 tunnel traffic. If I set it to measure all traffic it will work but that is no good since it measures file transfers etc. I just want to measure WAN traffic.

The only other option would be to buy a better router with dd-wrt but I don't see why I should have to when the data is there to be had. It's just a bit awkward making it into something useful. A script that can pull the packets sent and received from the Netgear IP, times it by the MTU and dump it into a log would be ideal as I could then set a schedule to run it.

Has anyone had experience with trying to do this?

---
Rocking at 11-13mbps/1.2-1.4mbps on Be with a 38dB line smile

Edited by Oddball (Sun 10-Apr-11 08:01:32)

Standard User BatBoy
(legend) Sun 10-Apr-11 09:06:05
Print Post

Re: Bandwidth monitoring on DG834Gv4 (DGTeam)


[re: Oddball] [link to this post]
 
Why not grab the stats off the web or telnet inerface and graph them using Cacti for example?



______________________________________________________________________________attack_the_post_not_the_poster__________________
Standard User john2007
(legend) Sun 10-Apr-11 09:07:50
Print Post

Re: Bandwidth monitoring on DG834Gv4 (DGTeam)


[re: Oddball] [link to this post]
 
I do something similar for the DG834Gv3, but on Linux.

Every half hour I run a cron script which enables debugs on the Netgear, telnet's to it, and pulls the bandwidth figures.

On the v3 the upstream and downstream byte figures are given so you don't have to muck about with MTU or packet sizes.

The cron entry is

15,45 *  *   *   *     /home/common/bin/get-router-stats


The basic script is

#!/bin/bash
#
T1=`mktemp`
T2=`mktemp`
U=/home/common/bin/router-stats/$HOSTNAME.log
#
curl --basic --user user_name:password --url http://router/setup.cgi?todo=debug \
   &>/dev/null
#
/home/common/bin/router-stats/telnet.script >$T1
date +%F\ %R:%S >$T2
grep 'Payload' $T1 >>$T2
awk -v v=1048576 \
    '{if (index($0, "Payload")) printf " %5.1fMB %6.1fMB\n",$4/v,$7/v; \
      else printf "%s", $0}' $T2 >>$U
rm $T1 $T2


The telnet script is

#!/usr/bin/expect -f
spawn telnet "router"
expect "# "
send "cat /proc/avalanche/avsar_modem_stats\r"
expect "# "
send "exit\r"


Of probably no use to you, but perhaps useful for someone with a Linux box.

Edited by john2007 (Sun 10-Apr-11 09:11:26)


Register (or login) on our website and you will not see this ad.

Standard User Rockh
(eat-sleep-adslguide) Sun 10-Apr-11 12:20:38
Print Post

Re: Bandwidth monitoring on DG834Gv4 (DGTeam)


[re: Oddball] [link to this post]
 
Thought DG Team had enabled SNMP. There must be something available from one of the interfaces.

Dave
Standard User john2007
(legend) Sun 10-Apr-11 13:10:07
Print Post

Re: Bandwidth monitoring on DG834Gv4 (DGTeam)


[re: Rockh] [link to this post]
 
Don't know about the DG Team firmware but SNMP with the standard firmware is a bit of a pain.

You have to enable it on a hidden page (router/snmp.htm) and alter the firewall rules to allow outbound snmp-traps and snmp services.

Then you can do a snmp walk (version 1 or 2c) to get the oids (total of 220), then I guess you'd have to sum all the various protocol traffic (tcp, udp, etc.). I used to collect stats that way but in the end decided it was more fuss than just telnet'ing to the device.

Edited by john2007 (Sun 10-Apr-11 13:10:58)

Standard User Oddball
(fountain of knowledge) Mon 11-Apr-11 05:25:00
Print Post

Re: Bandwidth monitoring on DG834Gv4 (DGTeam)


[re: john2007] [link to this post]
 
There is SNMP on the DGTeam firmware and I looked into it but it on;y tells me what I can already get from the stats page anyhow and it's harder to dig down through the interfaces. That script would be nice if I ran Linux but I don't. Oh well. Thanks anyhow.

---
Rocking at 11-13mbps/1.2-1.4mbps on Be with a 38dB line smile
Standard User Oddball
(fountain of knowledge) Mon 11-Apr-11 08:05:54
Print Post

Re: Bandwidth monitoring on DG834Gv4 (DGTeam)


[re: Oddball] [link to this post]
 
Hooray! PRTG does what I need and is free for 10 sensors. I am still trying to figure out how it how to change some of the readings though. Using kilobits and kilobytes kinda sucks as I want it to tell me how much in megabytes and gigabytes instead.

---
Rocking at 11-13mbps/1.2-1.4mbps on Be with a 38dB line smile
Standard User Rockh
(eat-sleep-adslguide) Mon 11-Apr-11 19:11:47
Print Post

Re: Bandwidth monitoring on DG834Gv4 (DGTeam)


[re: Oddball] [link to this post]
 
Select sensor, edit, sensor settings, advanced.

Dave
Standard User RobertoS
(sensei) Mon 11-Apr-11 19:28:57
Print Post

Re: Bandwidth monitoring on DG834Gv4 (DGTeam)


[re: Oddball] [link to this post]
 
Am I missing something here, or have I mis-understood something?

Do RouterStats and PRTG distinguish between packets with and without data?

My broadband basic info/help site - www.robertos.me.uk
My domains,website and mail hosting - Tsohost. Internet connection - IDNet Home Starter Fibre. Live BQM.

"Where talent is a dwarf, self-esteem is a giant." - Jean-Antoine Petit-Senn.
Standard User john2007
(legend) Mon 11-Apr-11 20:07:15
Print Post

Re: Bandwidth monitoring on DG834Gv4 (DGTeam)


[re: RobertoS] [link to this post]
 
I'm not sure but aren't MRTG/PRTG daemons in the sense they happily run in the background and present an on-demand web interface, whereas RouterStats is a normal foreground application requiring a "window".

So MRTG/PRTG will run without anyone being logged in.

They both interrogate the router/modem to get the stats (RouterStats telnet, MRTG/PRTG snmp I think).

eta: my DG834Gv3 reports payload as well as packets.

Edited by john2007 (Mon 11-Apr-11 20:10:20)

Pages in this thread: 1 | 2 | (show all)   Print Thread

Jump to