Skip to content

Process API

Check the state of an Astra instance, monitor system resources, read logs and restart the instance. See How to call API methods for authentication and custom control paths.

Read the version, uptime, license and detected hardware. The response example shows the main fields; hardware fields are described below.

POST/control/

Request body

{ "cmd": "status" }

Response excerptHTTP 200

{
"status": "ok",
"version": "Astra 260918 (commit:c109858f)",
"uptime": 3600,
"hostname": "streamer-1",
"cpu_power_save": false,
"license": {
"id": "ABCDEF",
"type": 2,
"expire": 1790000000
}
}
FieldDescription
status"ok"
versionAstra build version
uptimeProcess uptime in seconds. Restart does not reset it
hostnameThe instance_name setting, or the system host name
cpu_power_savetrue when the CPU frequency scaling policy holds the CPU below the clock it is capable of; read at start and once a minute
licenseLicense details. Fields depend on the license state; see License fields
dvb_listDetected DVB frontends. Omitted when none are found and while the start-up probe runs
modulator_listDetected modulators. Omitted when none are found and while the start-up probe runs
if_listNames of network interfaces that are up, for example ["lo", "eth0"]
net_listDetails of those network interfaces. Both network lists are omitted when no interface is up

Each dvb_list item describes one frontend. Astra probes the frontends in the background when it starts; restart Astra or call List DVB devices with reset to refresh this list after hardware changes.

FieldDescription
adapter, deviceNumeric indexes in /dev/dvb/adapterN/frontendM
busytrue while an adapter configuration of this instance uses the frontend, or when it was open for writing as the list was built. Omitted if it could not be opened
typeFrontend class: S, C, T or ATSC, when detected
frontendDriver-reported frontend name, when detected
macAdapter MAC address, when available
errorProbe error, such as Permission denied

Each modulator_list item describes one modulator device. kind, adapter and device are the settings of the output that drives it.

FieldDescription
kindOutput type: resi for DigitalDevices (/dev/dvb/adapterN/modM), tbs for TBS (/dev/tbsmodN/modM), it950x for HiDes (/dev/usb-it950xN)
adapter, deviceNumeric indexes in the device path. device is always 0 for it950x, whose output takes adapter only
busytrue while an output of this instance uses the device, or when it was open for writing as the list was built

Each net_list item describes one interface that is up.

FieldDescription
nameInterface name, for example eth0
upAlways true for interfaces in this list
loopback, running, broadcast, multicastPresent as true when the corresponding interface flag is set
flagsNumeric interface flags
indexNumeric interface index
macLink-layer address, when available
ipv4IPv4 addresses, for example ["192.168.1.10"], when available

Read CPU, memory and uptime statistics. Set t to 0 for the latest sample, or omit it for the last interval report. Also served as GET /api/system-status.

POST/control/

Request body

{
"cmd": "system-status",
"t": 0
}

ResponseHTTP 200

{
"timestamp": 1758268800,
"instance": "streamer-1",
"la1": 45,
"la5": 40,
"la15": 38,
"app_threads": 12,
"sys_cpu_usage": 12,
"app_cpu_usage": 3,
"sys_mem_usage": 31,
"app_mem_usage": 1,
"app_mem_kb": 163184,
"sys_uptime": 14400,
"app_uptime": 60
}

Samples update every 10 seconds. Interval reports average thread count, CPU and memory usage over 60 seconds by default, configured by tsdb_interval. Load averages and uptimes use the last sample. Values are zero until the first sample or report is ready.

FieldDescription
timestampUnix time: report creation time for t=1, latest sample time for t=0, 0 before the first sample
instanceThe instance_name setting. Omitted when not set
la1, la5, la15Load averages over 1, 5 and 15 minutes, multiplied by 100 and truncated. For example, 45 means 0.45
app_threadsNumber of process threads
sys_cpu_usageTotal system CPU usage, 0 to 100% across all CPUs
app_cpu_usageProcess CPU usage as a percentage of one CPU. Can exceed 100% on a multi-core host
sys_mem_usagePercentage of total system memory that is not available
app_mem_usageProcess resident memory as a percentage of total system memory
app_mem_kbProcess resident memory in KiB
sys_uptimeTime since system boot, in minutes
app_uptimeTime since the process started, in minutes. Does not reset after Restart
tnumberOptional
0 for the latest sample; 1 for the last interval report. Default: 1.

With POST /control/, put t in the JSON body; with GET /api/system-status, pass it in the query. A decimal numeric string is read as its number, any other value counts as 1. A numeric t other than 0 or 1 returns HTTP 200 with an error:

{ "system-status": "er", "error": "not implemented" }

Read the latest one-second statistics of every stream and adapter, and the latest system sample, in one request. Also served as GET /api/monitoring. The built-in web interface polls this method once per second for its dashboard.

POST/control/

Request body

{ "cmd": "monitoring" }

ResponseHTTP 200

{
"timestamp": 1758268800,
"instance": "streamer-1",
"system": {
"timestamp": 1758268795,
"la1": 45,
"la5": 40,
"la15": 38,
"app_threads": 12,
"sys_cpu_usage": 12,
"app_cpu_usage": 3,
"sys_mem_usage": 31,
"app_mem_usage": 1,
"app_mem_kb": 163184,
"sys_uptime": 14400,
"app_uptime": 60
},
"streams": [
{
"id": "a001",
"name": "Channel 1",
"input_id": 1,
"sessions": 3,
"inputs": [
{
"input_id": 1,
"timestamp": 1758268800,
"onair": true,
"bitrate": 4210,
"packets": 2799,
"pes_packets": 75,
"pes_error": 0,
"sc_error": 0,
"cc_error": 0,
"sync_error": 0,
"video_count": 1,
"audio_count": 1
},
{
"input_id": 2,
"timestamp": 0,
"onair": false,
"bitrate": 0,
"packets": 0,
"pes_packets": 0,
"pes_error": 0,
"sc_error": 0,
"cc_error": 0,
"sync_error": 0,
"video_count": 0,
"audio_count": 0
}
]
},
{
"id": "m001",
"name": "Multiplex 1",
"input_id": 0,
"sessions": 0,
"inputs": [
{
"input_id": 0,
"timestamp": 1758268800,
"onair": true,
"bitrate": 38000,
"packets": 0,
"pes_packets": 0,
"pes_error": 0,
"sc_error": 0,
"cc_error": 0,
"sync_error": 0,
"video_count": 0,
"audio_count": 0
},
{
"input_id": 1,
"timestamp": 1758268800,
"onair": true,
"bitrate": 41000,
"packets": 27260,
"pes_packets": 820,
"pes_error": 0,
"sc_error": 0,
"cc_error": 0,
"sync_error": 0,
"video_count": 9,
"audio_count": 14
}
]
}
],
"adapters": [
{
"id": "a002",
"name": "Astra 19.2E",
"timestamp": 1758268800,
"lock": true,
"status": 31,
"signal": 78,
"signal_db": -4520,
"snr": 62,
"snr_db": 1380,
"ber": 0,
"unc": 0,
"bitrate": 41000
},
{
"id": "a006",
"name": "SAT>IP 1",
"timestamp": 1758268800,
"lock": true,
"status": 0,
"signal": 0,
"signal_db": 0,
"snr": 0,
"snr_db": 0,
"ber": 0,
"unc": 0,
"bitrate": 38500
}
]
}

The request takes no parameters. All values of a reply are read at the same moment. Stream and adapter samples are refreshed every second, the system sample every 10 seconds. Streams and adapters with no_event set collect no statistics and are absent.

FieldDescription
timestampCurrent Unix time
instanceThe instance_name setting. Omitted when not set
systemThe latest system sample: the fields of System status with t set to 0, without instance; its timestamp is the time of that sample. Every value is 0 until the first sample
streamsRunning streams, see Stream statistics
adaptersRunning adapters, see Adapter statistics

Each streams item is an enabled SPTS or MPTS stream with an id. A stream that works on demand is listed while no client is connected too, with no inputs.

FieldDescription
idStream identifier
nameStream name
input_idThe source input, whose values Get stream status reports for the stream. 0 while no input is the source, and for an MPTS stream, whose source is input 0, the multiplex output
sessionsNumber of client sessions on the stream, counted when the last monitoring interval closed (the tsdb_interval setting)
inputsThe running inputs in ascending input_id order: an input is listed from its start until it is stopped. Empty while no input runs

Each inputs item is the analyzer sample of one input for the last second. The counters are raw counts, not the percentages of Get stream status.

FieldDescription
input_idInput number: the one-based position of the input in the stream’s input list. 0 is the multiplex output of an MPTS stream
timestampUnix time of the sample. 0 when the input has started and has no sample yet
onairThe analyzer’s verdict: false when the payload bitrate is under the expected minimum, a video or audio PID is scrambled or had more than 2 PES errors, or the CC error limit is reached
bitrateKbit/s
packetsTS packets received
pes_packetsVideo and audio packets that start a PES packet
pes_errorPackets counted in pes_packets whose payload does not begin with a PES header
sc_errorScrambled TS packets
cc_errorContinuity counter errors
sync_errorAlways 0
video_count, audio_countNumber of video and audio PIDs

An input with no_analyze set has no analyzer: it is listed with timestamp 0 and every value 0.

For an MPTS stream input 0 is the multiplex output and the source of the stream: onair is true, bitrate is the Kbit/s the multiplexer emitted in the last second, and every other value is 0. Inputs 1 and up are the multiplexed inputs with the values of their analyzers.

Each adapters item is a running adapter with an id: an adapter with a frontend type, a SAT>IP adapter or a virtual adapter (see Adapter configuration).

FieldDescription
idAdapter identifier
nameThe adapter name, or its id when the name is not set
timestampUnix time of the sample. 0 until the first sample
locktrue if the frontend reported lock. For a SAT>IP or virtual adapter: true while it is on air
statusFrontend status bits: 0x01 signal, 0x02 carrier, 0x04 FEC inner coding, 0x08 sync, 0x10 lock, 0x20 timed out, 0x40 reinitialized. 0 (and lock false) in the second in which the adapter’s watchdog stopped it
signal, snrSignal level and signal to noise ratio as reported by the driver: percent with the DVB API v5 status, raw driver units with the dvbapi3 option
signal_db, snr_dbDecibels multiplied by 100. 0 with the dvbapi3 option
ber, uncBit errors and uncorrected blocks as reported by the driver
bitrateKbit/s received over the last second

A SAT>IP or virtual adapter has no frontend: lock is its on-air state, bitrate the rate of its transport, and status and the signal fields are 0. A SAT>IP adapter and an address-based adapter are on air when packets arrived in the last second; a CI adapter when the stream passed through the CAM in the last second and the CAM is ready.

A scan session adds no item: a scan of a configured adapter, such as dvb://a002 or a dvb object naming the adapter in id, reads that adapter’s own item, and an adapter a scan tunes from its own options without an id collects no statistics.

Read the Astra build version.

POST/control/

Request body

{ "cmd": "version" }

ResponseHTTP 200

{ "version": "Astra 260918 (commit:c109858f)" }

The version contains the build date and commit.

Read the most recent log entries, oldest first. Astra keeps up to 2000 entries in memory, separately from the log file.

POST/control/

Request body

{ "cmd": "log" }

ResponseHTTP 200

{
"log": [
{
"level": "INFO",
"time": 1758268800,
"message": "[main] Starting Astra 260918 (commit:c109858f)"
},
{
"level": "ERROR",
"time": 1758268801,
"message": "[main] Authentication failed. Login:admin IP:192.168.1.10"
}
],
"last_id": 1043
}
FieldDescription
logLog entries, oldest first
log[].levelINFO, WARN, ERROR or DEBUG. Debug entries require debug logging
log[].timeUnix time when the entry was recorded
log[].messageMessage without the timestamp and level prefix
last_idID to use in the next request to read newer entries

Pass last_id from the previous response to read only newer entries:

POST/control/

Request body

{
"cmd": "log",
"last_id": 1043
}

ResponseHTTP 200

{
"log": [
{
"level": "INFO",
"time": 1758268802,
"message": "[main] Reloading configuration"
}
],
"last_id": 1044
}

Use 1044 in the next request. If there are no new entries, the response is {"log": []} without last_id; keep the previous value. Read frequently enough to stay within the 2000-entry archive.

last_idnumberOptional
Return entries recorded after this ID. Omit to read the entire archive.

With POST /control/, put last_id in the JSON body.

Reload the configuration file and restart streams, adapters and servers.

POST/control/

Request body

{ "cmd": "restart" }

ResponseHTTP 200

{ "restart": "ok" }

The restart begins one second after the response. Streaming and API access are briefly interrupted, and WebSocket clients must reconnect.

For authentication and HTTP errors, see API replies.