Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have enable Bandwidth Monitoring option under "webmin" with localhost:10000/, but atfer enabling i get followinng messages.
Bandwidth Monitoring :
----------------------------------
No traffic has been summarized by this module yet. If you have just set it up, it may take at least one hour for traffic to be processed.
"Turn Off Monitoring"(it's a button) Click this button to remove the firewall rules, syslog configuration and Cron job used for bandwidth monitoring. All existing collected data will remain untouched.
-----------------------------------
I have checked bandwidth file under /var/log as under.
[root@domain log]# ls -l
total 46012
-rw------- 1 root root 44116313 Dec 19 01:22 bandwidth
-rw------- 1 root root 161246 Dec 19 00:49 boot.log
-rw------- 1 root root 87541 Dec 19 01:20 cron
So i think it creating/maintiaining bandwidth in above file.
How do i check this file using GUI base? is there any GUI tool so it use this file and display in "Graphical".
You could probably open it in a text editor like gedit. If you open a terminal and type `tail -f /var/log/bandwidth`, it'll print any new additions to the file automagically.
just watch out: i enabled this feature on webmin on my router PC and forgot about it.
About a week or two later, it still displays the same message, but in the meantime the "bandwidth" file has grown to 1gigabyte!
So check your bandwidth file and add it to "log rotation" in webmin it you dont want it to eat all your disk space (use df to check free space).
I have worked once in RRDtool in php. I'd say it would take me up to 10 hours to write a nice, presentable and practical PHP script to graph bandwidth usage as you described. I'm not a very fast coder. someone else could maybe do it in a couple of hours.
If you are looking for blunt bandwidth information, you can just track the contents of /proc/net/dev. It contains the total bytes sent and received (since boot?) I had to come up with something fast a couple days ago and I so I wrote this short Perl script to do the job for me. The thing is junk but it does the job. Just create a file called monitorBandwidth.pl (or anything else you want), paste the contents below into it and run it from a command line as 'perl monitorBandwidth.pl'. If you want, you can write it to a log file as 'perl monitorBandwidth.pl > bandwidth.log' (or anything else you want). As you can see, it requires Time and POSIX, but that usually comes with the standard Perl install. I hope this helps.
Code:
#! /usr/bin/perl
use Time::HiRes qw(gettimeofday);
use POSIX ("floor");
sub getBandwidth {
$output = `cat /proc/net/dev`;
$output =~ /\s*eth0:\s*(\d+)\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+\d+(\s+\d+)/gm;
return ($1,$2);
}
@lastReading = (0,0,0);
$iterations = 1000; // Change this to the number of readings you want to capture.
while ($iterations-- gt 0) {
@bandwidth = getBandwidth();
($epochseconds, $microseconds) = gettimeofday;
$time = $epochseconds + $microseconds / 100000;
$interval = ($time - @lastReading[2]);
print "in: " . floor((@bandwidth[0] - @lastReading[0]) / $interval) . " out: " . floor((@bandwidth[1] - @lastReading[1]) / $interval) . "\r\n";
@lastReading = (@bandwidth[0], @bandwidth[1], $time);
sleep 2;
}
i just found this today
if u use firefox then u can install this small extension which will test ur bandwidth
the extension is called banndwidth tester 0.4.1
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.