Collector

    This utility allows you to receive and work with monitoring data sent by Astra

    Install

    wget http://cesbo.com/download/astra/scripts/collector -O /usr/bin/collector
    chmod +x /usr/bin/collector
    

    Run

    Run in console :

    collector
    

    Run in background:

    collector &
    

    After launch - the web interface will be available on port 3180

    Astra settings

    Go to settings->general and in the monitoring string configure sending data to the collector:
    Example: http://127.0.0.1:3180/astra/#interval=60&total=1 Save the settings and restart Astra

    Routes:

    /channels/ getting information about streams
    /channel/{channelId} - getting information about stream
    /cfg_channels/ - displays the configuration of the streams

    /dvbs/ getting information about dvb adapters
    /dvb/{dvbId} - getting information about dvb adapter
    /cfg_dvbs/ - displays the configuration of the dvb adapters

    Examples of requests and information:

    http://testserver.com:3180/channels/

    {
    "a002": {"channel_id": "a002", "pes_error": 0, "count": 1, "input_id": 1, "timestamp": 1562149397, "onair": true,
    "cc_error": 0, "scrambled": false, "bitrate": 784},
    "a003": {"channel_id": "a003", "pes_error": 0, "count": 1, "input_id": 1, "timestamp": 1562149409, "onair": true, "cc_error": 0, "scrambled": false, "bitrate": 1578}
    }
    

    http://testserver.com:3180/channel/a002

    {
    "channel_id": "a002", "pes_error": 0, "count": 60, "input_id": 1, "timestamp": 1562149233, "onair": true, "cc_error": 0, "scrambled": false, "bitrate": 3017
    }
    

    http://testserver.com:3180/cfg_channels/

    {
    "a002": {"timestamp": 1562149396, "hostname": "test-server", "channel": {"name": "Channel Name", "input": ["dvb://a001#pnr=101"], "http_keep_active": "-1", "type": "spts", "enable": true, "id": "a002"}}
    "a003": {"timestamp": 1562149408, "hostname": "test-server", "channel": {"name": "Channel 2", "input": ["dvb://a001#pnr=102"], "http_keep_active": "-1", "type": "spts", "enable": true, "id": "a003"}}
    }
    

    http://testserver.com:3180/dvbs/

    {
    "a001": {"count": 60, "snr": 435, "dvb_id": "a001", "signal": 90, "timestamp": 1562149518, "unc": 0, "status": 31, "ber": 0}, 
    "a002": {"count": 60, "snr": 442, "dvb_id": "a002", "signal": 93, "timestamp": 1562149520, "unc": 0, "status": 31, "ber": 0}
    }
    

    http://testserver.com:3180/dvb/a001

    {
    "count": 60, "snr": 433, "dvb_id": "a001", "signal": 90, "timestamp": 1562149638, "unc": 0, "status": 31, "ber": 0
    }
    

    http://testserver.com:3180/cfg_dvbs/

    {
    "a001": {"timestamp": 1562149396, "hostname": "test-server", "dvb": {"frequency": "378", "symbolrate": "6875", "name": "Adapter", "id": "a001", "adapter": 1, "device": 0, "modulation": "QAM256", "enable": true, "type": "C"}},
    "a002": {"timestamp": 1562149421, "hostname": "test-server", "dvb": {"frequency": "431", "symbolrate": "6875", "name": "Adapter2", "id": "a002", "adapter": 2, "device": 0, "modulation": "QAM256", "enable": true, "type": "C"}}
    }