Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,082
Community Members
 
Community Events
176
Community Groups

bamboo server monitoring

Hi,

We want some monitoring mechanisms to check the following?

1.No of agent connected at the moment?

2.Is the Bamboo server is accessible or not

2 answers

1 accepted

0 votes
Answer accepted

You can use the Bamboo REST API to achieve 1 in a similar fashion via a GET /agent?online call:

Provides a list of all agents. Use query parameter "online = true/false" 
to filter only online agents.

 So something along the lines of (top of my head):

curl --user username:password -H "Accept: application/json" \
https://example.com/bamboo/rest/api/latest/agent | jq 
'. | length'

Update

Here's a more specific example to confirm my memory (based on HTTPie rather than cURL).

Initially there are 2 local and 0 remote agents:

λ http -a user:pass http://example.com/bamboo/rest/api/latest/agent | jq '. | length'
2
λ http -a user:pass http://example.com/bamboo/rest/api/latest/agent/remote | jq '. | length'
0

I've then started 2 elastic agents in addition to the 2 local ones, which yield 4 agents overall:

λ http -a user:pass http://example.com/bamboo/rest/api/latest/agent | jq '. | length'
4
λ http -a user:pass http://example.com/bamboo/rest/api/latest/agent/remote | jq '. | length'
2

Terminating 1 elastic agent yields the expected outcome too:

λ http -a user:pass http://example.com/bamboo/rest/api/latest/agent | jq '. | length'
3
λ http -a user:pass http://example.com/bamboo/rest/api/latest/agent/remote | jq '. | length'
1

 

 

Currently, I am doing this way

curl --user adminuser:password https://bamboo.com/bamboo/reconfigureVirtualAgents.action | grep -o '<p>Available remote agent slots'

I will try your suggested approach as well.

@ Steffen: Yours suggested that doesn't fulfill my requirement.I guess I put the wrong question.

I have a license of x agents,I want to check how many agents are online at the moment so that I can plan my activities accordingly.

@Neeraj Singh - I'm afraid I don't t really get what you are asking for here. I've updated my answer with a more specific example to confirm my memory, and it seems to yield the expected result by telling me how many agents are currently available - is this not the 'No of agent connected at the moment' that you are looking for?

@Steffen Opel _Utoolity_Thanks for your knowledge sharing.It was great and helpful

2. Done with following command

curl --user username:password -H "Accept: application/json" [https://bamboo.com/bamboo/rest/api/latest/server | jq .state

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events