Bandwidth Accounting + Graphing and More for OpenVZ [message #1341] |
Tue, 07 February 2006 02:56 ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
phpfreak
Messages: 47 Registered: January 2006
|
Member |
|
|
Well, I found the iptables method of collecting bandwidth a bit too hands on and unforgiving. Therefore, using my mad php skills, and some bash scripting, I've whipped up an set of applications that allows you a more graphical and accurate overview using rrdtool, and some PHP scripts. You can have full bandwidth accounting for your VPS including daily, monthly and weekly tabulated data in about 5 minutes of setup time.
Here's some screen shots (full size screens are on our site):
![http://www.serverpowered.com/images/bw1_thumb.jpg](http://www.serverpowered.com/images/bw1_thumb.jpg)
![http://www.serverpowered.com/images/bw2_thumb.jpg](http://www.serverpowered.com/images/bw2_thumb.jpg)
![http://www.serverpowered.com/images/bw3_thumb.jpg](http://www.serverpowered.com/images/bw3_thumb.jpg)
The total process takes about 5 minutes to setup using the pre-created CentOS 4.2 templates that I have packaged up for you, and installing a bash script that does the collection.
The cool thing is, when you add a new VPS, the cronjob will automatically detect this and add the graphs for you. In addition, when you delete a VPS, the graphs and .rrd files will be deleted with it.
The only thing you need to install on the hostnode is the bash script and the rrdtool rpm ( or compile rrdtool from source ). The rest of the display, and web server that displays these graphs is located inside the VE that you'll create specifically for this purpose.
I just wanted to give something back to the community. Thanks for all that you are doing to help this awesome solution grow and become even more evolved ![Smile](images/smiley_icons/icon_smile.gif)
The full details are found at ServerPowered.com, our server website: http://www.serverpowered.com/openvz-bandwidth-accounting.php
Please direct any discussions here, and not on our server company's website I'll subscribe to this and help you out if you need it.
Enjoy!
Eric Rosebrock
http://www.serverpowered.com
http://www.hybodus.com
http://www.linuxforum.com
http://www.phpfreaks.com
[Updated on: Tue, 07 February 2006 03:14] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Bandwidth Accounting + Graphing and More for OpenVZ [message #37737 is a reply to message #1341] |
Thu, 15 October 2009 09:33 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
dvazart
Messages: 37 Registered: October 2008 Location: France
|
Member |
|
|
Hi !!
I just update this excellent script for Debian Lenny x64 on both (HN and CT) and with the 1.3.1 version of rrdtool, I also did some minor changes in the script.
Here is a little HOWTO implement it :
1. You must have installed Debian Lenny x64 + OpenVZ + rrdtool on your HN.
2. Download and create a container using this template:
wget http://www.vazart.net/openvz/Debian-Lenny-x64_bandwidth.tar.gz
mv Debian-Lenny-x64_bandwidth.tar.gz /vz/template/cache/
vzctl create 101 --ostemplate debian-5.0-x86_64 --config ve-vps.basic --hostname graphs.yourdomain.com --ipadd xxx.xxx.xxx.xxx --name graphs
vzctl set 101 --onboot yes --nameserver xxx.xxx.xxx.xxx --userpasswd root:xxxxxxx --save
vzctl start 101
You can errase my old rrd data:
vzctl exec 101 rm /home/bandwidth/*
3. Download the script (Bash) to collecting data:
wget http://www.vazart.net/openvz/bandwidth.sh
You can open it and change the container number in the BWVE variable.
4. You can make an crontab to run this script every 5 min:
*/5 * * * * root /root/bandwidth.sh 1>/var/log/vz-bandwidth.log 2>&1
5. Wait 5 min then visit: http://xxx.xxx.xxx.xxx/ and happy graphing !
I hope it's useful!
----------- Daniel Vazart ------------
"Knowledge is power, Sharing is human"
------- http://www.vazart.net --------
|
|
|
|
|
|
|
|