Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mountpoint Statistics

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Tue Sep 05, 2006 10:18 am    Post subject: Mountpoint Statistics Reply with quote

Hello!
I want to ask If I can grab statistics (or only the Online & Peak Listeners) from Only ONE specific Mountpoint without admin access.
e.g
If you have an icecast server, If you go to the page: http://host:port like http://myserver:8000 you will get all the Mountpoint statistics without admin login. I want to take Only One mounpoint statistics like /mystream.ogg.
Or is some php script that can access without admin pass the statistics of a specific mountpoint? Like online listeners etc

Thanks!
Back to top
Anonymous
Guest





PostPosted: Wed Sep 06, 2006 6:29 pm    Post subject: Reply with quote

Anyone to reply? Thanks Laughing
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Sep 06, 2006 6:37 pm    Post subject: Reply with quote

Those 2 stats are not hidden stats, so the webroot pages can see them. Just write your own xsl to display just those for the mountpoint you want.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Thu Sep 07, 2006 7:19 am    Post subject: Reply with quote

Ok Thanks. Any idea how to write the xsl ? A site for help?

Thanks
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Thu Sep 07, 2006 1:31 pm    Post subject: Reply with quote

look at the status.xsl as an example, that provides the constructs needed for what you are talking about. The xslt specification is on the w3c site.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Thu Sep 07, 2006 8:09 pm    Post subject: Reply with quote

I looked the status.xml, but I don't understand how to make it.
If someone has it, reply it.. Thanks Smile)
Back to top
bbk



Joined: 15 Oct 2005
Posts: 79

PostPosted: Sat Sep 09, 2006 6:02 pm    Post subject: Reply with quote

Hello

Maybe my post can help you further:

http://forum.icecast.org/viewtopic.php?t=268&highlight=

On the cacti forum I posted the script which is actually a php script to read from the stauts.xsl file....

you are free to change it to your needs... or give me some hints for changements Wink

::hope it helps::
_________________
::bbk::

http://audioasyl.net


Last edited by bbk on Wed Sep 27, 2006 4:07 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Anonymous
Guest





PostPosted: Tue Sep 12, 2006 8:09 am    Post subject: Reply with quote

hello thanks for the link. One answer...again
I don't have admin access @ the Icecast server
The http://ip:8000/status.xsl are visible to anyone
Can I have my mounpoint stats without the administrator's password?
Back to top
bbk



Joined: 15 Oct 2005
Posts: 79

PostPosted: Wed Sep 27, 2006 4:18 pm    Post subject: /icestats own .xsl on a different server Reply with quote

hello

does someone know why or how i can't access the /icestats from an external webserver with a script like the following?

Code:

<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output method="text" indent="yes" />
<xsl:template match = "/icestats" >

<xsl:for-each select="source[@mount='/whatever_mountpoint']">
<!--<xsl:for-each select="source">-->

<xsl:if test="listeners">
<xsl:value-of select="listeners" />
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


thank you kindly for a hint.
_________________
::bbk::

http://audioasyl.net
Back to top
View user's profile Send private message Visit poster's website
Anonymous
Guest





PostPosted: Thu Oct 12, 2006 7:18 am    Post subject: Reply with quote

Please help with the above question...
Thanks! Anyone who knows?
Back to top
bbk



Joined: 15 Oct 2005
Posts: 79

PostPosted: Tue Jan 09, 2007 3:16 pm    Post subject: statistic without admin rights... Reply with quote

here you go...

with this script you can read out the statistic without a password.

it will work till there is a change in the stats2.xsl because this is the source..

Code:

<?php

//$ip              = $_SERVER["argv"][1];
//$port            = $_SERVER["argv"][2];
//$user_mountpoint = $_SERVER["argv"][3];

$ip              = "your_server";
$port            = "your_port";
$user_mountpoint = "your_mountpoint_with_/";

////////////////start the parsin action\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

//opening socket

$fp = fsockopen("$ip", $port, $errno, $errstr, 30); //open connection

if(!$fp) {
   die('Error while connecting to Server.');
}

else {
 $data = '';
 stream_set_blocking($fp, false);
 fputs($fp,"GET /status2.xsl HTTP/1.0\r\nUser-Agent: Icecast2 XSL Parser (Mozilla Compatible)\r\n\r\n"); //get status2.xsl

 while(!feof($fp)) {

    $data .= fgets($fp, 1000);

 }

 fclose($fp); //close connection

 $data = ereg_replace(".*<pre>", "", $data); //extract data
 $data = ereg_replace("</pre>.*", ",", $data); //extract data

 $numbers = explode(",",$data); //bomb it and extract data

//anzahl mountpoints berechnen und listeners in array setzen

$summe_inc = count($numbers); //summe aller im array vorhandenen daten
$summe_komma = $summe_inc - 2; //von der summe 2 unnoetige kommastellen entfernt
$summe_exkl = $summe_komma - 11; //von der summe 11 unuetze beschreibungen entfernt

$anz_mountpoints = $summe_exkl / 6; //anzahl der vorhandenen mountpoints ermitteln

//id der mountpoints in ein array abfuellen
$id = array();
for ($i=11; $i<$summe_komma; $i=$i+6) { //id der mountpoints ermitteln
$id[]=$i;
}

//id der anzahl listeners der mountpoints in ein array abfuellen
$s_listeners = array();
for ($i=14; $i<$summe_komma; $i=$i+6) { //anzahl listeners ermitteln
$s_listeners[]=$i;
}

//array mit den listeners abfuellen
$arr_listeners = array();
foreach ($s_listeners as $key => $value) {
$arr_listeners["$key"] = $numbers[$value];
}

//array mit den mountpoint bezeichnungen erstellen
$arr_result = array();
foreach ($id as $key => $value) {
$arr_result["$numbers[$value]"] = $arr_listeners[$key];
}

//Ausgabe - Output
print $user_mountpoint. ' = ' .$arr_result[$user_mountpoint]. '<br><br>'; //userdefined mountpoint value
foreach ($arr_result as $key => $value) { //every mountpoint with value
print $key. ' = ' .$value. '<br>';
}
print '<br>';
print 'Summary = ' .array_sum($arr_result); //every mountpoint summary
} //ende if success

?>


it is a quick'n dirty one night scripting... collecting... and reading.. but it's enough for me....

i already did a integration into cacti ( http://www.cacti.net ) but i didn't posted this new version already... this will come soon....
_________________
::bbk::

http://audioasyl.net
Back to top
View user's profile Send private message Visit poster's website
Anonymous
Guest





PostPosted: Sat Feb 03, 2007 2:15 am    Post subject: Reply with quote

Ooh.. now that is useful Smile
Back to top
Anonymous
Guest





PostPosted: Tue Feb 13, 2007 8:56 am    Post subject: Reply with quote

Thanks man Wink

It's very usefull. Can anyone -who knows php- tell me what to modify to get and the peak listeners? or the track that curently is streaming?

I don't know php Sad

Thanks again brothers Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber