View Full Version : newb question about bandwidth
Project9
2003-08-10, 21:10 PM
We have a few game servers and voice servers running. I cant find where to check our bandwidth usage?
Can someone help me out. We are on Ensim Redhat 8
OOagent137
2003-08-11, 01:36 AM
Well, I have a script for Plesk....but that doesn't help. I'm sure there is one for your control panel.
Also, I think you can e-mail SB and they will tell you. That works if it's just a one time thing you need.
Project9
2003-08-11, 08:59 AM
I kinda thought there was no simple way of keeping track.
I'll call them today. Thanks though.
Any other ideas anyone?
Just a point in the right direction is all I need.
knightfoo
2003-08-11, 22:00 PM
Game servers normally don't use too much bandwidth, but there are ways to track it. If you know the protocol and port that a server is running on you can create an iptables rule to track how many packets and bytes are sent from your server. For example, I have a service that runs on port 9999 and uses tcp for connections. I would create the following rule:
# iptables -A OUTPUT -p tcp --dport 9999 -j ACCEPT
# iptables -L OUTPUT -n -v
Chain OUTPUT (policy ACCEPT 132K packets, 9781K bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:9999
The first two columns are packets and bytes sent. Right now they are 0 because there hasn't been any traffic. Now generate some traffic and check the count again:
# iptables -L OUTPUT -n -v
Chain OUTPUT (policy ACCEPT 132K packets, 9781K bytes)
pkts bytes target prot opt in out source destination
1 60 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:9999
This means that 1 packet was sent, for a total of 60 bytes.
You can use a script to check the output every few minutes and zero the counters (iptables -Z). This is similar to the way MRTG is used to track bandwidth usage on switches. You could actually hack around MRTG and get it to print out graphs for you, using the information gathered from iptables.
-knightfoo
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.