| View previous topic :: View next topic |
| Author |
Message |
Anonymous Guest
|
Posted: Tue Sep 05, 2006 10:18 am Post subject: Mountpoint Statistics |
|
|
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
|
Posted: Wed Sep 06, 2006 6:29 pm Post subject: |
|
|
Anyone to reply? Thanks  |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Sep 06, 2006 6:37 pm Post subject: |
|
|
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 |
|
 |
Anonymous Guest
|
Posted: Thu Sep 07, 2006 7:19 am Post subject: |
|
|
Ok Thanks. Any idea how to write the xsl ? A site for help?
Thanks |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Sep 07, 2006 1:31 pm Post subject: |
|
|
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 |
|
 |
Anonymous Guest
|
Posted: Thu Sep 07, 2006 8:09 pm Post subject: |
|
|
I looked the status.xml, but I don't understand how to make it.
If someone has it, reply it.. Thanks ) |
|
| Back to top |
|
 |
bbk

Joined: 15 Oct 2005 Posts: 79
|
Posted: Sat Sep 09, 2006 6:02 pm Post subject: |
|
|
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
::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 |
|
 |
Anonymous Guest
|
Posted: Tue Sep 12, 2006 8:09 am Post subject: |
|
|
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
|
Posted: Wed Sep 27, 2006 4:18 pm Post subject: /icestats own .xsl on a different server |
|
|
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 |
|
 |
Anonymous Guest
|
Posted: Thu Oct 12, 2006 7:18 am Post subject: |
|
|
Please help with the above question...
Thanks! Anyone who knows? |
|
| Back to top |
|
 |
bbk

Joined: 15 Oct 2005 Posts: 79
|
Posted: Tue Jan 09, 2007 3:16 pm Post subject: statistic without admin rights... |
|
|
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 |
|
 |
Anonymous Guest
|
Posted: Sat Feb 03, 2007 2:15 am Post subject: |
|
|
Ooh.. now that is useful  |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Tue Feb 13, 2007 8:56 am Post subject: |
|
|
Thanks man
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
Thanks again brothers  |
|
| Back to top |
|
 |
|