karlheyes / icecast-kh

KH branch of icecast
GNU General Public License v2.0
298 stars 106 forks source link

where are the files /json.xsl and /stats-json.xsl? #294

Open rcasunshare opened 4 years ago

rcasunshare commented 4 years ago

Hello, where are the files /json.xsl and /stats-json.xsl? Because I can't find them. Thank you

karlheyes commented 4 years ago

if you are referring to files in the xiph tree then you should be able to copy them from there. As xsl files you can drop them in webroot and go ahead. If they are wanted more generally then they could be distributed.

karl.

peppi001 commented 3 years ago

I copied the status-json.xsl to the web directory. If I open it with browser, always ask which program to be open with. If I select Firefox, the page is opened and I see the data. But the headers are missing. I want to monitor listeners with netdata, but not working. I think the problem is the missing headers.

Peppi

image image

Roki100 commented 3 years ago

I copied the status-json.xsl to the web directory. If I open it with browser, always ask which program to be open with. If I select Firefox, the page is opened and I see the data. But the headers are missing. I want to monitor listeners with netdata, but not working. I think the problem is the missing headers.

Peppi

hello, i've encountered same problem today while trying to add my instance to netdata, so i did a temporary fix by proxying the request with this simple js script i wrote:

const express = require('express');
const http = require('http');
const xec = require('child_process').exec;

function exec(cmd, cb) {
    xec(cmd, function(error, stdout, stderr) { cb(stdout); });
}

let app = express();
let server = http.createServer(app);

app.get('/', async (req, res) => {
    exec('curl http://127.0.0.1:6969/status-json.xsl --connect-timeout 10', output => { 
        if(!output.startsWith('{"icestats":')) return; //silence non-body curl reponses
        console.log(output);
        res.type('json').end(output); 
    });
});

server.listen(6970, 'localhost');

it works, (i've set localhost:6970 as source in netdata config) like this

localserver:
  name : 'localserver'
  url  : 'http://localhost:6970'

image all it requires to run is:

peppi001 commented 3 years ago

Hello Roki100, thank you. Your solution works perfectly for me.