Multi Router Traffic Grapher

From DD-WRT Wiki

Jump to: navigation, search

The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network-links. MRTG generates HTML pages containing graphical images which provide a LIVE visual representation of this traffic. MRTG is based on Perl and C and works under UNIX and Windows NT. MRTG is being successfully used on many sites around the net.

The usage of MRTG requires another host to actually run MRTG. The router itself provides its actual usage information over SNMP, but its MRTG's job on another host to keep track and display it. If the host is down for a while, no MRTG data can be recorded for the time beeing.


[edit] Installation

[edit] Router

Using the Web Interface:

  1. Goto the "Administration" tab and the "Services" sub-tab
  2. Enable "SNMP" and if new options don't appear, Apply Changes.
  3. Fill in information in the SNMP section. (Location, Contact, Name, RO Community, RW Community)

[edit] Desktop

There are a number of installation guides on the MRTG website.

In the guide, substitute:

public for the RO Community you filled in earlier with the Local IP address of your router.

[edit] Windows

You should have Windows IIS installed, or some other web server you're familiar with.

NOTE: Substitute D:\InetPub\wwwroot\ for the wwwroot of your IIS installation.

  1. Follow the MRTG guide
  2. Remove the line: WorkDir: c:\www\mrtg from the bottom of
  3. Make the folder D:\InetPub\wwwroot\MRTG
  4. Create a new virtual folder in IIS and point it to D:\InetPub\wwwroot\MRTG
  5. Browse to to see your traffic logs.

Alternately for a quick look, use STG which will let you monitor 2 OIDs at a time.


  * for br0 interface (intern LAN port) for download (green) ( upload(blue))
  * for vlan1 interface (extern WAN port) for download (green) ( upload(blue))
  * for eth1 interface (WLAN) for download (green) ( upload(blue))

[edit] Unix

Follow the guide at:

The OID's which MRTG will pick up in a default configuration may be as follows:

  • 5 (eth0) - all routed wired traffic, WAN + LAN
  • 6 (eth1) - all routed wireless traffic
  • 7 (vlan0) - all routed LAN traffic
  • 8 (vlan1) - WAN traffic
  • 9 (br0) - vlan0-eth1 bridge traffic

Currently, there is no way to monitor switched traffic.

Depending on the model of your router the interface names and functions can vary.

  • You can use snmpwalk to display the names of your interfaces:
    snmpwalk -v2c -c public | grep ifDescr
    • or use the OID within the walk
[root@server]# snmpwalk -v2c -c public ifDescr
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: teql0
IF-MIB::ifDescr.3 = STRING: eth0
IF-MIB::ifDescr.4 = STRING: eth1
IF-MIB::ifDescr.5 = STRING: vlan0
IF-MIB::ifDescr.6 = STRING: vlan1
IF-MIB::ifDescr.7 = STRING: br0
IF-MIB::ifDescr.8 = STRING: etherip0
IF-MIB::ifDescr.9 = STRING: ppp0
IF-MIB::ifDescr.10 = STRING: imq0
IF-MIB::ifDescr.11 = STRING: imq1
(DD-WRT v24sp2 on a WRT-54GL, the interfaces seem to have changed from v23, note #8)

[edit] SNMPOIDs

If you want to monitor something other than bytes in and out, you must also know the SNMPOID of what you want to monitor.
Here is a listing of SNMPOIDs for the DD-WRT firmware.
not completed

Some SNMP OIDs can be found in this forum thread:

Please copy the important OIDs here!!!

For CPU load dd-wrt snmpd provides two sets of MIBs: = 01 min avg, Value is between 0.00 and 1.00. = 05 min avg, Value is between 0.00 and 1.00. = 15 min avg, Value is between 0.00 and 1.00.

The values above need to be multiplied by 100 since mrtg does integers.


Target[]: *100 = 01 min avg, 1 means 0.01 and 150 means 1.5 = 05 min avg, 1 means 0.01 and 150 means 1.5 = 15 min avg, 1 means 0.01 and 150 means 1.5

For UP and DOWN traffic on the WAN-side: = Total Downloaded in Bytes = Total Uploaded in Bytes

For memory usage: = Total available = Used

[edit] References MRTG website

[edit] External Links

MRTG website MRTG