![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | normal_restart | 2002-10-27 12:56 | 501 | |
![]() | total_restart | 2002-11-10 10:04 | 604 | |
![]() | Makefile | 2002-07-08 13:42 | 761 | |
![]() | bwbar_config | 2007-10-05 15:10 | 2.5K | |
![]() | bwbar.c | 2006-05-23 06:20 | 11K | |
![]() | bwbar | 2006-05-23 06:20 | 14K | |
This modified version of the program was created by
Brian Towne. The modified version is
available at:
http://www.mythica.org/bwbar/.
2. From your shell, type the following command:
3. Point your web browser to the location of the bandwidth directory on your web site (This is dependent on what you entered in the bwbar_config file).
That's it!
Then add the following line:
(Change "PATH_TO" to the path to your bwbar/ directory, of course.)
This will run total_restart automatically on the first minute of the first day of each month.
total_restart and normal_restart MUST be run from WITHIN the bwbar directory as they use non-absolute locations to make configuration easier.
Then add the following line:
We use these values for our calculations:
The first value is widely accepted; the second value, however, is a source of great dispute. Because the SI prefix kilo means 10^3 (1000) and NOT 2^10 (1024), I feel that we are being correct in our calculations.
Also note that the 'k' in the abbreviation for kilobytes is in lower-case, while the 'M' in the abbreviation for megabits is in upper-case. This is also correct: the SI prefix 'k' is always lower-case, while larger prefixes are upper-case: M, G, T, etc.
References:
This program is released under the GPL. See the bwbar.c file for details.
I'd like to request that people NOT remove the "This program is generated by bwbar." line from their output. There's obviously nothing that I can do if you do decide to remove the line, but I'd appreciate it if people would at least preserve the link to http://www.mythica.org/bwbar/ so that other people who are interested can find and download the program for themselves. Thanks.
bwbar 1.0 by H. Peter Anvinhttp://www.kernel.org/pub/software/web/bwbar/ ftp://ftp.kernel.org/pub/software/web/bwbar/ bwbar is a small program that generates a text and a graphical readout of the current bandwidth use. It is currently for Linux only. It is used, among others, at http://www.kernel.org/. To set it up, create a script that contains the following commands: #!/bin/sh - cd /home/httpd/html/ubar bwbar eth0 1.5 & ... assuming you are connected to the Internet via the interface "eth0", you are on a 1.5 Mbit/s link, and you want the output files in the directory /home/httpd/html/ubar. This will create two files named "ubar.txt", a text fragment, and a PNG graphic named "ubar.png". These can be included in an SHTML web page using the following commands (or something like it): In a PHP web page, you would instead do:
![]()
Some aspects of the bwbar command can be customized with options. The bwbar command has the following full usage description: Usage: bwbar [options] interface max_mbps Options: (defaults in parenthesis) --input -i Measure input bandwidth --output -o Measure output bandwidth (default) --text-file
![]()
-f The name of the text output file (ubar.txt) --png-file -g The name of the graphical bar file (ubar.png) --interval -t The poll interval in seconds (15) --width -x Width of the graphical bar (600) --height -y Height of the graphical bar (4) --border -b Border width of the graphical bar (1)