How to do monitoring for the Bamboo Data Center remote agents
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
If you are looking to monitor your remote agents and their status apart from viewing Bamboo's agents in UI you can utilize the Bamboo REST API, which provides a programmatic way to access information about agent statuses.
Environment
Bamboo 9+
Solution
You can make use of Bamboo REST API to monitor agents. And combine the API endpoints in a script parse the output for monitoring statues.
You can use the REST API endpoint
/rest/api/latest/agent/remote
to retrieve a list of all remote agents and their authentication statuses.This endpoint provides detailed information about each agent, including its ID, name, type, and status indicators such as whether it is active, enabled, or busy.
Sample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$curl -uadmin -H "Accept: application/json" http://localhost:8928/b928/rest/api/latest/agent/remote | jq
Enter host password for user 'admin':
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 131 0 131 0 0 1033 0 --:--:-- --:--:-- --:--:-- 1031
[
{
"id": 3833857,
"name": "ip-192-168-0-16.ap-southeast-2.compute.internal",
"type": "REMOTE",
"active": true,
"enabled": true,
"busy": false
}
]
The above output values explained:
"id" is the unique identifier of the agent.
"name" is the hostname or identifier of the agent machine.
"type" indicates the type of agent, which is "REMOTE" in this case.
"active" shows whether the agent is currently active.
"enabled" indicates if the agent is enabled and available for use.
"busy" reflects whether the agent is currently executing a job.
You can also manage agents through the Bamboo REST API. For example, you can delete an agent by using the appropriate API endpoint.
For more details and a comprehensive list of available operations, refer to the Bamboo REST API documentation:https://developer.atlassian.com/server/bamboo/rest/api-group-api/#api-api-latest-agent-agentid-delete.
Was this helpful?