How I can create a PHP script to see these statistics without authentication bypass?
Hi, Thanks for the reply,
I’m trying to create an interface to display real time statistics to my client, I can not disable authentication and tried with different authentication methods of PHP like Curl, HttpRequest, file_get_contents and simplexml_load_file, but always returns this error:
“failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized in …”
I do not know why my authentication is not validated…
For example, I trying with:<?php $page = file_get_contents('http://myuser:mypassword@myservername:myport/connectioncounts'); echo $page; ?>
Thanks for the prompt response,
I am using port 8086.
I have not even changed the file VHost.xml.
However through my browser I can to access the statistics using the URL:
Thanks for your help…
For your method to work, you have to change the /conf/VHost.xml HTTProvider /AuthenticationMethod from “admin-digest” to “admin-basic” or “none”
<HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPConnectionCountsXML</BaseClass> <RequestFilters>connectioncounts*</RequestFilters> <AuthenticationMethod>admin-basic</AuthenticationMethod> </HTTPProvider>
Then restart Wowza.
I am having trouble calling [ip]:8086/connectioncounts from any web application. I am able to call it from a browser without an issue.
I have tried the php example and a coldfusion example still I am not able to call the xml file. I can however I can call [ip]:1935/clientaccesspolicy.xml without a problem.
I am on an EC2 machine and have port 8086 and 1935 configured the same way. Any help would be appreciated. Thanks.
Probably because clientaccesspolicy doesn’t require authentication. Where you able to turn off authentication so you can access connection counts without the password prompt? Remember, if you put in your credentials in your browser one time, it doesn’t ask you again until you restart Wowza.
I posted a Perl script here to get connectioncounts: http://www.wowza.com/forums/showthread.php?15165-get-connectioncounts-from-perl-for-accumulation
Thanks for the reply. I have conf/vhost.xml set as below
<HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPConnectionCountsXML</BaseClass> <RequestFilters>connectioncounts*</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider>
and can confirm from multiple devices that from the browser i do not have to input username and password to access.
I have tried the php, perl and coldfusion code and the response I get is timeouts of (php)“Maximum execution time of 45 seconds exceeded” and (cf)“Connection Failure”
I feel like I am missing something fundamental here but cannot figure it out. Thanks for the help.
Come to find out my host was blocking port 8086. So I changed the port in vhost and now all is well.
Need help trying to return Stats for a single application under 1 VHOST
Here’s a step by step process to get stats with basic authentication WITH php code to answer the original question:
In your wowza install in conf/Vhost.xml change the values of admin-digest to admin-basic for whatever HTTPProvider you want to authenticate for. I changed them all to “basic” because I need to report for everything available.
Use this PHP code to test for your server