PDA

Bekijk de volledige versie : RRDTool Traffic Graph Tutorial - Extremely easy to follow !



macsat
13-07-2005, 22:11
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 (http://www.macsat.com/ipkg.php)
Also for beeing able to actuately see the graphs created, one option would be to follow my PHP Enabled web server Tutorial (http://www.macsat.com/php_web.php)
Finally you need to have cron running to get the traffic databases updated, check my cron tutorial. (http://www.macsat.com/cron.php)


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 (http://www.macsat.com/rrdtool.sh)

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


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: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
18-07-2005, 18:28
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.

kamilek
22-07-2005, 09:13
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?

macsat
22-07-2005, 09:24
What about reading the tutorial ?

It is stated quite clearly how to install it :

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

kamilek
22-07-2005, 09:48
I read the tutorial. And what about unistalling rrdtool? Only command ipkq uninstall rrdtool? :) .

macsat
22-07-2005, 10:19
Remove with :

ipkg remove rrdtool

barsju
24-07-2005, 00:22
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.

macsat
25-07-2005, 07:48
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 :-)

toil
16-09-2005, 20:15
Just got this up and running and i like it a lot...
thanks a million for sharing....tis very good.

Toil

erlis
17-09-2005, 20:04
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!

macsat
20-09-2005, 12:07
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.

Astrofreak
15-01-2006, 00:29
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

macsat
17-01-2006, 08:09
It can all be done in the rrdtool.sh of this page: http://www.macsat.com/rrdtool.php

Find this in the 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:


# 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


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.

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

Astrofreak
29-01-2006, 12:29
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 :-)

MMCM
09-02-2006, 17:00
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

alex1989
26-02-2006, 09:27
I can't connect to my router with Putty. Putty says: Network error. Connection refused.

((I use win xp)) Please help:(

schim
07-03-2006, 10:15
Hi, try to follow this easy tutorial here:
http://www.macsat.com/macsat/content/view/12/29/

to activate "Dropbear" on your Asus Router then you should be able to connect to your router over SSH which is more secure than telnet btw.

regards,
schim

oleo
07-03-2006, 21:43
It seems the CGI_TIMELIMIT is set to 30 seconds, not the typical value of 300.
Is there a version with a higher value of CGI_TIMELIMIT available?

Yes this limit is in php version. I have changed thttpd without php to 300 seconds. So this is a way to go.

MMCM
04-04-2006, 21:10
I have changed thttpd without php to 300 seconds. So this is a way to go.

Did you recompile thttpd? Or is it standard in thttpd without php?
I tried to compile thttpd with php but the php-patches for thttpd are for an outdated version only.

d5e5f5
16-09-2006, 11:01
Hi...

I've a little problem...
Everything works fine apart from one little thing:

How do I Copy the rrdtool.sh script to /opt/usr/bin?

JaJoah
16-09-2006, 16:13
Hi...

I've a little problem...
Everything works fine apart from one little thing:

How do I Copy the rrdtool.sh script to /opt/usr/bin?

One uses the copy (cp) command :) . Go to the directory where the file is located now and then type the following:



cp rrdtool.sh /opt/usr/bin


and when needed:



chmod +x /opt/usr/bin/rrdtool.sh


to make the file executable

<----- Linux n00b, but this is something even I know :D

Elect
20-09-2006, 07:55
Has it any use of setting the run rrdtool.sh more often than every 5 mins? I've set it to 2 mins, but I can't see for sure that the graph has more detail then 5 mins.

Anyone who knows?

JaJoah
23-09-2006, 13:22
Has it any use of setting the run rrdtool.sh more often than every 5 mins? I've set it to 2 mins, but I can't see for sure that the graph has more detail then 5 mins.

Anyone who knows?

The only thing I can think of is that the graph will show more accurate speeds. So unless your speed varies a lot during 2 intervals, you won't get much more accurate graphs.

I stick with the 5 min. interval as it is stressing the router as it is already :p

Elect
26-09-2006, 10:13
Tries both of them now. And indeed it doesn't matter much. Graphs are a little bit more detailed but not enough to stress the router more then 100% extra (I used to check it every 2 minutes).

Ps, I installed in on my WL500G Premium. Just little path changes (like /opt/bin instead of /opt/usr/bin). And make sure if you also follow the Cron manual of Mascat that the USER who runs the run-parts file is admin and not root (!!) in the crontab file (in /opt/etc/). Took me ages to find that out

netvista
11-10-2006, 23:06
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



Hello,

Thanks for all the tuts so far. All of them were clear but with this one i encounter some problems.

I did Wget http://www.macsat.com/rrdtool.sh while i was in the /tmp directory. But when i want to copy it to /opt/usr/bin i got unable to open `/opt/usr/bin': No such file or directory

I can also not cd directly to /opt/usr/bin but i am able to cd one directory at a time....

I have an usb stick of 512 Mb mounted on /opt. as stated in another tutorial.

So i am actually kind of stuck here. Can anyone help me out?

Elect
12-10-2006, 15:06
Go to the /opt/usr/bin directory and use the Wget http://www.macsat.com/rrdtool.sh command there. It should download it there.

netvista
13-10-2006, 20:51
Thanks for your reply, but now the response is

@(none) /bin]$ Wget http://www.macsat.com/
-sh: Wget: not found

And when i leave out http:// the response is :

@(none) /tmp]$ wget www.mascat.com/rrdtool.sh
wget: not an http or ftp url: www.mascat.com/rrdtool.sh

I just don't get it in /opt/usr/bin....:confused:

Elect
15-10-2006, 09:33
You forgot the http://. This one works, tried in my own config to make sure. Just run it in the designated folder

wget http://www.macsat.com/rrdtool.sh

netvista
16-10-2006, 19:15
Thanks for the advise, but that doesn't work because it is a read only filesystem...

here is the response:

get http://www.macsat.com/rrdtool.sh
wget: rrdtool.sh: Read-only file system

But everyone who followed this tutorial should must have had this problem :rolleyes:

Maybe macsat himself can give me the golden tip...???

JaJoah
27-10-2006, 21:56
Thanks for the advise, but that doesn't work because it is a read only filesystem...

here is the response:

get http://www.macsat.com/rrdtool.sh
wget: rrdtool.sh: Read-only file system

But everyone who followed this tutorial should must have had this problem :rolleyes:

Maybe macsat himself can give me the golden tip...???

To which directory are you trying to write the file, as in: from where are you calling this command? The response suggests that your are trying to download the file to a read-only part.

Did you try moving to /opt/usr/bin before calling the



wget http://www.macsat.com/rrdtool.sh


command ?

macsat
31-10-2006, 08:14
did you remember to mount a disk on /opt ?

To me it looks like you are trying to write directly to the flash, which isnt supported in Olegs firmware (that part of the flash anyway).

Ierlandfan
05-11-2006, 14:44
I als got the "/opt/usr/bin" (it doesn't exist) issue but I changed the path to /opt/bin and changed the line in the config

But when I try to acces my-ip-/rrd is says: file not found
ps aux only shows that cron has started

1 root 660 S /sbin/init
2 root SW [keventd]
3 root SWN [ksoftirqd_CPU0]
4 root SW [kswapd]
5 root SW [bdflush]
6 root SW [kupdated]
7 root SW [mtdblockd]
61 root 320 S telnetd
66 root 376 S httpd vlan1
70 root 388 S syslogd -m 0 -O /tmp/syslog.log -S -l 7
71 root 340 S klogd
73 nobody 496 S dnsmasq
74 root 460 S snmpd -c /tmp/snmpd.conf
81 root SW [khubd]
90 root 276 S lpd
92 root 260 S p9100d -f /dev/usb/lp0 0
95 root 344 S waveservermain
97 root 344 S rcamdmain
101 root SW [usb-storage-0]
102 root SW [scsi_eh_0]
107 root 320 S infosvr br0
108 root 468 S watchdog
111 root 344 S ntp
122 root SW [kjournald]
136 root 432 S udhcpc -i vlan1 -p /var/run/udhcpc0.pid -s /tmp/udhcp
140 root 408 S /opt/sbin/cron
154 root 568 S upnp -D -L br0 -W vlan1
198 root 544 S -sh
211 root 392 R ps aux

BTW...thttpd config was saying port: 8080 instead of 81
with port 81 or 8080 i got http://192.168.1.254/rrd "file not found"
(btw rrdtool.log is empty)

What to check to make it work?

JaJoah
08-11-2006, 09:02
My problem still is the same. THHTPD seems to shutdown on its own :mad: Where is the logfile ? Has anyone else suffered from this fenomenon?

I began from scratch, installed SSH, VSFTPD, THTTPD but still the problem stays :(

netvista
01-12-2006, 23:00
OK, i finally got it working. I just copied the script in /opt/bin i.s.o. /opt/usr/bin.

netvista
02-12-2006, 09:08
OK, i finally got it working. I just copied the script in /opt/bin i.s.o. /opt/usr/bin.


I have one more question though. Why is my WAN graph always at a steady 222 bytes...:confused:

It doesn't matter if download a lot or not....it's always 220 bytes...strange. Also i tested the LAN & WLAN graph bij transferring a big file from my pc (wired) to my laptop (wireless).

The LAN graph shows a big peak for INCOMING traffic and the WLAN graph shows a big peak for OUTGOING traffic... I think it should be the other way around... do i interpret it incorrectly?

Thanks in advance

domby
12-12-2006, 22:29
nice tutorial. working perfectly. thanks!

CountZero
19-01-2007, 20:05
Thanks for the tutorial, works fine.

Only problem I had was with the graph creation, since I currently don't have a wireless client the data is 0 and this apparently caused the generation to hang.

Devil-Strike
23-01-2007, 11:17
I have some problems with rrdrun.sh, it wont execute ok so-ever

it wont create png files

root@Devil-Strike cron.5mins]$ ./rrdrun.sh
/bin/sh: Can't open

dont know what to do know.

CountZero
23-01-2007, 12:28
have you made it executable? (chmod +x)

Ierlandfan
25-02-2007, 20:47
For the record and history purposes...the link tot the page on the router in the tutorial isn't quite right...must be
http://192.168.1.254:8080/rrd/

charming
06-03-2007, 04:06
Hi.
Thank you for good script to view the traffic.
I have one question.
How to log every 2 second? like this http://www.polarcloud.com/v/scbwm.htm

Thank you.

lourenco
06-03-2007, 11:34
I'm having this problem:



<------------------------------------------------------------->

Tue Mar 6 11:30:01 GMT 2007
WAN Interface: vlan1
LAN Interface: vlan0
WLAN Interface: eth1
WAN -> in: 2057306 out: 737424
LAN -> in: 0 out: 294284
WLAN -> in: 0 out: 0
/opt/usr/bin/rrdtool.sh: /opt/usr/bin/rrdtool.sh: 136: rrdupdate: not found
/opt/usr/bin/rrdtool.sh: /opt/usr/bin/rrdtool.sh: 137: rrdupdate: not found
/opt/usr/bin/rrdtool.sh: /opt/usr/bin/rrdtool.sh: 138: rrdupdate: not found
Daily Graphs created.....
/opt/usr/bin/rrdtool.sh: /opt/usr/bin/rrdtool.sh: 172: rrdtool: not found
mv: unable to rename `/opt/share/www/rrd//wanday.png.new': No such file or dire$
/opt/usr/bin/rrdtool.sh: /opt/usr/bin/rrdtool.sh: 172: rrdtool: not found
mv: unable to rename `/opt/share/www/rrd//landay.png.new': No such file or dire$
/opt/usr/bin/rrdtool.sh: /opt/usr/bin/rrdtool.sh: 172: rrdtool: not found
mv: unable to rename `/opt/share/www/rrd//wlanday.png.new': No such file or dir$


And the graphs don't get created...

Any clue on this?
Thanks...

[edit:] - I guess I may have found the problem: there are compatibility issues with the latest uClibc in -7f... This only works in -7g... damm...

Elect
26-03-2007, 09:00
Is it possible to add another graph which shows the load of the router?

guilherme
03-04-2007, 02:13
I think that I've installed, because I can load the page, but It didn't show any graph, Will I need to w8 a day to see it? or is the admin root problem? I'm running wl500gP, if that's the problem How do I solve it?

I've admin in crontab...

solved with chmod +x rrdtool

zwitter
24-06-2007, 23:48
One thing just kills me. All router power goes to make those crapy lines and i havent installed nothing except samba, wwwphp, dropbear, nano. Refresh goes every 5 min and still :/
If that wont help i will say byebye to rrdtool.sh and find other way to generate stats
EDIT:
imo txt stat version would be nice

MMCM
25-06-2007, 00:03
One thing just kills me. All router power goes to make those crapy lines and i havent installed nothing except samba, wwwphp, dropbear, nano. Refresh goes every 5 min and still :/
If that wont help i will say byebye to rrdtool.sh and find other way to generate stats

You should use the older rrdtool version 1.0.50, it's about 10x faster generating graphs. The output is not that pretty because it doesn't use antialiasing.
Additionally, stop generating graphs you never look at. I use cgi scripts with lighttpd on openwrt (worked with thttpd on olegs fw too), and graphs are generated on demand only.
I do sample data every minute with traffic of 4 interfaces, cpu load and cpu usage and my average cpu usage is below 5%.

zwitter
25-06-2007, 10:38
You should use the older rrdtool version 1.0.50, it's about 10x faster generating graphs. The output is not that pretty because it doesn't use antialiasing.
Additionally, stop generating graphs you never look at. I use cgi scripts with lighttpd on openwrt (worked with thttpd on olegs fw too), and graphs are generated on demand only.
I do sample data every minute with traffic of 4 interfaces, cpu load and cpu usage and my average cpu usage is below 5%.

Well i used new package and it was taking all the time about 80%-90% cpu so if you do the math there isn't a lot of space for anything else [i was lagging out from time to time]
Anyway where i can't get that package ? I'm kinda new to linux but most of things im learning quite fast - just need some directions xD
Well i found smth usefull tho i dont have a clue which build i should use:\
http://rpmfind.net/linux/rpm2html/search.php?query=rrdtool

MMCM
26-06-2007, 02:10
Well i used new package and it was taking all the time about 80%-90% cpu so if you do the math there isn't a lot of space for anything else [i was lagging out from time to time]
Anyway where i can't get that package ? I'm kinda new to linux but most of things im learning quite fast - just need some directions xD
Well i found smth usefull tho i dont have a clue which build i should use:\
http://rpmfind.net/linux/rpm2html/search.php?query=rrdtool

rpm are for PC base linux distros, you won't be able to use those on your router, you need to look for *.ipk packages.

Read some of the tutorials at macsat.com first.

Unfortunatly the http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ feed contains only the newer version of rrdtool. When I was still using olegs firmware, I downloaded an old package of rrdtool from somewhere, but I don't remember where.
OpenWrt kamikaze feed do contain both versions of rrdtool, so you can decide what you want :-)
You could try to download that .ipk and extract the required binaries manually, but I don't know if that will work.

But anyway, switching from background generated graphs to cgi/runtime generated graphs will free your router from a lot of work.

Blackburn
29-07-2007, 15:28
[admin@(none) root]$ ipkg.sh update
Downloading http://wl500g.dyndns.org/ipkg/Packages ...
wget: wl500g.dyndns.org: Unknown host
ipkg_download: ERROR: Failed to retrieve http://wl500g.dyndns.org/ipkg/Packages, returning
ipkg_update: Error downloading http://wl500g.dyndns.org/ipkg/Packages to /opt/lib/ipkg/lists/wl500g

hmmm?

gyterpena
03-12-2007, 09:58
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

Hi I currently use mrtg to create graphs every 5 min. There is extension for it so it will only create RRDtool database and then you can use cgi script from their web site to generate graphs but it didn't work for my it complained about
some value in dynaloader.pm line 80.
Anyway any chance to share how can we get graphs for cpu and load?
thanks

trider
13-12-2007, 22:46
Hi all

First of all, I must say, this is a very nice forum :D

Got 4 wl-500gP from work, an started to play with 'em... And the howto's are easy to follow, and i think, that it took me about 45-60 min to setup my final one (3 others are still working, but not 100%).

Now - The thing is, I would really like to have some sort of fealing with my diskspace on my philips 320GB USB drive.

Is there a tool allready for this or is it from scratch :confused:

raas
14-12-2007, 15:05
What do you mean with 'fealing'?

do you want to access the usb disk ?

al37919
14-12-2007, 15:34
another approach may be usage of a small lcd monitor to display the current memory/hdd consumption :)

trider
16-12-2007, 21:05
well, some read-out of some sort, could be nice...

Could be a graph or just displayed in numbers. The thing is, I don't know how to log the information. If I ssh to my router, I can type in 'df -h', and the data is displayed.

But how to get it on my http page of net, mem and CPU graphs, I do not know...

metamorphose
13-01-2008, 20:13
Hi Everybody,


I have installed successfully RRDTool and I set it up in crontab. I use rrdrun.sh shell script in /opt/etc/cron.5mins directory to run /opt/usr/bin/rrdtool.sh.

If I list running processes by ps command, I notice a weird thing: I see many rrdtool processes. Here is the result:

-bash-3.2# ps
PID Uid VmSize Stat Command
1 root 380 S init
2 root SW< [keventd]
3 root RWN [ksoftirqd_CPU0]
4 root SW [kswapd]
5 root SW [bdflush]
6 root SW [kupdated]
7 root SW [mtdblockd]
8 root SW [khubd]
13 root SW< [mdrecoveryd]
80 root SW [gpio_out_pulse]
81 root SW [button_notify_u]
84 root SW< [ksed]
85 root SW [ksechanged]
100 root SW< [raid1d]
105 root SW< [raid1d]
108 root SW [kreiserfsd]
175 root 268 S syslogd -R 255.255.255.255
177 root 52 S klogd
179 root 132 S httpd 80 y
181 root 128 S httpd 8080 share_browsing
185 root 520 S upnp -D -L br0 -W ppp0
186 root 48 S nas /tmp/nas.lan.conf /tmp/nas.lan.pid lan
190 root 152 S pppd file /tmp/ppp/options.wan
205 root 12 S portmap
206 root 172 S dnsmasq -i br0 -r /tmp/resolv.conf
209 root 12 S rpc.mountd
212 root SW [nfsd]
214 root 12 S rpc.statd
215 root SW [lockd]
216 root SW [rpciod]
220 root 12 S rpc.rquotad
284 root 12 S waveservermain
286 root 12 S rcamdmain
287 root 20 S infosvr br0
297 root 8 S usbcopymain
512 root 556 S thttpd -d /shares/MYVOLUME1/MYSHARE1/web -c ** -p 8081 -u root -nos
514 root 408 S dms /shares/DMSRoot WL700gE 00:1A:92:B4:46:4E
520 root 408 S dms /shares/DMSRoot WL700gE 00:1A:92:B4:46:4E
523 root 408 S dms /shares/DMSRoot WL700gE 00:1A:92:B4:46:4E
524 root 408 S dms /shares/DMSRoot WL700gE 00:1A:92:B4:46:4E
539 root 148 S mt-daapd -c /tmp/mt-daapd.conf -s WL700gE
540 root 864 S mt-daapd -c /tmp/mt-daapd.conf -s WL700gE
543 root 864 S mt-daapd -c /tmp/mt-daapd.conf -s WL700gE
544 root 864 S mt-daapd -c /tmp/mt-daapd.conf -s WL700gE
549 root 4 S /apps/bin/utelnetd -i br0
566 root 864 S mt-daapd -c /tmp/mt-daapd.conf -s WL700gE
597 root 176 S /opt/sbin/dropbear
608 root 572 S /opt/sbin/nmbd -D
611 root 444 S /opt/sbin/smbd -D
615 root 112 S /opt/sbin/smbd -D
620 root 72 S /usr/sbin/ez-ipupdate -c /opt/etc/ddns.conf
631 root 268 S proftpd: (accepting connections)
655 root 624 S thttpd -d /opt/share/www -c /opt/etc/thttpd.conf -p 81 -u root
658 root 168 S /opt/sbin/cron
672 root 160 S /bin/printd
735 root 8832 S /opt/bin/mlnet.lite
737 root 8832 S /opt/bin/mlnet.lite
738 root 8832 S N /opt/bin/mlnet.lite
1005 root 72 S /opt/sbin/cron
1006 root 136 S sh /opt/etc/cron.5mins/rrdrun.sh
1007 root 52 S /opt/bin/bash /opt/usr/bin/rrdtool.sh
1057 root 72 R rrdtool graph /opt/share/www/rrd//wlanday.png.new -a PNG -s -86400 -w 550 -h 240 -v bytes/s DEF:ds1=/opt/var/lib/rrd//et
14550 root 212 S /opt/sbin/cron
14551 root 508 S sh /opt/etc/cron.5mins/rrdrun.sh
14552 root 872 S /opt/bin/bash /opt/usr/bin/rrdtool.sh
14598 root 932 R rrdtool graph /opt/share/www/rrd//wlanday.png.new -a PNG -s -86400 -w 550 -h 240 -v bytes/s DEF:ds1=/opt/var/lib/rrd//et
14643 root 212 S /opt/sbin/cron
14644 root 516 S sh /opt/etc/cron.5mins/rrdrun.sh
14645 root 780 S /opt/bin/bash /opt/usr/bin/rrdtool.sh
14691 root 756 R rrdtool graph /opt/share/www/rrd//wlanday.png.new -a PNG -s -86400 -w 550 -h 240 -v bytes/s DEF:ds1=/opt/var/lib/rrd//et
14736 root 216 S /opt/sbin/cron
14737 root 508 S sh /opt/etc/cron.5mins/rrdrun.sh
14738 root 780 S /opt/bin/bash /opt/usr/bin/rrdtool.sh
14784 root 756 R rrdtool graph /opt/share/www/rrd//wlanday.png.new -a PNG -s -86400 -w 550 -h 240 -v bytes/s DEF:ds1=/opt/var/lib/rrd//et

etc.


Does anyone know what this strange behavior is?

Chillout
24-07-2008, 12:36
check out the rrdgraphs for traffic somewhere on this board. it demonstrates how you can log data.

wirespot
24-07-2008, 21:23
Also see this (http://xlife.zuavra.net/index.php/73/). There's a script there which contains an example about how to graph disk space. But I hope you know your rrdtool (and bash) 'cause that script is not for the faint of heart.

poiu
28-07-2008, 18:05
I try your script copacup and i get : -sh: rrdstorm.sh: not found when i run it.
#-------------------------------------------------------------------
# configuration
#-------------------------------------------------------------------

RRDTOOL=/opt/bin/rrdtool
RRDUPDATE=/opt/bin/rrdupdate
RRDDATA=/opt/var/lib/rrd
RRDOUTPUT=/opt/share/www/rrd/
FORCEGRAPH=no

Script is of course executable, and i make the need dirs in the right paths and last, rrdtool is installed ^^.
Is of course lack of linux knowledge, but point please what i missing.
Firmware is .10 on a v1 500GP.

cupacup
28-07-2008, 23:45
Well you need to install bash first, then you should check grep functions(grep mnt, could also be grep part1, for hdd), also use latest version which have just been updated. Currently the hdd graph values must be updated every 30 s, but for the other(CPU;RAM..) values can be updated every minute using cron. Here is how my cron looks like:

*/1 * * * * admin bash /mnt/rrdstorm.sh update 0 1 3 4 5
*/12 * * * * admin bash /mnt/rrdstorm.sh graph_cron s 0 1 3 4 5
0 */1 * * * admin bash /mnt/rrdstorm.sh graph_cron h 0 1 3 4 5
3 */6 * * * admin bash /mnt/rrdstorm.sh graph 0 1 3 4 5

lordbone
29-07-2008, 13:01
Hi there.

Seems i encountered the same problem.



[xxx@xxx bin]$ ./rrdstorm.sh
-sh: ./rrdstorm.sh: not found
[xxx@xxx bin]$ bash
[xxx@xxx bin]$ ./rrdstorm.sh
bash: ./rrdstorm.sh: /bin/bash: bad interpreter: No such file or directory


Any idea what am I doing wrong ??

All I modified were the RRDDATA= and RRDOUTPUT= fields.

Thanks.

----------------------------

Later edit:

Ok, i was stupid, didn`t even read the error. Thing is that bash was installed under /opt/bin/bash and the rrdstorm script was looking for it under /bin/bash.

Replaced the header of file:
#!/bin/bash with
#!/opt/bin/bash and it seems to have executed successfully.

cupacup
29-07-2008, 13:27
hello, the line
bash: ./rrdstorm.sh: /bin/bash: bad interpreter: No such file or directory says it all. Bash should not be installed in /bin. Are you sure you installed bash via ipkg? Because bash is an optional package and is not installed by default. Also if you want to properly display disk data you should install coreutils. Check this tutorial (http://wl500g.info/showthread.php?t=10307).
Short said:

Get rrdstorm.sh from http://wl500ginfo.pastebin.com/f789cf38a and edit ./rrdstorm.sh for proper grep functions in disk section

RRDuVAL[5]='
SP=$(/opt/bin/coreutils-df "-B1")
echo -n $(echo "$SP"|grep opt|awk "{print \$3\":\"\$2}"):
echo -n $(echo "$SP"|grep mnt|awk "{print \$3\":\"\$2}")
echo
'
mnt should be changed to whatever you use for mount.
In shell


ipkg install coreutils
ipkg install bash
ipkg install cron
bash rrdstorm.sh create 0 1 3 4 5 6

Then edit crontab

vi /opt/ect/crontab
with these values


*/1 * * * * admin bash /path to/rrdstorm.sh update 0 1 3 4 5 6
*/22 * * * * admin bash /path to/rrdstorm.sh graph_cron s 0 1 3 4 5 6
0 */1 * * * admin bash /path to/rrdstorm.sh graph_cron h 0 1 3 4 5 6
3 */6 * * * admin bash /path to/rrdstorm.sh graph 0 1 3 4 5 6
and chmod it
chmod 0600 /opt/ect/crontab
and this is pretty much it. Good luck!

cupacup
29-07-2008, 13:31
Also get the latest version from here (http://wl500ginfo.pastebin.com/f77e330b5) and check the demo graphs.
http://shrani.si/t/8/1A/36qjyTft/load1.jpg (http://shrani.si/?8/1A/36qjyTft/load1.png)http://shrani.si/t/1Y/kA/3iK6sabF/mem1.jpg (http://shrani.si/?1Y/kA/3iK6sabF/mem1.png)http://shrani.si/t/d/Ub/19AvbrbL/cpu1.jpg (http://shrani.si/?d/Ub/19AvbrbL/cpu1.png)
http://shrani.si/t/1W/11c/2MzRcqWw/wan1.jpg (http://shrani.si/?1W/11c/2MzRcqWw/wan1.png)http://shrani.si/t/2b/i5/2btomT2P/hdd1.jpg (http://shrani.si/?2b/i5/2btomT2P/hdd1.png)http://shrani.si/t/2L/5J/1oDv2WAo/wlan1.jpg (http://shrani.si/?2L/5J/1oDv2WAo/wlan1.png)

lordbone
29-07-2008, 13:44
Yeah, i noticed the version change when you uploaded the new file. I got both the old and the new one. I also noticed that i was stupid with the bash thingie, and edited the post above. Gonna try now what u posted. Thanks.

lordbone
29-07-2008, 14:00
Ok, this is what i did:

Changed:




SP=$(/opt/bin/coreutils-df "-B1")
echo -n $(echo "$SP"|grep opt|awk "{print \$3\":\"\$2}"):
echo -n $(echo "$SP"|grep mnt|awk "{print \$3\":\"\$2}")
echo
'
RRDgUM[5]='space (bytes)'
RRDgLIST[5]="30 31 32 33 34 35"
RRDgDEF[5]=$(cat <<EOF
'DEF:optzasede=\$RRD:optzasede:AVERAGE'
'DEF:optprosto=\$RRD:optprosto:AVERAGE'
'DEF:mntzasede=\$RRD:mntzasede:AVERAGE'
'DEF:mntprosto=\$RRD:mntprosto:AVERAGE'
'CDEF:bo=mntzasede,UN,0,mntzasede,IF,0,GT,UNKN,INF ,IF'
'AREA:bo#DDDDDD:'
'AREA:mntzasede#CC0033:/mnt:'
'CDEF:root=mntzasede,mntprosto,+'
'VDEF:sumr=root,LAST'


with



SP=$(df)
echo -n $(echo "$SP"|grep opt|awk "{print \$3\":\"\$2}"):
echo -n $(echo "$SP"|grep tmp|awk "{print \$3\":\"\$2}")
echo
'
RRDgUM[5]='space (bytes)'
RRDgLIST[5]="30 31 32 33 34 35"
RRDgDEF[5]=$(cat <<EOF
'DEF:optzasede=\$RRD:optzasede:AVERAGE'
'DEF:optprosto=\$RRD:optprosto:AVERAGE'
'DEF:mntzasede=\$RRD:mntzasede:AVERAGE'
'DEF:mntprosto=\$RRD:mntprosto:AVERAGE'
'CDEF:bo=mntzasede,UN,0,mntzasede,IF,0,GT,UNKN,INF ,IF'
'AREA:bo#DDDDDD:'
'AREA:mntzasede#CC0033:/tmp/mnt/disc0_3:'
'CDEF:root=mntzasede,mntprosto,+'
'VDEF:sumr=root,LAST'


I don`t know if that is good. I have like, 1 partition mounted to /opt and the other to /tmp/mnt/disc0_3 since I head oleg`s firmware doesn`t mount it anywhere else.

Don`t know how correct that edit is.

And another thing, the script seems to run successfully, but it doesn`t generate any output. The RRDDATA and RRDOUTPUT folders are empty after script execution.

I think it crashes silently or something.

I am already running rrdtools for traffic if it makes a difference.

-- BTW, awesome demo.

cupacup
29-07-2008, 14:12
This is how it should look like.

SP=$(/opt/bin/coreutils-df "-B1")
echo -n $(echo "$SP"|grep opt|awk "{print \$3\":\"\$2}"):
echo -n $(echo "$SP"|grep disc0_3|awk "{print \$3\":\"\$2}")
echo
'
RRDgUM[5]='space (bytes)'
RRDgLIST[5]="30 31 32 33 34 35"
RRDgDEF[5]=$(cat <<EOF
'DEF:optzasede=\$RRD:optzasede:AVERAGE'
'DEF:optprosto=\$RRD:optprosto:AVERAGE'
'DEF:mntzasede=\$RRD:mntzasede:AVERAGE'
'DEF:mntprosto=\$RRD:mntprosto:AVERAGE'
'CDEF:bo=mntzasede,UN,0,mntzasede,IF,0,GT,UNKN,INF ,IF'
'AREA:bo#DDDDDD:'
'AREA:mntzasede#CC0033:disc0_3:'
'CDEF:root=mntzasede,mntprosto,+'
'VDEF:sumr=root,LAST'
You can check if rrd database is beeing updated with rrd with this:

[admin@dz0ny root]$ rrdtool lastupdate /path to/hdd.rrd
optprosto optzasede mntprosto mntzasede

1217337065: 264934400 226105344 73048051712 79097274368

lordbone
29-07-2008, 14:26
Thanks for the quick answer. I re-downloaded the file, and made the following modifications



#!/opt/bin/bash


instead of



#!/bin/bash


the modification u pasted now, with disc0_3, and



RRDTOOL=/opt/bin/rrdtool
RRDUPDATE=/opt/bin/rrdupdate
RRDDATA=/opt/var/lib/rrd
RRDOUTPUT=/opt/wwwroot/rrd/hdd
FORCEGRAPH=no


to reflect the settings i`m using.

This is what it shows when i run it



[xxx@xxx bin]$ ./rrdstorm.sh
[xxx@xxx bin]$ ls /opt/var/lib/rrd/
total 188
drwxr-xr-x 2 xxx root 4096 Jul 29 13:09 .
drwxr-xr-x 4 xxx root 4096 Jul 29 13:09 ..
-rw-r--r-- 1 xxx root 56736 Jul 29 16:17 eth1.rrd
-rw-r--r-- 1 xxx root 56736 Jul 29 16:17 vlan0.rrd
-rw-r--r-- 1 xxx root 56736 Jul 29 16:17 vlan1.rrd
[xxx@xxx bin]$ ls /opt/wwwroot/rrd/hdd
total 8
drwxr-xr-x 2 tbone root 4096 Jul 29 15:11 .
drwxr-xr-x 3 tbone root 4096 Jul 29 16:15 ..


It runs with no visible errors, but it kinda` doesn`t do anything.

Any idea ?

cupacup
29-07-2008, 14:38
Hello, yes because it should not. try

.rrdstorm.sh create 0 1 3 4 5 6
this one is for initial creating of databases an htmlfiles


.rrdstorm.sh update 0 1 3 4 5 6
this one is for updating values


.rrdstorm.sh graph 0 1 3 4 5 6
this one is for generating graphs


.rrdstorm.sh graph_cron s 0 1 3 4 5 6
and this one is for quick updates

I hope it works for you.

lordbone
29-07-2008, 14:51
Yup, worked. Nifty looking graphs :)

Thanks for everything mate.

cupacup
29-07-2008, 15:58
Yup, worked. Nifty looking graphs :)

Thanks for everything mate.

No problems, I am glad you like it.

poiu
29-07-2008, 18:31
Still no run here.
When i execute i get :

./rrdstorm.sh : line 594 : syntax error near unexpected token `) '
./rrdstorm.sh : line 594 : ` help)'

Between ` and help in line 2 is some spaces, but forum deleted them.
In cron modifications is done and modifications of script is the disk0_3 on right section and right paths for files.
Maybe my copy/paste skills is outdated :)
Try with different editors and browsers on win/router but same result.
Lordbone you can upload the file here ?

lordbone
29-07-2008, 19:09
Yup, here u go mate:

You can get it from here (http://lordbone.evonet.ro/mipsel/rrdstorm.sh)

Good luck with it :)

poiu
29-07-2008, 21:51
Thank you lordbone, your file work ok, maybe the script get tainted on source ...
Still prezentation is bad, need enter by hand cpu/hdd/ etc, the index is build empty, overall graphics is nice

cupacup
29-07-2008, 23:50
Still no run here.
When i execute i get :

./rrdstorm.sh : line 594 : syntax error near unexpected token `) '
./rrdstorm.sh : line 594 : ` help)'

Between ` and help in line 2 is some spaces, but forum deleted them.
In cron modifications is done and modifications of script is the disk0_3 on right section and right paths for files.
Maybe my copy/paste skills is outdated :)
Try with different editors and browsers on win/router but same result.
Lordbone you can upload the file here ?
Well my copy>paste skills were bad not yours, sorry for that!

poiu
30-07-2008, 17:21
No harm done, copacup, we all tanks you for sharing your work with us ^^ .
But a beauty will be if the graphics are build in main page, not spread.
This is html work i think, but not any skills here, again..
Overall charge on processor power is around 20% so i will live with, hope the Asus will too,, the another scripts find it around charge like 50% so was innaceptable, so i will let your script work.
Another thing, wlan is blank, because of interface diferences between v1 and v2 ?
And to kill cpu temp because wont work anyway what is needit ?

LE: Y want to kill memory alocation/load/cpu temp to save power, i wont need it, is a quick way to do it besides try to comment some portions of script ?
The 1,2,3,4,5,6, way will do ?

cupacup
31-07-2008, 00:02
Yes you could do it or simply delete all html files and issue command
rrdstorm.sh create 4 5 6. Little explanation 0 is LOAD, 1 is MEMORY, 2 nothing yet, 3 CPU, WAN 4, DISK 5 and 6 WLAN.
So if you want to create, for example just stats for disk, you would issue command rrdstorm create 5, values would get updated by rrdstorm update 5 and so on.
LE: If you want just some graphs on main page, you can edit index html. And place those images there.

poiu
31-07-2008, 15:24
I do in cron section like this :

*/1 * * * * admin bash /tmp/harddisk/rrdstorm.sh update 3 4 5
*/12 * * * * admin bash /tmp/harddisk/rrdstorm.sh graph_cron s 3 4 5
0 */1 * * * admin bash /tmp/harddisk/rrdstorm.sh graph_cron h 3 4 5
3 */6 * * * admin bash /tmp/harddisk/rrdstorm.sh graph 3 4 5

So the only desired (cpu,hdd,wan) will be created, thus save the cpu power.
My skills on html is = 0, so i will live with this form ^^ .

Chillout
31-07-2008, 15:29
I'm gonna see if I can combine this with my current RRDGraph setup which displays my bandwidth. Let's see if I can add CPU load to it :-)

poiu
31-07-2008, 15:48
After 1 hour test new settings the load drop from 20% with spikes to 100%, to 5% with spikes max 50%, so this the sweet spot for me .
The graphics look nice and ease to folow, but maybe on hdd i chose another colors, the red is omnipresent for me and hard to see the diferences wich is what.
Tanks you copacup again.
LE: the spikes go to 100% but the time is under 0,5 sec, before they last like 1 sec or more.
And to not forget, i have 128 ram, maybe this is important too ^^ .

artur72
16-09-2008, 23:43
Where I find (witch adresses) in web browser,
I have error on http://192.168.1.1:81/rrd/index.html

artur72
17-09-2008, 22:50
I have all files in dir /opt/wwwroot/rrd/hdd/,
but how open /opt/wwwroot/rrd/hdd/index.html in web browser.


.rrdstorm.sh create 0 1 3 4 5 6

.rrdstorm.sh update 0 1 3 4 5 6

.rrdstorm.sh graph 0 1 3 4 5 6

.rrdstorm.sh graph_cron s 0 1 3 4 5 6

all this command works fine.


Please help me.

wirespot
19-09-2008, 16:18
artur, you need a web server (like lighttpd) pointing to that directory. Or you can share the dir with Samba and look at the html files with your browser from your PC.

A tip for everybody else. Updating the rrd databases takes little CPU, but generating the graphs takes a lot. So you could keep just the update commands in cron and generate the graphs only when you want to look at them.

Willie2_z
29-11-2008, 14:39
Hi.
I tried to follow the RRDTOOL-guide by macsat.
But it doesn't work. Nothing happens.
I then tried to run the RRDTOOL-script manually, but it returns with an error: /opt/usr/bin/rrdtool.sh: 128: awk: not found
so it seems like I don't have awk.
How do I install this ?

Chillout
06-06-2009, 15:23
http://xlife.zuavra.net/index.php/73/
http://xlife.zuavra.net/files/posts/0073/cpu.png

It's a script to make life easier when using rrdtool...

It looks like a nice script, but I can't get it to run properly, I keep getting problems when using bash... anyone here running it without any problems?
Thanks in advance!

poiu
09-06-2009, 21:34
Yes i do for a year or more, and i remember some problems until everything work
ok.
If you do a search about everything is here on forum, but feel free to ask, i will help with i can .
Here : http://wl500g.info/showthread.php?t=11981&highlight=rrdstorm