LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 12-18-2004, 02:53 PM   #1
hitesh_linux
Member
 
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472

Rep: Reputation: 30
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
 
Old 12-18-2004, 08:30 PM   #2
Sepero
Member
 
Registered: Jul 2004
Location: Tampa, Florida, USA
Distribution: Ubuntu
Posts: 734
Blog Entries: 1

Rep: Reputation: 33
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.
 
Old 12-18-2004, 11:51 PM   #3
hitesh_linux
Member
 
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472

Original Poster
Rep: Reputation: 30
Thanx

right now that's only way I can check this file.

any other way to monitoring?

-/Hitesh
 
Old 12-18-2004, 11:52 PM   #4
hitesh_linux
Member
 
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472

Original Poster
Rep: Reputation: 30
Thanx

yes, that's only way I can check this file and doing right now.

any other way to monitoring?

-/Hitesh
 
Old 12-19-2004, 03:10 AM   #5
NeptunEz
Member
 
Registered: Dec 2003
Location: Russia, Moscow
Distribution: Fedora Core 4
Posts: 52

Rep: Reputation: 15
You may want to use RRD tool to get such graphs (however it's rather complex to start with)
http://neptune.homelinux.com:6060/ot...eth1-6hour.png
http://neptune.homelinux.com:6060/other/rrd/
 
Old 12-19-2004, 10:48 AM   #6
hitesh_linux
Member
 
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472

Original Poster
Rep: Reputation: 30
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
 
Old 12-19-2004, 11:00 AM   #7
NeptunEz
Member
 
Registered: Dec 2003
Location: Russia, Moscow
Distribution: Fedora Core 4
Posts: 52

Rep: Reputation: 15
http://martybugs.net/linux/rrdtool/traffic.cgi
 
Old 12-20-2004, 01:58 PM   #8
hitesh_linux
Member
 
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472

Original Poster
Rep: Reputation: 30
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
 
Old 01-05-2005, 05:09 PM   #9
rozz
LQ Newbie
 
Registered: Jan 2005
Location: Beirut - Lebanon
Distribution: Fedora
Posts: 18

Rep: Reputation: 0
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?
 
Old 01-06-2005, 12:27 AM   #10
NeptunEz
Member
 
Registered: Dec 2003
Location: Russia, Moscow
Distribution: Fedora Core 4
Posts: 52

Rep: Reputation: 15
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
 
Old 01-06-2005, 01:29 AM   #11
stutterbug
LQ Newbie
 
Registered: Dec 2004
Location: Osaka, Japan
Distribution: RedHat 8.0
Posts: 20

Rep: Reputation: 1
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;
}
 
Old 01-06-2005, 02:02 AM   #12
NeptunEz
Member
 
Registered: Dec 2003
Location: Russia, Moscow
Distribution: Fedora Core 4
Posts: 52

Rep: Reputation: 15
Re: Bandwidth checker

Quote:
(since boot?)
since last ifup
 
Old 01-26-2005, 01:12 PM   #13
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Monitoring Bandwidth RemusX2 Linux - Networking 4 10-15-2005 03:42 PM
bandwidth monitoring,,,,, apenguinlinux Linux - Software 3 01-25-2005 10:19 AM
Bandwidth Monitoring basketkase999 Linux - Software 2 01-13-2005 02:44 PM
Bandwidth monitoring vinhhv Linux - Networking 8 07-21-2003 04:12 AM
Bandwidth Monitoring allandire Linux - Networking 1 06-25-2002 06:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration