Results 1 to 14 of 14
Thread: Calculate Bandwidth Using MRTG
-
08-12-2002, 05:21 PM #1Newbie
- Join Date
- May 2002
- Location
- Ontario, Canada
- Posts
- 11
Calculate Bandwidth Using MRTG
I just created this script to calculate total bandwidth (GB) using MRTG. I haven't fully tested it and it comes with no guarantees. Your comments are appreciated
You need to edit the lines that start with $log_file and $tmp_file. The first one is the location of your MRTG log file for the interface you wish to use. The second one is just a location that the script can use for a temporary file.
Sample is here: http://216.138.206.6/test.php
Hopefully this helps someone... it should be especially useful to rackshack folks
-
08-12-2002, 06:04 PM #2Web Hosting Evangelist
- Join Date
- Nov 2000
- Posts
- 486
Such script already excisted..........
http://bjorn.swift.st/
-
08-12-2002, 06:36 PM #3Web Hosting Master
- Join Date
- Nov 2000
- Location
- San Diego
- Posts
- 3,407
I am sure someone will appriciate the free script you have put together.
-
08-12-2002, 07:00 PM #4Web Hosting Master
- Join Date
- Nov 2001
- Posts
- 852
Yes thank you for your time, why is everyone so quick to down someone?
-
08-12-2002, 07:25 PM #5Newbie
- Join Date
- May 2002
- Location
- Ontario, Canada
- Posts
- 11
I didn't know that existed
I needed this for myself and some others are always asking about something like this so I thought I would post it.
-
08-12-2002, 07:28 PM #6Disabled
- Join Date
- May 2002
- Posts
- 71
Great script, thanks M8 for taking the time to write this. Its most helpfull.
Thanks,
Brian
-
08-13-2002, 11:58 AM #7Web Hosting Master
- Join Date
- Aug 2002
- Posts
- 655
Hi,
What is MRTG?
I want to monitor bandwidth consumption by each website hosted on our server, there are hindreds of domains. We do not offer individual IPs and offer name based hosting.
Can this script achieve what i want? i.e. calculate data transfer by each website i host? I have seen many control panels offer this solution but i do not run any cp like CPANEl/Hspehere etc. but how can i still acieve this?
Thanks,
Viv
-
08-13-2002, 01:07 PM #8Web Hosting Evangelist
- Join Date
- Nov 2000
- Posts
- 486
You could use mod_watch and with that you can make mrtg graphs. Then you can make bandwidth calculations a virtualhost.
-
08-13-2002, 01:39 PM #9Web Hosting Master
- Join Date
- Aug 2002
- Posts
- 655
what is mod_watch, i understand it is an apache module, what exactly does it do? Do i need to use it in conjuctosync with MRTG?
os this can simply calculate the bandwidth usage by domain? pls let me know.
Thanks,
Vivek
-
08-13-2002, 03:04 PM #10Web Hosting Evangelist
- Join Date
- Nov 2000
- Posts
- 486
mod_watch keeps track of the bandwidth transferred a virtualhost. But it keeps logging, so it just doesn't make sense for you.
for mod_watch their is a special script that makes mrtg graphs of those transfers. And of those graphs you can calculate bandwisth as done above. Ofcourse you could also use ftp,
-
08-14-2002, 04:20 AM #11Web Hosting Master
- Join Date
- Aug 2002
- Posts
- 655
Yes, can you post the location to the script which read mod_watch log and make mrtg graphs? I want to try this.
-
08-14-2002, 04:36 AM #12Web Hosting Evangelist
- Join Date
- Nov 2000
- Posts
- 486
http://www.snert.com/Software/mod_wa...ache2mrtg.html
All scripts nesecary can be found on:
http://www.snert.com/Software/mod_watch/
-
06-28-2010, 02:48 AM #13Eternal Learner
- Join Date
- Jul 2007
- Posts
- 2,051
I know this is a very old post and there might be some changes in the script thereafter. I just found this one today and I thought I would give it a try. I uploaded the script in my monitoring server and entered the path of the mrtg file for a host in the script and gave the path of the /tmp directory in the script. When I ran the script, it copied the mrtg log file in the /tmp directory, but all I get is 0 MB for all the months in the script. Is there anything wrong with the permissions or I should wait for sometime till the data transfer is displayed.
Prashant T.
Don't run after Success. Run after Excellence and Success will soon follow.
-
06-28-2010, 04:22 AM #14Eternal Learner
- Join Date
- Jul 2007
- Posts
- 2,051
Got it. I was checking the wrong log file.
Prashant T.
Don't run after Success. Run after Excellence and Success will soon follow.