ASUS WL-Series RRDTool Tutorial

The guide is made using a ASUS WL-500G Deluxe (or WL-500GX as it is sometimes called).
It should however apply to all the ASUS wireless line of products that are Linux based. Theese products are to my knowledge :

# ASUS WL-500b
# ASUS WL-500bv2
# ASUS WL-500g
# ASUS WL-500g Deluxe (WL500-gx)
# ASUS WL-HDD

If you are the lucky owner of any of the above devices, you have come to the right place.
If you still dont have one of the above devices - dont hesitate, go buy one :-)

After following the steps in this tutorial, your ASUS WL device will have all its normal functionality, and also make Graphs of the Traffic Usage using RRDTool.
Tutorial Index
1. Prerequisites - What is needed to get started.
2. Installing and Configuring RRDTool

Prerequisites
All you need is :
# One of the above Asus Wireless devices
# An USB Harddrive or USB Memory Stick / Keyring with some 50-100 MB space.(For the WL-HDD you just need a regular Harddrive)
# Firmware version 1.9.2.7-4 (or higher) by Oleg

In order to be able to follow this tutorial to the last detail, you have to have a setup I created in the ipkg Tutorial
Also for beeing able to actuately see the graphs created, one option would be to follow my PHP Enabled web server Tutorial
Finally you need to have cron running to get the traffic databases updated, check my cron tutorial.


Installing and Configuring RRDTool
As usual Olegs excellent firmware, and its support for the ipkg package system, makes installing software as easy as:

Code:
ipkg install rrdtool
Once the software is installed all that is really needed for getting rrdtool running, is a small script that I wrote.
You can download the script here

Copy the rrdtool.sh script to /opt/usr/bin

Now - to make rrdtool start collecting data and making graphs you need to place a small script in /opt/etc/cron.5mins/
The script could be called rrdrun.sh and should contain something like:

Code:
#!/bin/sh
/opt/usr/bin/rrdtool.sh >> /opt/var/log/rrdtool.log
Remember to make the script executable :

Code:
chmod +x rrdrun.sh
If you have followed my Crontab Tutorial this will make the rrdrool.sh script run every 5 minutes 0, 5, 10, 15... and so on minutes every hour.

It will also create a logfile in /opt/var/log containing information on the data sent to the rrd database.

The script will place the rrd databases in /opt/var/lib/rrd/ and the images and html pages for presentation in /opt/share/www/rrd/

Theese locations can be customized at the top of the rrdtool.sh script.

Every 5 minuts traffic information will be written in databases for the WAN, LAN and WLAN (Wireless) interfaces. Every 30 mins, at 00 and 30 every hour, the images with the graphs will be created.
I have chosen only to create the images every 30 minutes, since it is rather CPU intensive to create thoose images.


Once the script has been running past either XX:00 or XX:30, XX beeing the hour when you first create the /opt/etc/cron.5mins/ script, you can direct your browser to : http://yourrouterip/rrd/ and see nice graphs :-)

My script will create graps for 1 day, 1 weeek, 1 month and 1 year scopes.


For additional information and updates, check out www.macsat.com !!

macsat