Page 1 of 1

Statistics and monitoring playback

Posted: 16 Nov 2008 20:30
by hapua64
Is there a way to read any of the statistics from the "Stream" tab of the "Media Information" dialog over the network?

I need a reliable way to monitor playback on a remote machine, and I thought I might be able to poll one of the stream statistics every few minutes, and raise an alarm if it were zero.

Grateful for any other monitoring ideas people might have.

Re: Statistics and monitoring playback

Posted: 17 Nov 2008 00:31
by Jean-Baptiste Kempf
Yes, run the RC interface.

Re: Statistics and monitoring playback

Posted: 14 Dec 2008 00:42
by Lorni
For windows I parse 'netstat -n'

Here is PHP code:

Code: Select all

<?php function netstat($ipaddr,$port,$show=0,$protocol="TCP") { $shell_info=shell_exec("%SYSTEMROOT%\\system32\\netstat.exe -n"); $tmp=explode("\n",$shell_info); $count=0; for ($i=4;$i<count($tmp)-1;$i++) { $line=$tmp[$i]; ereg (" +([A-Z]+) +([0-9,.]+):([0-9]+) +([0-9,.]+):([0-9]+) +([A-Z]+)", $line, $regs); if ($regs[6]!="ESTABLISHED") continue; if ($regs[1]!=$protocol) continue; if ($ipaddr&&$regs[2]!=$ipaddr) continue; if ($port&&$regs[3]!=$port) continue; ++$count; if ($show) echo $regs[4]./*":".$regs[5].*/"<br>"; } return $count; } ?>
So if you stream to 'UDP://192.168.0.1:1234' try this:
$n=netstat('192.168.0.1',1234,0,'UDP');
or if you want to output ip-list:
$n=netstat('192.168.0.1',1234,1,'UDP');
where $n is count of listeners.
Use default TCP for http or mmsh streaming:
$n=netstat('192.168.0.1',1234);