OpenVZ Forum


Home » General » HowTo » Bandwidth Accounting + Graphing and More for OpenVZ
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 messageGo to previous message
dvazart is currently offline  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.
apt-get install rrdtool


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:
crontab -e

*/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 --------
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to write a description in a custom OpenVZ template?
Goto Forum:
  


Current Time: Mon Nov 11 12:09:38 GMT 2024

Total time taken to generate the page: 0.03502 seconds