How to detect if a slave is running a job

17 views
Skip to first unread message

Mark deVilliers

unread,
Jan 27, 2016, 12:38:36 PM1/27/16
to Jenkins Users
What is the best way to detect in a job is in progress from the actual slave?

Our use case is to write a script that will delete a slave after a period of inactivity. We want the deletion to happen whether the slave is still registered to the master or not.

Any help appreciated,

Mark

Daniel Beck

unread,
Jan 27, 2016, 1:10:23 PM1/27/16
to jenkins...@googlegroups.com

On 27.01.2016, at 18:38, Mark deVilliers <markdev...@gmail.com> wrote:

> What is the best way to detect in a job is in progress from the actual slave?
>
> Our use case is to write a script that will delete a slave after a period of inactivity. We want the deletion to happen whether the slave is still registered to the master or not.

Not sure what you're asking for, but maybe accessing the slave activity via Jenkins remote API will work?

For example, this URL will tell you how busy the executors of the 'cabbage' slave on ci.j.o are:

https://ci.jenkins-ci.org/computer/cabbage/api/xml?tree=executors[idle]

Reply all
Reply to author
Forward
0 new messages