Page 1 of 1

Stream Statistics

Posted: 02 Dec 2011 13:12
by dragon_maximadriver
Hi,

I was just wondering if there is any way possible to view statistics while running a streaming audio server such as number of listeners, bandwidth used, etc, but the main thing is number of listeners/connections.

Thanks

Re: Stream Statistics

Posted: 23 Dec 2011 15:40
by kdh
As far as I know.. no.

If you are running linux, and you know the port your stream is running on, you can do this:

ss -a | grep -c PORT

Obviously PORT is the port your stream is running on. Make sure the port number you chose isn't defined in /etc/services other wise the friendly name or PORT will pop up in your SS output.

run ss -a from command line to see what i mean.

For bandwidth.. Look into "ntop".. its a really sweet bandwidth monitoring tool for linux with a really slick web front end.

if you are running windows.. well.. you are screwed.

Re: Stream Statistics

Posted: 23 Dec 2011 19:51
by dragon_maximadriver
Ah, thanks for the info, very helpful. I don't know why I didn't think of using a network command with grep myself.
Anyway, just for the record, so people know how I used this to monitor connections in realtime, here's a script I wrote that is very useful which utilizes this using a loop that updates every 10 seconds.

while [ 1 ]; do clear; echo "Name of Stream Listeners";
ss -a | grep serversLANIP:port | grep -v LISTEN;
echo;
echo "Number of connections";
ss -a | grep -v LISTEN | grep -c serverLANIP:port; sleep 10;
done