patternMinor
Count of currently active jenkins agents
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
Is there an API call or something I can run in the script console that just outputs the count for me?
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/jsonContext
StackExchange DevOps Q#3469, answer score: 3
Revisions (0)
No revisions yet.