Мониторинг

    System statis

    Version: 2021-04-12 or later

    Request: GET /api/system-status

    Optional query parameters: GET/api/system-status?t={time}

    • time - default is 1 - statistics for last minute. 0 - statistics for last second (current system status). For historical data InfluxDB should be configured.

    Response:

    {
        "timestamp": 0,
        "instance": "...",
        "la1": 0,
        "la5": 0,
        "la15": 0,
        "app_threads": 1,
        "sys_cpu_usage": 0,
        "app_cpu_usage": 0,
        "sys_mem_usage": 0,
        "app_mem_usage": 0,
        "sys_uptime": 0,
        "app_uptime": 0
    }
    • timestamp - report time, for t=0 is a current time;
    • instance - instance name if defined in the Settings -> General -> Instance Name;
    • la1 - load average for 1 minute multiplied by 100;
    • la5 - load average for 5 minutes multiplied by 100;
    • la15 - load average for 15 minutes multiplied by 100;
    • app_threads - number of the threads;
    • sys_cpu_usage - total CPU usage. Could be up to: 100 multiplied with the core numbers on all CPUs;
    • app_cpu_usage - CPU usage by the process and all threads;
    • sys_mem_usage - total RAM usage;
    • app_mem_usage - RAM usage by the process and all threads;
    • sys_uptime - total system uptime in seconds;
    • app_uptime - process uptime.

    Stream information

    Version: 2021-04-12 or later

    Request: GET /api/stream-info/{id}
    id - unique stream identifier

    Response:

    {
        "name": "...",
        "id": "...",
        "type": "...",
        "enable": true,
        "input": [
            ""
        ]
    }
    
    • name - stream name;
    • id - unique stream identifier;
    • type - stream typesptsormpts`;
    • enable - true if stream is enabled;
    • input - list of the stream inputs;
    • other options depends of the stream configuration.

    Stream status

    Version: 2021-04-12 or later

    Request: GET /api/stream-status/{id}

    id - unique stream identifier
    Optional query parameters: GET /api/stream-status/{id}?t={time}

    • time - default is 1 - statistics for last minute. 0 - statistics for last second (current stream status). For historical data InfluxDB should be configured.
      Response:

      {
      "timestamp": 0,
      "instance": "...",
      "name": "...",
      "input_id": 1,
      "active": true,
      "onair": true,
      "sessions": 0,
      "bitrate": 0,
      "packets": 0,
      "sc_error": 0,
      "cc_error": 0,
      "pes_error": 0
      }
    • timestamp - report time, for t=0 is a current time;

    • instance - instance name if defined in the Settings -> General -> Instance Name;

    • name - stream name;

    • input_id - active input identifier; for example if primary works fine will be 1. if stream switched to the backup input will be number of this input;

    • active - true if stream is active, or false if stream work on demand and inactive;

    • onair - true if active input works without errors;

    • sessions - number of active sessions on the stream;

    • bitrate - stream bitrate in Kbit/s;

    • sc_error - percent of scrambled TS-packets;

    • cc_error - CC errors counter;

    • pes_error - percent of invalid PES-packets packets

    Adapter information

    Version: 2021-04-12 or later

    Request: GET /api/adapter-info/{id}

    id - unique adapter identifier
    Response:

    {
        "name": "...",
        "id": "...",
        "type": "...",
        "enable": true,
        "adapter": 0,
        "device": 0
    }
    • name - adapter name;
    • id - unique adapter identifier;
    • type - adapter type: S, S2, T, T2, ATSC, ISDB-T, C, C/A, C/B, C/C;
    • enable - true if adapter is enabled;
    • adapter - number of adapter in the system: /dev/dvb/adapter0
    • device - number of the device in the adapter: /dev/dvb/adapter0/frontend0
    • other options depends of the adapter configuration

    Adapter status

    Version: 2021-04-12 or later

    Request: GET /api/adapter-status/{id}

    id - unique adapter identifier
    Optional query parameters: GET /api/adapter-status/{id}?t={time}

    • time - default is 1 - statistics for last minute. 0 - statistics for last second (current adapter status). For historical data InfluxDB should be configured

    Response:

    {
        "timestamp": 0,
        "instance": "...",
        "name": "...",
        "lock": true,
        "signal": 0,
        "signal_db": 0,
        "snr": 0,
        "snr_db": 0,
        "ber": 0,
        "unc": 0,
        "bitrate": 0
    }
    • timestamp - report time, for t=0 is a current time;
    • instance - instance name if defined in the Settings -> General -> Instance Name;
    • name - stream name;
    • lock - true if tuner has lock and able to receive data;
    • signal - approximate signal level in percent;
    • signal_db - signal level in dBm multiplied by 100;
    • snr - approximate signal to noise ratio in percent;
    • snr_db - signal to noise ratio in dB multiplied by 100;
    • ber - bit errors counter;
    • unc - block errors counter;
    • bitrate - total bitrate in Kbit/s.

    Получение статуса стрима

    {
        "cmd": "check-stream", "id": "a001", "status": true
    }

    Ответ-содержимое данных мониторинга.

    {
        "status": {
            "onair": "...",
            "active_input": "...",
            "input": [
                {
                    "scrambled": "...",
                    "cc_error": "...",
                    "bitrate": "...",
                    "pes_error": "..."
                }
            ]
        },
        "check-stream": "ok"
    }
    • onair - статус стрима - активно ли вещание.
    • active_input - номер активного входа.
      секция INPUT - данные мониторинга:
      -- scrambled - зашифрован ли поток.
      -- cc_error - количество текущих CC ошибок.
      -- bitrate - битрейт потока.
      -- pes_error - количество текущих PES ошибок.
      -- check-stream": "ok" - проверка стрима завершилась успехом.

    Если передать запрос как:

    {
        "cmd": "check-stream", "id": "a001"
    }

    ответ будет только
    "check-stream": "ok" или "check-stream": "false" - статус без дополнительных данных.