The agent management API has commands for managing agents, plugins, tracing, and user-defined endpoints. The API URL for an Insight Agent begins with insight_url/services/agent-management/.
Returns a list of agents and their attributes.
Table 5. Command Options
Parameter | Description | Default |
---|---|---|
pageNum | Page number to return, first page is
1. (Optional) | 1 |
pageSize | Size of each page. (Optional) | 20 |
GET http://localhost:8080/insight/services/agent-management/agents
{ "agents": [ { "name": "tal-ubuntu.local-27889", "id": "42fbe22c-864d-408c-8d29-d0803a06020d", "roles": ["AGENT", "ANALYZER", "DASHBOARD"], "version": "1.9.0-CI-SNAPSHOT", "status": "on", "heartbeat": 15, "licensed": true, "sameVersionAsDashboard": true, "througput": 200, "lastHeartBeat": 1339331100771, "clockSkew": 0, "installPath": "/work/env/apache-tomcat-6.0.33", "containerName": "Tomcat", "containerVersion": "6.0.33", "toggleUrl": "/services/agent-management/agents/status", "toggleMethod": "PUT", "toggleBody": "{\"status\":\"off\",\"agentId\":\"42fbe22c-864d-408c-8d29-d0803a06020d\"}" } ] }
You can use the properties prefaced by toggle
to
start or stop an agent.
If you use the paging options, the results include page data:
{ "agents": [ { "name": "tal-ubuntu.local-27889", ... }], "currentPage": 2, "totalPages": 20, "pageSize": 10, "nextPage": "/services/agent-management/agents?pageSize=10&pageNum=3" "prevPage": "/services/agent-management/agents?pageSize=10&pageNum=1" }
Returns the details for one agent.
GET http://localhost:8080/insight/services/agent-management/agents/42fbe22c-864d-408c-8d29-d0803a06020d
{ "name": "tal-ubuntu.local-27889", "id": "42fbe22c-864d-408c-8d29-d0803a06020d", "roles": ["AGENT", "ANALYZER", "DASHBOARD"], "version": "1.9.0-CI-SNAPSHOT", "status": "on", "heartbeat": 15, "licensed": true, "sameVersionAsDashboard": true, "througput": 200, "lastHeartBeat": 1339331160771, "clockSkew": 0, "installPath": "/work/env/apache-tomcat-6.0.33", "containerName": "Tomcat", "containerVersion": "6.0.33", "toggleUrl": "/services/agent-management/agents/status", "toggleMethod": "PUT", "toggleBody": "{\"status\":\"off\",\"agentId\":\"42fbe22c-864d-408c-8d29-d0803a06020d\"}" }
You can use the properties prefaced by toggle
to
start or stop an agent.
Turns an agent on or off.
PUT http://localhost:8080/insight/services/agent-management/agents/status
Put body:
{"status":"on","agentId":"42fbe22c-864d-408c-8d29-d0803a06020d"}
200
for success; otherwise 500
.
Set the value of multiple agents with one call to
/agents/status
by sending a list of statuses in the
PUT
body. This is especially useful for batch operations in
UI grids.
[{"status":"off","agentId":"123"}, {"status":"on","agentId":"456"}]