Description
You can call this operation to query OCP Agent processes on a host.
Call description
Prerequisite
You have the HOST_VIEWER permissions.
Request path
GET /compute/hosts/{hostId}/agent/processes
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| hostId | Long | Yes | 100 | The ID of the host. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| data | Object | The requested data. |
| ├─ contents | Array | The HostAgentProcess array. For more information about its data structure, see the following table. |
| ├─ page | Object | The page information. |
| ├─ totalElements | Integer | The total number of records. |
| ├─ totalPage | Integer | The total number of pages. |
| ├─ number | Integer | The number of the current page. |
| ├─ size | Integer | The size of the current page. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Data structure of HostAgentProcess
| Parameter | Type | Description |
|---|---|---|
| id | Long | The ID of the Agent process. |
| hostId | Long | The ID of the host. |
| alias | String | The alias of the process. |
| pid | Integer | The PID of the process. |
| user | String | The user of the process. |
| startCommand | String | The start command. |
| ports | String | The open ports. |
| elapsedTime | Long | The total active time of the process, in seconds. |
| lastActiveTime | String | The last time when the process was active. |
| status | String | The process status. Valid values: STOPPED and STARTED. |
| operable | Boolean | Indicates whether the process can be operated by the user. |
| logFilePattern | String | The template of log file names. |
| createTime | String | The creation time. |
| updateTime | String | The update time. |
Examples
Sample request
GET /compute/hosts/10/agent/processes?page=1&size=10
Sample response
{
"data": {
"contents": [
{
"alias": "ocp_agentd",
"createTime": "2021-07-19T19:28:31+08:00",
"elapsedTime": 8801025,
"hostId": 2,
"id": 137,
"lastActiveTime": "2021-09-03T10:58:28+08:00",
"logFilePattern": "/home/admin/ocp_agent/log/ocp_agentd.log*",
"operable": false,
"pid": 8724,
"ports": "",
"startCommand": "ocp_agentd",
"status": "STARTED",
"updateTime": "2021-07-19T19:28:31+08:00",
"user": "root"
},
{
"alias": "pos_proxy",
"createTime": "2021-07-19T19:28:32+08:00",
"elapsedTime": 8801020,
"hostId": 2,
"id": 143,
"lastActiveTime": "2021-09-03T10:58:28+08:00",
"logFilePattern": "/home/admin/ocp_agent/log/pos_proxy.log*",
"operable": false,
"pid": 8851,
"ports": "62888",
"startCommand": "pos_proxy",
"status": "STARTED",
"updateTime": "2021-07-19T19:28:32+08:00",
"user": "root"
},
{
"alias": "node_exporter",
"createTime": "2021-07-19T19:28:33+08:00",
"elapsedTime": 8801020,
"hostId": 2,
"id": 151,
"lastActiveTime": "2021-09-03T10:58:28+08:00",
"logFilePattern": "/home/admin/ocp_agent/log/node_exporter.log*",
"operable": true,
"pid": 8865,
"ports": "63000",
"startCommand": "/home/admin/ocp_agent/agent/node_exporter --web.listen-address=:63000 --no-collector.arp --no-collector.bcache --no-collector.edac --no-collector.textfile --no-collector.time --no-collector.timex --no-collector.uname --no-collector.vmstat --no-collector.xfs --no-collector.zfs --no-collector.cpufreq --no-collector.conntrack --no-collector.entropy --no-collector.ipvs --no-collector.mdadm --no-collector.netclass --no-collector.netstat --no-collector.nfs --no-collector.nfsd --no-collector.pressure --no-collector.sockstat --no-collector.stat",
"status": "STARTED",
"updateTime": "2021-07-19T19:28:33+08:00",
"user": "root"
},
{
"alias": "ocp_exporter",
"createTime": "2021-07-19T19:28:34+08:00",
"elapsedTime": 8801020,
"hostId": 2,
"id": 158,
"lastActiveTime": "2021-09-03T10:58:28+08:00",
"logFilePattern": "/home/admin/ocp_agent/log/ocp_exporter.log*",
"operable": true,
"pid": 8817,
"ports": "62889",
"startCommand": "ocp_exporter",
"status": "STARTED",
"updateTime": "2021-07-19T19:28:34+08:00",
"user": "root"
},
{
"alias": "obstat2",
"createTime": "2021-07-19T19:28:35+08:00",
"elapsedTime": 659777,
"hostId": 2,
"id": 163,
"lastActiveTime": "2021-09-03T10:58:28+08:00",
"logFilePattern": "/home/admin/ocp_agent/log/obstat2.log*",
"operable": true,
"pid": 7297,
"ports": "",
"startCommand": "/home/admin/ocp_agent/obagent/obstat2 -o http://xxx.xxx.xxx.xxx:80 -c ob20daily.xiaojun.chengxj __obproxy__ -f 20",
"status": "STARTED",
"updateTime": "2021-07-19T19:28:35+08:00",
"user": "root"
},
{
"alias": "ob_logtailer",
"createTime": "2021-07-19T19:28:36+08:00",
"elapsedTime": 8801020,
"hostId": 2,
"id": 169,
"lastActiveTime": "2021-09-03T10:58:29+08:00",
"logFilePattern": "/home/admin/ocp_agent/log/ob_logtailer.log*",
"operable": true,
"pid": 9062,
"ports": "",
"startCommand": "ob_logtailer",
"status": "STARTED",
"updateTime": "2021-07-19T19:28:36+08:00",
"user": "root"
}
],
"page": {
"number": 1,
"size": 10,
"totalElements": 6,
"totalPages": 1
}
},
"duration": 63,
"server": "xxx.xxx.xxx.xxx",
"status": 200,
"successful": true,
"timestamp": "2021-09-03T10:58:59.011+08:00",
"traceId": "b27e46f749284205"
}