Shoutcast Bandwidth Tally

OxnardMontalvo

Verified User
Joined
Dec 13, 2004
Messages
119
Location
Nashville, TN
Ok, this is v.10 of my Shoutcast bandwidth tally program. It works like this:

1) Spin through all of the domains on the server and finds the ones with a content directory.

2) Read the /var/log/sc_serv.log file and make an array of all the files served for each domain.

3) Find the size of each file served.

4) Compute total bandwidth used for each domain (file size * hits)

5) Update each domain's bandwidth.tally with the number.

I run it in my logrotate script, you can also run it as a cron job. Make sure you only run it once per log file as it does not remove anything from the log file so it you run it twice, you'll tally the bandwidth twice.

Feedback is welcome.

=C=

p.s. standard disclaimers apply. Use at your own risk.
 

Attachments

  • countbandwidth.tar.gz
    2.4 KB · Views: 546
Hi,

Nice script

this script i's that for on-demand or livestreaming?

It's not working
 
This script takes the bandwidth used and adds it to DA's totals. I'm sure you could modify it to send you an email , populate a database or whatever to make it where you can actually see the bandwidth used. but that's not the point of it's current version.

=C=
 
thanks, just another question, this script in what bandwith count put it?

so.. i dont understand.. i've to create a directadmin user and use for shoutcast or if a create an user by ssh it count as admin?
 
I have a shoutcast service running on my server in 'on-demand' mode only. (No live streaming)

Each domain gets a /content directory where they can place mp3 files for streaming.

This script goes through the Shoutcast log file and computes the bandwidth used by each domain every night. Then it puts the total in DA's bandwidth tally so that I can keep track of it and it will suspend domains that go over their limit.

You have to setup Shoutcast just right and make some slight changes to the defaults in DA to get it working right.

I published the script so that others could set theirs up this way if they so chose.

=C=
 
well lets bump this topic.

Does anyone yet found out how to count the bandwith with live streaming?
 
Back
Top