Linux - Software This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
12-18-2004, 03:53 PM
|
#1
|
Member
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472
Rep:
|
bandwidth monitoring file !!
Hi,
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".
Please help...
-/Hitesh
|
|
|
12-18-2004, 09:30 PM
|
#2
|
Member
Registered: Jul 2004
Location: Tampa, Florida, USA
Distribution: Ubuntu
Posts: 734
Rep:
|
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.
|
|
|
12-19-2004, 12:51 AM
|
#3
|
Member
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472
Original Poster
Rep:
|
Thanx
right now that's only way I can check this file.
any other way to monitoring?
-/Hitesh
|
|
|
12-19-2004, 12:52 AM
|
#4
|
Member
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472
Original Poster
Rep:
|
Thanx
yes, that's only way I can check this file and doing right now.
any other way to monitoring?
-/Hitesh
|
|
|
12-19-2004, 04:10 AM
|
#5
|
Member
Registered: Dec 2003
Location: Russia, Moscow
Distribution: Fedora Core 4
Posts: 52
Rep:
|
|
|
|
12-19-2004, 11:48 AM
|
#6
|
Member
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472
Original Poster
Rep:
|
Thnax NeptunEz,
I have downloaded and sucussfully install rrdtool. I have READ the README file.
there are three steps to do this.
1) configure
2) make
3) make install
All , i have done and it;s went fine.
NOW, the questions is how to start this package , where should I check, is there any thing i need to give in web browser?
up this gose FINE, now do not know what to do???????
Please help me, I am now on middel way...
-/Hitesh
|
|
|
12-19-2004, 12:00 PM
|
#7
|
Member
Registered: Dec 2003
Location: Russia, Moscow
Distribution: Fedora Core 4
Posts: 52
Rep:
|
|
|
|
12-20-2004, 02:58 PM
|
#8
|
Member
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472
Original Poster
Rep:
|
NeptunEz
thanx again for the good link..
I have try to setup .pl script, but got following error.
[root@domain bin]# /usr/local/bin/rrd_traffic.pl
Can't locate RRDs.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at /usr/local/bin/rrd_traffic.pl line 8.
BEGIN failed--compilation aborted at /usr/local/bin/rrd_traffic.pl line 8.
[root@domain bin]#
I have followed all the require steps mention under rrd_traffic.pl file. please visit the link at, http://martybugs.net/linux/rrdtool/traffic.cgi
how to complie this script?
thanx again 4 your help.
-/Hitesh
|
|
|
01-05-2005, 06:09 PM
|
#9
|
LQ Newbie
Registered: Jan 2005
Location: Beirut - Lebanon
Distribution: Fedora
Posts: 18
Rep:
|
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.
those smileys suck. where is the thumbs up?
|
|
|
01-06-2005, 01:27 AM
|
#10
|
Member
Registered: Dec 2003
Location: Russia, Moscow
Distribution: Fedora Core 4
Posts: 52
Rep:
|
Well. Any rrd files has a fixed size depending on its type. For example i've got only large cpu-file (it is monitored every minute).
[neptune@neptune ~]$ ll /var/lib/rrd/
èòîãî 11896
-rw-r--r-- 1 root root 56708 ßíâ 6 09:20 board.rrd
-rw-r--r-- 1 root root 11616332 ßíâ 6 09:20 cpuload.rrd
-rw-r--r-- 1 root root 56708 ßíâ 6 09:20 eth0.rrd
-rw-r--r-- 1 root root 56708 ßíâ 6 09:20 eth1.rrd
-rw-r--r-- 1 root root 56708 ßíâ 6 09:20 hdd.rrd
-rw-r--r-- 1 root root 84780 ßíâ 6 09:20 homa.rrd
-rw-r--r-- 1 root root 28636 ßíâ 6 09:02 weather-barr.rrd
-rw-r--r-- 1 root root 28636 ßíâ 6 09:02 weather-hmid.rrd
-rw-r--r-- 1 root root 84780 Íîÿ 17 13:39 weather.rrd
-rw-r--r-- 1 root root 56708 ßíâ 6 09:02 weather-temp.rrd
hitesh_linux, you need an RRDs perl module for script to work
$ locate RRDs.pm
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/RRDs.pm
|
|
|
01-06-2005, 02:29 AM
|
#11
|
LQ Newbie
Registered: Dec 2004
Location: Osaka, Japan
Distribution: RedHat 8.0
Posts: 20
Rep:
|
Bandwidth checker
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;
}
|
|
|
01-06-2005, 03:02 AM
|
#12
|
Member
Registered: Dec 2003
Location: Russia, Moscow
Distribution: Fedora Core 4
Posts: 52
Rep:
|
Re: Bandwidth checker
|
|
|
01-26-2005, 02:12 PM
|
#13
|
LQ Guru
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522
Rep:
|
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
regards
|
|
|
All times are GMT -5. The time now is 11:59 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|