HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Count of currently active jenkins agents

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
activejenkinsagentscountcurrently

Problem

Is there an easy way to get a count of how many agents are currently up? I know I can go to www.myjenkins.com/computer/ to see the agents, but counting them manually is tedious.

Is there an API call or something I can run in the script console that just outputs the count for me?

Solution

You can sufix computer/ with api/json and run some script on this response. Count the computers array or group by some one of his attributes, like idle or offline.

https://www.myjenkins.com/computer/api/json

Context

StackExchange DevOps Q#3469, answer score: 3

Revisions (0)

No revisions yet.