Posted: Fri Aug 08, 2014 3:30 Post subject: getting error after using easy setup
Using the easy setup gives me these errors. I am getting stats on /user/usage.html but nothing on MyPage.
Getting these errors using USB map like the instructions
/tmp/mnt/sda1
cat: can't open '/tmp/in_21652.tmp': No such file or directory
cat: can't open '/tmp/out_21652.tmp': No such file or directory
sh: 0: unknown operand
cat: can't open '/tmp/in_21911.tmp': No such file or directory
cat: can't open '/tmp/out_21911.tmp': No such file or directory
sh: 0: unknown operand
cat: can't open '/tmp/in_21911.tmp': No such file or directory
cat: can't open '/tmp/out_21911.tmp': No such file or directory
sh: 0: unknown operand
cat: can't open '/tmp/in_21911.tmp': No such file or directory
cat: can't open '/tmp/out_21911.tmp': No such file or directory
sh: 0: unknown operand
cat: can't open '/tmp/in_21911.tmp': No such file or directory
cat: can't open '/tmp/out_21911.tmp': No such file or directory
sh: 0: unknown operand
Examples :
/tmp/wrtbwmon setup
/tmp/wrtbwmon update /tmp/usage.db offpeak
/tmp/wrtbwmon publish /tmp/usage.db /www/user/usage.htm /jffs/users.txt
Note : [user_file] is an optional file to match users with their MAC address
Its format is : 00:MA:CA:DD:RE:SS,username , with one entry per line
cat: can't open '/tmp/in_6700.tmp': No such file or directory
cat: can't open '/tmp/out_6700.tmp': No such file or directory
sh: 0: unknown operand
DEBUG : New traffic for 00:1f:d0:f3:ed:4e since last update : 425k:15k
DEBUG : New traffic for e0:69:95:e8:ca:9d since last update : 2k:6k
DEBUG : New traffic for 00:27:0e:08:da:46 since last update : 0k:3k
cat: can't open '/tmp/in_6700.tmp': No such file or directory
cat: can't open '/tmp/out_6700.tmp': No such file or directory
sh: 0: unknown operand
DEBUG : New traffic for 00:1f:d0:f4:b5:c1 since last update : 0k:1k
/tmp/wrtbwmon: line 202: sort: not found
Usage : /tmp/wrtbwmon {setup|update|publish} [options...]
Options :
/tmp/wrtbwmon setup
/tmp/wrtbwmon update database_file [offpeak]
/tmp/wrtbwmon publish database_file path_of_html_report [user_file]
Examples :
/tmp/wrtbwmon setup
/tmp/wrtbwmon update /tmp/usage.db offpeak
/tmp/wrtbwmon publish /tmp/usage.db /www/user/usage.htm /jffs/users.txt
Note : [user_file] is an optional file to match users with their MAC address
Its format is : 00:MA:CA:DD:RE:SS,username , with one entry per line
Posted: Sat Sep 20, 2014 20:49 Post subject: I made a revised (and fixed) version of the script
it has proper bandwidth calculation and name resolution.
It's simpler and less error prone.
To use it add:
Code:
while :
do
sleep 10
/jffs/wrtbwmon setup
/jffs/wrtbwmon update
/jffs/wrtbwmon publish
done
to the startup commands.
The script can be invoked via SSH too (without errors) and defaults to /tmp if output files are not specified.
OLD DB is NOT compatible and must be deleted if you use my version of the script.
# Backup usage database file
while :
do
sleep 900
cp /tmp/usage.db /mmc/usage.db
done
# If you want to run other codes below this line, use "done &" instead of just "done" on the line above
Are you saying to replace part of this with your code? Can you be specific about which part to replace?
To run your version should it look like this:
Code:
while :
do
sleep 10
/jffs/wrtbwmon setup
/jffs/wrtbwmon update
/jffs/wrtbwmon publish
done &
# Backup usage database file
while :
do
sleep 900
cp /tmp/usage.db /mmc/usage.db
done
# If you want to run other codes below this line, use "done &" instead of just "done" on the line above
My question is that your calls to wrtbwmon to update or publish don't reference any files. Should I put the same as from the first post, or is this built in to the script?
Posted: Fri Nov 28, 2014 19:41 Post subject: Re: I made a revised (and fixed) version of the script
LinoX wrote:
it has proper bandwidth calculation and name resolution.
It's simpler and less error prone.
To use it add:
Code:
while :
do
sleep 10
/jffs/wrtbwmon setup
/jffs/wrtbwmon update
/jffs/wrtbwmon publish
done
to the startup commands.
The script can be invoked via SSH too (without errors) and defaults to /tmp if output files are not specified.
OLD DB is NOT compatible and must be deleted if you use my version of the script.
Bye.
Is your new script compatable with the old script's commands? I might just build a new tar file and offer it up as a package like I did last time.
Although this time around I may just put things on github to make everyone's life easier.
Yeah I couldn't get the script to work it won't generate a usage.html file.... I'll have to debug it later.
Posted: Thu Dec 04, 2014 9:05 Post subject: Firmware: DD-WRT v24SP2-MULTI (11/04/12) std Buffalo
vortex05 wrote:
Alright I'm going to help all the newbs out.
I've given you guys an installer!
How to use?
Step 1.
Extract the zip to the root directory (or anywhere you wish) onto either:
a USB flash formatted to ext2 (recommended)
a SD card formatted on the mmc partition
a CIFS mount usually found in /tmp/mnt/smbshare on the router
Step 2.
run the installer (in this example we are in the sda1 usb storage but you can run it from anywhere you do not have to be in the same path as the installer to run this
root@router/tmp/mnt/sda1/#sh ./installer.sh
Step 3.
depending on where you have it installed you want to point to it in the gui on startup of that device for example if you are using usb storage and it automounts to /tmp/mnt/sda1/ you should set the startup script to /tmp/mnt/sda1/startup.sh
Done
Notes: You can place this on jffs storage however because I did not disable the backup job to jffs this will cause wear on your flash and is not recommended.
install.sh sets the correct permissions for the package and setups your "my page" tab it does not matter where you are install.sh looks for where it is in the file system to get the correct paths
startup.sh is portable it also is able to determine it's script directory from the script's path.
You should not move bwmon or rename it this is dependent you must update startup.sh however startup.sh will still work as long as bwmon is in the same folder it is.
MAC-PCnames.txt is setup with an example to help you along with figuring this out. You should use a Unix compatable text editor like notepad++ that understand Unix style EOL otherwise this functionality won't work.
If I have a bug please let me know I will try and update the scripts if there is an issue.
The recommended options for install is to USB storage, SD Storage or network CIFS storage. Be sure to use the automatically run script on mount for a hassle free startup and point to startup.sh
is /tmp/mnt/sda1 writeable from the FS perspective?
I may be wrong but your USB drive must be formatted in EXT* fs. At least that's how I run mine. NTFS may be fine the executable flags may not be markable on fat.
Also I'm working on a different version of this bandwidth monitor that should be more efficient (in theory).
I've noticed that having this integrated into mypage actually causes DDWRT to execute the SH script to generate the page every time which is actually pretty heavy my alternative version offloads everything to the browser as much as possible and does a few more fancy things with html css and javascript as a result.
One issue at the moment I'm facing right now is for bandwidth rates I would like to have the router be able to give me the counters when a request is made rather than the current strategy of statically logging every 10 seconds.
I'm also looking into the divide logging step I don't know if doing a divide by 1000 to convert from bytes to KB every 10 seconds is necessary and it's probably more expensive than if that was just an add.
Anyways those that are interested in tracking development the fork is taking shape on github https://github.com/vortex-5/ddwrt-bwmon I'm getting around to writing the documentation the install.sh works as before except you will have to visit http://router_url/user/bwmon.html As a cautionary point I would say this isn't quite ready for in the wild yet so there maybe bugs. There are provisions made for mobile as well so it doesn't look all funny when you get it on your mobile (another reason for no longer integrating with mypage).
Oh and to start bandwidth monitoring this time you type startup.sh it will take care of cleaning up existing processes so if you execute startup multiple times it will clean up old processes and ensure you don't accidentally start bwmon multiple times.
I haven't tar'ed it up yet as I'm field testing it to check for stability. But if you're feeling adventurous I've put it up for everyone to see.
Also I'm working on a different version of this bandwidth monitor that should be more efficient (in theory).
I've noticed that having this integrated into mypage actually causes DDWRT to execute the SH script to generate the page every time which is actually pretty heavy my alternative version offloads everything to the browser as much as possible and does a few more fancy things with html css and javascript as a result.
One issue at the moment I'm facing right now is for bandwidth rates I would like to have the router be able to give me the counters when a request is made rather than the current strategy of statically logging every 10 seconds.
I'm also looking into the divide logging step I don't know if doing a divide by 1000 to convert from bytes to KB every 10 seconds is necessary and it's probably more expensive than if that was just an add.
Anyways those that are interested in tracking development the fork is taking shape on github https://github.com/vortex-5/ddwrt-bwmon I'm getting around to writing the documentation the install.sh works as before except you will have to visit http://router_url/user/bwmon.html As a cautionary point I would say this isn't quite ready for in the wild yet so there maybe bugs. There are provisions made for mobile as well so it doesn't look all funny when you get it on your mobile (another reason for no longer integrating with mypage).
Oh and to start bandwidth monitoring this time you type startup.sh it will take care of cleaning up existing processes so if you execute startup multiple times it will clean up old processes and ensure you don't accidentally start bwmon multiple times.
I haven't tar'ed it up yet as I'm field testing it to check for stability. But if you're feeling adventurous I've put it up for everyone to see.
Hi Vortex05
i looked at your work. Looks awesome. Is it possible to run it from the router itself then using an USB stick?
Thus is a very nice script. wrtbwmon is very efficient and using it doesnt make any problems for router. I like tje modification of original script very much since watching speed usage is important too.
Unfortunately I have a problem using this script on my router:
I am using OpenWRT and i downloaded yyour script, but when i try to run it, I get "error nvram not found". since this script was modified for dd wrt maybe thats the reason.
I also downloaded and installed latest version provided by pyrovski according to this help:
https://wiki.openwrt.org/doc/howto/wrtbwmon
which works flawlessly, but the catch is it doesnt show speed (bitrate per second).
So here are my questions:
Is there anyway to use your script on openwrt 15.05.1 (chaos calmer)?
is there a way to add your speed functionality to pyrovski version?
if both are negative, are there any other solutions which give me bandwidth rate usage per ip(mac)?