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.
Changelog
25-07-2005
The new graphs are bigger
Added Min, Max, Average, Current
During the image generation the graph are not accessibles so new images are created with a extention .new and renamed when done.
Thanks to david07 for theese updates.
18-07-2006
ipkg install of busybox was removed, due to usage of awk instead of cut, which is included in Olegs Firmware
Graphs are now created with the following intervals (in order to save CPU power):
---> Daily : Every 10 mins
---> Weekly: Every hour
---> Monthly and Yearly : Once a day
Cron-job script changed a bit
14-07-2005
ipkg install of busybox was added
Small bug-fix of the rrdtool.sh script
13-07-2005
Initial Release
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-6b (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.
Installing and Configuring RRDTool
As usual Olegs excellent firmware, and its support for the ipkg package system, makes installing software as easy as:
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:
#!/bin/sh
/opt/usr/bin/rrdtool.sh >> /opt/var/log/rrdtool.log 2>&1
Remember to make the script executable :
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:10, XX:20, XX:30, XX:40, XX:50 or XX:00, 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 graphs for 1 day, 1 week, 1 month and 1 year scopes.
Feel free to customize and improve the scripts, and maby post the "better" versions in the Forum so that others can get the best scripts around :-)
Thanks to david07 and britnet for valuable inputs int he forum.
I hope you found this tutorial useful.
Comments and questions are welcome at the Support Forum