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.
Printable View
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.
I'm having this problem:
And the graphs don't get created...Quote:
<------------------------------------------------------------->
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$
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...
Is it possible to add another graph which shows the load of the router?
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
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
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/se...?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/op.../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.
hmmm?Code:[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
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
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:
What do you mean with 'fealing'?
do you want to access the usb disk ?
another approach may be usage of a small lcd monitor to display the current memory/hdd consumption :)
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...
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?
check out the rrdgraphs for traffic somewhere on this board. it demonstrates how you can log data.
Also see this. 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.
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.
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:
Code:*/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
Hi there.
Seems i encountered the same problem.
Any idea what am I doing wrong ??Code:[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
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:withCode:#!/bin/bash
and it seems to have executed successfully.Code:#!/opt/bin/bash
hello, the linesays 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.Code:bash: ./rrdstorm.sh: /bin/bash: bad interpreter: No such file or directory
Short said:
Get rrdstorm.sh from http://wl500ginfo.pastebin.com/f789cf38a and edit ./rrdstorm.sh for proper grep functions in disk section
mnt should be changed to whatever you use for mount.Code: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
'
In shell
Then edit crontabCode:ipkg install coreutils
ipkg install bash
ipkg install cron
bash rrdstorm.sh create 0 1 3 4 5 6
with these valuesCode:vi /opt/ect/crontab
and chmod itCode:*/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 this is pretty much it. Good luck!Code:chmod 0600 /opt/ect/crontab
Also get the latest version from here and check the demo graphs.
http://shrani.si/t/8/1A/36qjyTft/load1.jpghttp://shrani.si/t/1Y/kA/3iK6sabF/mem1.jpghttp://shrani.si/t/d/Ub/19AvbrbL/cpu1.jpg
http://shrani.si/t/1W/11c/2MzRcqWw/wan1.jpghttp://shrani.si/t/2b/i5/2btomT2P/hdd1.jpghttp://shrani.si/t/2L/5J/1oDv2WAo/wlan1.jpg
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.
Ok, this is what i did:
Changed:
withCode:
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'
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.Code: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'
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.
This is how it should look like.
You can check if rrd database is beeing updated with rrd with this:Code: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'
Code:[admin@dz0ny root]$ rrdtool lastupdate /path to/hdd.rrd
optprosto optzasede mntprosto mntzasede
1217337065: 264934400 226105344 73048051712 79097274368
Thanks for the quick answer. I re-downloaded the file, and made the following modifications
instead ofCode:#!/opt/bin/bash
the modification u pasted now, with disc0_3, andCode:#!/bin/bash
to reflect the settings i`m using.Code:
RRDTOOL=/opt/bin/rrdtool
RRDUPDATE=/opt/bin/rrdupdate
RRDDATA=/opt/var/lib/rrd
RRDOUTPUT=/opt/wwwroot/rrd/hdd
FORCEGRAPH=no
This is what it shows when i run it
It runs with no visible errors, but it kinda` doesn`t do anything.Code:[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 ..
Any idea ?
Hello, yes because it should not. trythis one is for initial creating of databases an htmlfilesCode:.rrdstorm.sh create 0 1 3 4 5 6
this one is for updating valuesCode:.rrdstorm.sh update 0 1 3 4 5 6
this one is for generating graphsCode:.rrdstorm.sh graph 0 1 3 4 5 6
and this one is for quick updatesCode:.rrdstorm.sh graph_cron s 0 1 3 4 5 6
I hope it works for you.
Yup, worked. Nifty looking graphs :)
Thanks for everything mate.
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 ?
Yup, here u go mate:
You can get it from here
Good luck with it :)
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
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 ?
Yes you could do it or simply delete all html files and issue command. Little explanation 0 is LOAD, 1 is MEMORY, 2 nothing yet, 3 CPU, WAN 4, DISK 5 and 6 WLAN.Code:rrdstorm.sh create 4 5 6
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.
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 ^^ .
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 :-)
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 ^^ .
Where I find (witch adresses) in web browser,
I have error on http://192.168.1.1:81/rrd/index.html
I have all files in dir /opt/wwwroot/rrd/hdd/,
but how open /opt/wwwroot/rrd/hdd/index.html in web browser.
all this command works fine.Quote:
.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
Please help me.