如何通过用户ip从Icecast服务器获得带宽消耗?

everybody, I'm working on a personnal project, and I want to know the bandwitdh usage for each IP(user) connected to my server.

I want to do something like this :

IP                PORT       BandWidth       Quota       Connection_time
192.168.1.10       8000       988,478 Gb      1,000 Gb    720:01:20.956
192.168.1.12       8001       98,478 Gb       1,000 Gb    01:01:20.956
192.168.1.216      8003       9,784 Gb        1,000 Gb    00:59:25.545

Do you have an idea ?


I have many Icecast (webradio streams) on my server, and I want to know the consumption of each listeners of each radio

My main focus, is to display the bandwidth consumption of the user on its profile, and too to check if he has reached his quota or not.

I'd recommend parsing the Icecast access.log as it both logs the volume and duration of a connection.

You can also use the URL-authentication hooks to log things.