The rrdtool.sh script is updated.....tutorial should still be up2date (except for some bits and pieces of information).
Check www.macsat.com....not needed though.
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:
Once the software is installed all that is really needed for getting rrdtool running, is a small script that I wrote.Code:ipkg install rrdtool
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:
Remember to make the script executable :Code:#!/bin/sh /opt/usr/bin/rrdtool.sh >> /opt/var/log/rrdtool.log
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.Code:chmod +x rrdrun.sh
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
macsat
http://www.macsat.com - Tutorials and information on using ASUS WL-500G and family.
The rrdtool.sh script is updated.....tutorial should still be up2date (except for some bits and pieces of information).
Check www.macsat.com....not needed though.
macsat
http://www.macsat.com - Tutorials and information on using ASUS WL-500G and family.
Maybe I have stupid question, but where could I find rrdtool suitable for Asus? Or it is already installed in Oleg's FW and the command ipkq install rrdtool will only activate it?
What about reading the tutorial ?
It is stated quite clearly how to install it :
Installing and Configuring RRDTool
Code:As usual Olegs excellent firmware, and its support for the ipkg package system, makes installing software as easy as: Code: ipkg install rrdtool
macsat
http://www.macsat.com - Tutorials and information on using ASUS WL-500G and family.
I read the tutorial. And what about unistalling rrdtool? Only command ipkq uninstall rrdtool? .
Remove with :
Code:ipkg remove rrdtool
macsat
http://www.macsat.com - Tutorials and information on using ASUS WL-500G and family.
Nice going macsat! Haven't had time to test it yet, but what you need for you tutorial is some screenshots! I would love to see how it looks..
S.
Hi
There is a few updates:
# 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.
Also some pics.
Note that theese are the WAN pics, the script creates for WAN, LAN and WLAN separately, and also creates simple webpages that includes them.
The script is not that old, and hence there is not so much history included in the graphs :-)
macsat
http://www.macsat.com - Tutorials and information on using ASUS WL-500G and family.
Just got this up and running and i like it a lot...
thanks a million for sharing....tis very good.
Toil
I think it would be a nice feauture to generate graphs to show how much bandwith each LAN user is using i.e. each MAC-address in the routing table.
Even plotting how many LAN users and when a specific LAN user is connected would be a nice feauture..
Keep up the good work!
All theese features takes something completely different though.
This would mean using iptables for generating the rrd data - this is not how it is done in my version.
macsat
http://www.macsat.com - Tutorials and information on using ASUS WL-500G and family.
what do I have to do, to get the daily graph updated every 5 minutes and aditional an "hourly" graph, updatet every minute?
I'm a noob to Linux, so im proud that I get this runing....but I realy would like to have the "features" mentioned above...
Thx, Astro
It can all be done in the rrdtool.sh of this page: http://www.macsat.com/rrdtool.php
Find this in the code:
Code:# Update Daily graphs every 10 mins if [ "${MTIME}" = 00 ] || [ "${MTIME}" = 10 ] || [ "${MTIME}" = 20 ] || [ "${MTIME}" = 30 ] || [ "${MTIME}" = 40 ] || [ "${MTIME}" = 50 ]; then # 1 Day Graph echo "Daily Graphs created....." CreateGraph "${RRDIMG}/wanday.png" 86400 "${WANRRD}" WAN CreateGraph "${RRDIMG}/landay.png" 86400 "${LANRRD}" LAN CreateGraph "${RRDIMG}/wlanday.png" 86400 "${WLANRRD}" WLAN fi
Just above this, you could insert something like:
This will create an hourly graph for each interface every time the cron job runs the script...that would be every 5 mins in the current setup.Code:# Update hourly graphs every time cron runs the script # 1 Hour Graph echo "Daily Graphs created....." CreateGraph "${RRDIMG}/wanhour.png" 3600 "${WANRRD}" WAN CreateGraph "${RRDIMG}/lanhour.png" 3600 "${LANRRD}" LAN CreateGraph "${RRDIMG}/wlanhour.png" 3600 "${WLANRRD}" WLAN
I honestly doubt it would be a good idea at all to do this due to the low ressources of the Asus router, but you will probably find out ;-)
/macsat - www.macsat.com
i've now done this:
The script runs ervery minute, (since I can't set cron jobs every xx-secounds :-( )
So I get a value every minute...
To make my "hourly" graph I take two "points", so i get a new value in the graph, every 2 minutes.
But I changed the time, the graphs are generated.
Hourly: every 7minutes
daily: every 11minutes
and I made the graphs a bit smaller, witch saves a lot of CPU time...
works great :-)
Since I am generating many graphs (cpu load, network, cpu usage (%)), it eats a lot of CPU time for nothing (most of the graphs will never be looked at).
When I read about rrdcgi, I decided to give it a try.
In theory it works well, but in practice, it takes some time just to generate one graph (dependent on size), so the cgi-script is mostly killed before it finishes.
It seems the CGI_TIMELIMIT is set to 30 seconds, not the typical value of 300.
Did this occur to anybody else?
It's bad you have to recompile thttpd to change this.
Is there a version with a higher value of CGI_TIMELIMIT available?
The source path for php-thttpd in the unslung ipkg list file points to the www.acme.com website with the original source, not the one with configs & scripts for the specified package. It would be fine to have the customized code available.
Martin