Welcome to Sky User - The unofficial support forum for everything Sky! - Now helping over 31,400 members.
Want to see fewer adverts? - Why not join SkyUser today?

Technical discussion This is a discussion on, [EXPERTS ONLY] Enabling your DG834GT to use MRTG natively within the Technical help forum; Hi, I've been hacking on the DG834GT router and thought you people would like this one. Note: I've only tested ...

Reply
  LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1  
Old 14-09-08, 10:55 AM
qwerty12's Avatar
Sky User Member
Exchange:
Broadband ISP: O2. (Not on Sky)
Router: Netgear V1 DG834GT
Sky TV: Sky Basic
 
Join Date: Feb 2007
Location: East London, UK
Posts: 31
Thanks: 8
Thanked 1 Time in 1 Post
[EXPERTS ONLY] Enabling your DG834GT to use MRTG natively

Hi,

I've been hacking on the DG834GT router and thought you people would like this one.

Note: I've only tested this on a normal DG834GT (non sky) router running the latest DGTeam firmware.

What is MRTG?

To quote the website:

Quote:
You have a router, you want to know what it does all day long? Then MRTG is for you. It will monitor SNMP network devices and draw pretty pictures showing how much traffic has passed through each interface
Here is an example of an MRTG graph: WAN Statistics

(Thanks atari_mark! (MRTG and DG834GT))

That's great, why can't I use it anyway?

The DG834GT doesn't support SNMP by default. But thanks to Netgear releasing the tools necessary to make our own images, Bracco uploading a toolchain (Basically, a set of programs that are needed to make the programs run on a certain processor. In the DG834GT's case, MIPS Big Endian) I was able to compile the freeware snmpd which is an SNMP server and can be used to provide SNMP functionality which is required for MRTG.


Nice, now how to do this?

WARNING:

Copied from James67's CU post: Community Updates for the DG834GT

Here's the standard Sky User disclaimer for these matters…

SkyUser make this information available in the interests of our members. Please do not upgrade your FW unless you fully understand the risks that it could go wrong and render your router useless. Please remember also, that it is against the Terms and Conditions of Sky Broadband. You also run a high risk of having your Broadband Connection suspended as well as receiving no Technical Support.

And now read my disclaimer…

These steps to make flash images are provided with no guarantees and no offer of support. They seem to work OK for me, but they might not work for you. Don't reflash your router unless you are completely sure about what you're doing. Don't reflash your router if you are dependent on it for your internet access. In fact, the best advice is, as always, don't reflash your router!

EDIT:

Go to!:
[EXPERTS ONLY] Enabling your DG834GT to use MRTG natively

Read the README.dgteam on instructions on building an img.

Below is the old way of doing it.

Spoiler Below


Doing this incorrectly may kill your router so beware!

Prerequisites:
  • A brain. If you are unsure about any of this, then don't do it!
  • The Netgear Recovery Utility!!! This one could be vital if you ruin your router: Untitled Document
  • A copy of the original firmware.
  • A Linux Computer (I used one with Ubuntu 8.04)
  • DG834GT_V1.02.16_DGTeam_0835_sources.tar.bz2 - This is the sources for DGTeam's latest firmware. You can probably use any firmware as the snmpd binary is compiled statically (but remember that the paths & steps are very slightly different for a non DGTeam firmware and the scripts are different.)
  • snmpd binary. I will provide these as I have already compiled them.

1. Download the recovery utility : Untitled Document and put it on a safe place; like a removable usb mass storage or your windows partition. Also make sure you have the original firmware handy.
2. Download DG834GT_V1.02.16_DGTeam_0835_sources.tar.bz2 to your Desktop.
3. Open a Terminal and type this:
Code:
cd ~/Desktop ; tar jxvf DG834GT_V1.02.16_DGTeam_0835_sources.tar.bz2
This will extract the DGTeam sources and applications.
4. Now type:
Code:
cd ~/Desktop/DG834GT_V1.02.16_DGTeam_0835_sources/ ; gedit README.dgteam
Read README.dgteam and familiarize yourself with the process.
5. Close it *after reading it*
6. Run this if you haven't already:
Code:
cd ~/Desktop/DG834GT_V1.02.16_DGTeam_0835_sources/ ; sudo tar xjf target_dgteam.tar.bz2
This extracts the files with the DGTeam changes, which is where we will change some things.
Now we need to add the snmpd. snmpd is the actual snmp server.
7. Download the files mentioned above to the right place.
Code:
cd ~/Desktop/DG834GT_V1.02.16_DGTeam_0835_sources/target_dgteam/usr/sbin
Code:
sudo wget http://qwerty12.maemobox.org/snmp_router/snmpd
Code:
sudo chmod +x ./snmpd
8. Now that we have the binary in place, we need to set up the configuration file.
Code:
cd ~/Desktop/DG834GT_V1.02.16_DGTeam_0835_sources/target_dgteam/usr/etc/
Code:
mkdir ~/Desktop/DG834GT_V1.02.16_DGTeam_0835_sources/target_dgteam/usr/etc/snmp
Code:
cd ~/Desktop/DG834GT_V1.02.16_DGTeam_0835_sources/target_dgteam/usr/etc/snmp
Code:
sudo wget http://qwerty12.maemobox.org/snmp_router/snmpd.conf
Code:
sudo gedit snmpd.conf
9. Set up your configuration file. At least, you would want to change the name I would presume . Once done, save it.
10. Now we need to make it start up automatically upon boot.
Code:
cd ~/Desktop/DG834GT_V1.02.16_DGTeam_0835_sources/target_dgteam/usr/etc
Code:
sudo gedit rcS
Add these lines to the END:

Quote:
#edit by qwerty12 - start snmpd
/bin/mkdir /tmp/etc/snmp
/bin/cp /etc/snmp/snmpd.conf /tmp/etc/snmp/
/usr/sbin/snmpd -c /tmp/etc/snmp/snmpd.conf
11. Save it.
12. Run this:
Code:
cd ~/Desktop/DG834GT_V1.02.16_DGTeam_0835_sources/
Code:
sudo ./create_target.sh 1.02.16
Code:
sudo ./build_dgteam.sh 1.02.16 brcm
There you have it, you now have an image that can be flashed with snmp! Remember to keep the recovery utility and original firmware nearby.

Set up your computer for MRTG:
MRTG - The MRTG 2.16.2 Linux/Unix Installation Guide
MRTG - The MRTG 2.16.2 Windows Installation Guide

Remember to replace with the right paths. For example; community@router.abc.xyz was public@192.168.0.1. (public was defined in my snmpd.conf)

I used the Linux guide.
I apt-getted mrtg* and lighttpd and installed the userdir module and set up mrtg to dump graphs @ 127.0.0.1/~faheem/mrtg

NOTES:

The snmpd.conf is read only in the router. You can make changes in the router but they will be erased when you power it off. To make the changes permanent, you have to rebuild the firmware image. Which brings me onto my next point:

I would love it if someone was able to make the snmpd.conf changeable from the nvram. I could do it but I'm pretty inexperienced at it and don't want to risk anything.
How DD-Wrt does it: C pastebin - collaborative debugging tool

If anyone is curious; this was my configure string to compile this (Net-SNMP from DD-WRT and toolchain from UberGT site):
Bash pastebin - collaborative debugging tool

Yes, I know this is long, and why won't I provide an image? Because I'm too lazy to untar another DGTeam folder and I've already made a lot of mods to my current one.

Last edited by qwerty12; 17-09-08 at 06:51 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!
Reply With Quote
  #2  
Old 15-09-08, 12:59 PM
atari_mark's Avatar
Sky User Member
Exchange: Upholland
Broadband ISP: Max
Router: Netgear V1 DG834GT
Sky TV: Sky Basic
 
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: [EXPERTS ONLY] Enabling your DG834GT to use MRTG natively

Thanks for that, I will try it tonight. The stats for my attenuation are here, SNR will look like this and sync speed should like something like this.

There are some legends that need fixing (like it says my sync speed is kMbps!) but they are only cosmetic. I will post more info once I have flashed my router.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!
Reply With Quote
  #3  
Old 15-09-08, 08:42 PM
qwerty12's Avatar
Sky User Member
Exchange:
Broadband ISP: O2. (Not on Sky)
Router: Netgear V1 DG834GT
Sky TV: Sky Basic
 
Join Date: Feb 2007
Location: East London, UK
Posts: 31
Thanks: 8
Thanked 1 Time in 1 Post
Re: [EXPERTS ONLY] Enabling your DG834GT to use MRTG natively

Deleted, I've succeeded

Last edited by qwerty12; 17-09-08 at 06:51 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!
Reply With Quote
  #4  
Old 17-09-08, 02:08 PM
mossywell's Avatar
Sky User Moderator
Exchange: LSMEPK
Broadband ISP: Max
Router:
Sky TV:
 
Join Date: Sep 2006
Location: London, UK
Posts: 789
Thanks: 0
Thanked 8 Times in 8 Posts
Re: [EXPERTS ONLY] Enabling your DG834GT to use MRTG natively

A big thank you on two accounts:
  1. For taking to effort to do this SNMP work.
  2. For then going ahead and typing it all up for all to benefit from!
Cheers
__________________
IQ album "Dark Matter" artwork reproduced with permission. See www.gep.co.uk/iq for more information.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!
Reply With Quote
  #5  
Old 17-09-08, 05:58 PM
qwerty12's Avatar
Sky User Member
Exchange:
Broadband ISP: O2. (Not on Sky)
Router: Netgear V1 DG834GT
Sky TV: Sky Basic
 
Join Date: Feb 2007
Location: East London, UK
Posts: 31
Thanks: 8
Thanked 1 Time in 1 Post
Re: [EXPERTS ONLY] Enabling your DG834GT to use MRTG natively

No problems, thanks!

EDIT, Not needed!

I've successfully managed to integrate SNMP into the web interface!
You can call this my custom firmware based on the latest dgteam revision if you wish.

Added features:
- scp binary added so you can transfer stuff straight to /tmp using winscp without having to run a web server and wget your way in
- netstat-nat added (netstat that shows nat connections)
- dgteam's busybox with id and df added (for groups) and extended PS1 variables enabled
- stripped groups script (for winscp)
- /etc/profile added. This /etc/profile actually makes it so when you telnet/ssh in, you can actually see the directory you are in!
- Fixed tcp/ip params helpp page not showing
- SNMP. You can configure the settings for this from the web interface.
- netcat-traditional added
- httptunnel added
- Tugs's uptime client added (go on, lets see who's netgear is the most stable :P)
- autoreboot feature added (if your netgear cannot access sites, it reboots automatically)
- Cleaned out menu links. You can collapse menu links and expand them by clicking their title. To save space.

If anyone is interested in the nitty gritty of the SNMP starting;

- /etc/rcS is executed when the netgear boots.
- I add a line to that file making it start "/tmp/etc/snmp.sh"
- snmp.sh is a script that automatically adds nvram variables for the snmp settings and runs snmpd with those settings from nvram if you choose to enable snmp.

From the web interface, the snmp.htm file grabs the settings for snmp from the nvram using snmp.cgi and lets you change them. The settings are then read on the next reboot.

Removed:
- All other languages (I only speak English and modifying English pages was enough for me!). The other languages automatically symlink to the www.eng folder.

Credits:
- DD-Wrt team for the router net-SNMP server
- Bracco for the toolchain & UberGT firmware where I took his cgi code and htm code
- Exovii who I originally based the cgi from using his code but failed as his replace binary segfaulted :P. But his snmp.sh startup script (which I made mods to) is in use.

Planned:
- addition of samba/cifs, nfs
- maybe adding kismet_drone

I hope Stev-O sees this and can fix it up and include some of this in the official DGTeam f/w.

Download (source only. I've included the source to things I've changed. To see source for original stuff, grab netgears source archives and the DGTeam source archive, build your own image):

http://qwerty12.maemobox.org/snmp_ro...q12mod.tar.bz2

Last edited by qwerty12; 22-09-08 at 05:57 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!
Reply With Quote
  #6  
Old 19-09-08, 04:59 PM
qwerty12's Avatar
Sky User Member
Exchange:
Broadband ISP: O2. (Not on Sky)
Router: Netgear V1 DG834GT
Sky TV: Sky Basic
 
Join Date: Feb 2007
Location: East London, UK
Posts: 31
Thanks: 8
Thanked 1 Time in 1 Post
Re: [EXPERTS ONLY] Enabling your DG834GT to use MRTG natively

Good news, I've successfully fixed all the snmp bugs.

Now, the SNMP radio box shows if it is enabled or disabled. Guess I don't suck as C++ & HTML as I thought

You can successfully control the SNMP settings from the web interface!:


Uploaded source archive again, link is in above post.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!
Reply With Quote
  #7  
Old 20-09-08, 10:00 AM
mossywell's Avatar
Sky User Moderator
Exchange: LSMEPK
Broadband ISP: Max
Router:
Sky TV:
 
Join Date: Sep 2006
Location: London, UK
Posts: 789
Thanks: 0
Thanked 8 Times in 8 Posts
Re: [EXPERTS ONLY] Enabling your DG834GT to use MRTG natively

A splendid piece of work! I see you included Help text as well - the icing on the cake!
__________________
IQ album "Dark Matter" artwork reproduced with permission. See www.gep.co.uk/iq for more information.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!
Reply With Quote
The Following User Says Thank You to mossywell For This Useful Post:
qwerty12 (20-09-08)
  #8  
Old 20-09-08, 10:13 AM
qwerty12's Avatar
Sky User Member
Exchange:
Broadband ISP: O2. (Not on Sky)
Router: Netgear V1 DG834GT
Sky TV: Sky Basic
 
Join Date: Feb 2007
Location: East London, UK
Posts: 31
Thanks: 8
Thanked 1 Time in 1 Post
Re: [EXPERTS ONLY] Enabling your DG834GT to use MRTG natively

Quote:
Originally Posted by mossywell View Post
A splendid piece of work! I see you included Help text as well - the icing on the cake!
Thanks!

I can't really take credit for the help text or the SNMP pages, they were by exovii for his DG834G firmware mod, I think all I did was edit the pages to include the rwuser option and make it support the C++ cgi instead of the shellscript cgi

Though I do seem to have a fixation on this now , I've managed to add http tunneling from exovii and want to add the autoreboot script from exovii (reboots router automatically if it cannot reach a page).Adding "Netgear NTP client replaced by OpenNTPD so the router can act as a time server for LAN computers" sounds interesting to me too . I'm dreaming....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!
Reply With Quote
  #9  
Old 10-11-08, 09:39 PM
Stev-O's Avatar
Sky User Member
Exchange:
Broadband ISP: Base
Router:
Sky TV:
 
Join Date: Dec 2007
Posts: 15
Thanks: 0
Thanked 5 Times in 2 Posts
Re: [EXPERTS ONLY] Enabling your DG834GT to use MRTG natively

Quote:
Originally Posted by qwerty12 View Post
No problems, thanks!

I hope Stev-O sees this and can fix it up and include some of this in the official DGTeam f/w.
why not PM ?

fortunately, I see the forum all around sometimes
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!
Reply With Quote
  #10  
Old 18-11-08, 09:37 PM
alex87's Avatar
Sky User Member
Exchange: Canterbury
Broadband ISP: Be*
Router: Netgear V1 DG834GT
Sky TV: Sky Basic
 
Join Date: Nov 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: [EXPERTS ONLY] Enabling your DG834GT to use MRTG natively

Hey,

First of all, thanks for this, it looks great. However I haven't managed to get it working properly. I have created the image and flashed the DG834GT with it, and when I go to the router, the navigation pane is updated with all the new features. However when I click on any of the new ones, I only get 404 not found.

It appears that it can't find dgteam.cgi

Do you know how I can sort this out? I followed the instructions in the Readme file.

Thanks Again,
Alex
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Yahoo Bookmark this Post!Live Bookmark this Post!