Note
This API has been supported since API level 22.
This API has been supported since API level 22.
The sdkagent service controls Telegraf in webOS and communicates with SDK tools.
Operations:
Note: Telegraf is open source resource monitoring tool.
NA
API level 22Gets configurations of the Telegraf service.
None
Name | Required | Type | Description |
|---|---|---|---|
| returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
| config | Optional | Object | Telegraf configurations, converted to a JSON object. Similar to telegraf.conf, available @ https://docs.influxdata.com/telegraf/v1.21/administration/configuration/. Note: Besides the configs that are configured using setConfig method, this method also returns some read-only configurations. |
Error Code | Error Text | Error Description |
|---|---|---|
| 3, 4, 6 | Check error details | For details of a specific error, see the API Error Codes Reference table. |
Example scenario
# luna-send -f -n 1 luna://com.webos.service.sdkagent/collector/getConfig '{}'
Response: For successful call
{
"returnValue": true,
"config": {
"inputs.processes": {
},
"inputs.kernel": {
},
"inputs.cpu": {
"collect_cpu_time": false,
"totalcpu": true,
"percpu": true,
"report_active": false
},
"inputs.socket_listener": {
"service_address": "unixgram:///tmp/telegraf.sock"
},
"agent": {
"omit_hostname": false,
"flush_jitter": "0s",
"round_interval": true,
"metric_buffer_limit": 10000,
"flush_interval": "10s",
"interval": "10s",
"collection_jitter": "0s",
"metric_batch_size": 1000,
"precision": "",
"hostname": ""
},
"inputs.diskio": {
},
"inputs.system": {
},
"inputs.disk": {
"ignore_fs": [
"tmpfs",
"devtmpfs",
"devfs",
"iso9660",
"overlay",
"aufs",
"squashfs"
]
},
"outputs.influxdb": {
"database": "telegraf",
"urls": [
"http://127.0.0.1:8086"
]
},
"global_tags": {
},
"inputs.mem": {
},
"inputs.swap": {
},
"webOS.webProcessSize": {
"enabled": true
},
"webOS.processMonitoring":{
"enabled":true,
"process_name":["com.webos.app.home"]
}
}
}
API level 22Gets data from the Telegraf service.
Error Code | Error Text | Error Description |
|---|---|---|
| 3, 4, 6 | Check error details | For details of a specific error, see the API Error Codes Reference table. |
Example scenario
# luna-send -f -n 1 luna://com.webos.service.sdkagent/collector/getData '{"inputs": ["processes", "kernel"]}'
Response: For successful call
{
"returnValue": true,
"dataArray": [
{
"kernel": {
"data": {
"boot_time": "1667892733i",
"context_switches": "11538598i",
"entropy_avail": "256i",
"interrupts": "94685940i",
"processes_forked": "19231i"
},
"time": "166797999600000000",
"host": "qemux86-64"
}
},
{
"processes": {
"data": {
"total": "143i",
"unknown": "0i",
"dead": "0i",
"blocked": "0i",
"stopped": "0i",
"paging": "0i",
"zombies": "0i",
"sleeping": "97i",
"running": "0i",
"total_threads": "313i",
"idle": "46i"
},
"time": "166797999600000000",
"host": "qemux86-64"
}
}
]
}
API level 22Gets status of the Telegraf service.
None
Name | Required | Type | Description |
|---|---|---|---|
| returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
| status | Required | String | Indicates the status of the Telegraf service. Possible values are:
|
| startOnBoot | Optional | Boolean | Indicates whether the service is configured to start on booting up of device. Possible values are:
|
Error Code | Error Text | Error Description |
|---|---|---|
| 3, 6 | Check error details | For details of a specific error, see the API Error Codes Reference table. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.sdkagent/collector/getStatus '{}'
Response: For successful call
{
"returnValue": true,
"status": "active",
"startOnBoot": false
}
API level 22Restarts the Telegraf service.
None
Name | Required | Type | Description |
|---|---|---|---|
| returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
|---|---|---|
| 3, 6 | Check error details. | For details of a specific error, see the API Error Codes Reference table. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.sdkagent/collector/restart '{}'
Response: For successful call
{
"returnValue": true
}
API level 22Sets configurations of the Telegraf service.
Name | Required | Type | Description |
|---|---|---|---|
| agent | Optional | Object: agent | Config data for telegraf agent. Note:
|
| outputs.influxdb | Optional | Object: outputs.influxdb | Config data for influxdb on host. Note:
|
| webOS.webProcessSize | Optional | Object: webOS.webProcessSize | Config data for webProcessSize. Note:
|
| webOS.processMonitoring | Optional | Object: webOS.processMonitoring | Config data for processMonitoring. Note:
|
Name | Required | Type | Description |
|---|---|---|---|
| returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
|---|---|---|
| 2, 3 , 4, 5, 6 | Check error details | For details of a specific error, see the API Error Codes Reference table. |
Example scenario
# luna-send -f -n 1 luna://com.webos.service.sdkagent/collector/setConfig '{
"agent":{"flush_interval":"5s","interval":"5s"},
"outputs.influxdb":{"database":"telegraf","urls":["http://192.168.0.6:8086"]},
"webOS.webProcessSize":{"enabled":true},
"webOS.processMonitoring":{"enabled":true,"process_name":["com.webos.app.home","com.webos.service.sdkagent"]}
}'
Response: For successful call
{
"returnValue": true
}
API level 22Starts the Telegraf service.
None
Name | Required | Type | Description |
|---|---|---|---|
| returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
|---|---|---|
| 3, 6 | Check error details | For details of a specific error, see the API Error Codes Reference table. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.sdkagent/collector/start '{}'
Response: For successful call
{
"returnValue": true
}
API level 22Automatically starts the Telegraf service on device boot-up and starts monitoring.
Name | Required | Type | Description |
|---|---|---|---|
| enable | Required | Boolean | Indicates if auto-start is enabled. Possible values are:
|
Name | Required | Type | Description |
|---|---|---|---|
| returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
|---|---|---|
| 2, 3, 6 | Check error details | For details of a specific error, see the API Error Codes Reference table. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.sdkagent/collector/startOnBoot '{"enable":true}'
Response: For successful call
{
"returnValue": true
}
API level 22Stops the Telegraf service.
None
Name | Required | Type | Description |
|---|---|---|---|
| returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
|---|---|---|
| 3, 6 | Check error details | For details of a specific error, see the API Error Codes Reference table. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.sdkagent/collector/stop '{}'
Response: For successful call
{
"returnValue": true
}
API level 29Config data for telegraf agent.
Name | Required | Type | Description |
|---|---|---|---|
| interval | Optional | String | Indicates the interval time. |
| flush_interval | Optional | String | Indicates the flush interval time. |
API level 29Config data for influxdb on host.
Name | Required | Type | Description |
|---|---|---|---|
| database | Optional | String | Indicates the database name. |
| urls | Optional | String array | Indicates the influxdb host urls. |
API level 29Config data for processMonitoring.
Lists the background/foreground applications and their process IDs that are running on webOS platform.
For more details: https://www.webosose.org/docs/reference/ls2-api/com-webos-service-applicationmanager/#running
Name | Required | Type | Description |
|---|---|---|---|
| enabled | Optional | Boolean | Enables process monitoring data. Possible values are:
|
| process_name | Optional | String array | Process names for monitoring. |
API level 29Config data for webProcessSize.
Return the list of apps which the process is running and their size. For information, see com.webos.service.webappmanager/getwebprocesssize().
Name | Required | Type | Description |
|---|---|---|---|
| enabled | Optional | Boolean | Enables webProcessSize data. Possible values are:
|
Error Code | Error Text | Error Description |
|---|---|---|
| 1 | Unknown error. | Unknown error. |
| 2 | Invalid parameters. | Occurs when parameters are incorrect. |
| 3 | Malformed json. | Occurs when parameter has malformed JSON. |
| 4 | Invalid configurations. | Occurs when Telegraf has invalid configurations. |
| 5 | Collector is active (running). | Occurs when Telegraf is running. |
| 6 | The developer mode must be activated in order to monitor performance. | Occurs when devmode is disable |
Contents