|
I would like to remove slaves that are offline
eg: after one month.
This script doesn't remove anthing, or email anyone, but you can look at
its output if you are interested.
Counts how long slaves have been online or offline
not sure why jenkins doesn't come with this functionality.
I just threw the script on the master node into
/opt/jenkins-ci/slavemonitor
Script writes data to be read the next day, and I don't want to worry about the
workspace getting wiped.
you can look at the scipt here:
https://gist.github.com/Aricg/d770f7d0a4e88d149ddb6715dc4ad0ba
But I don't recommend it.
Example of what output looks like:
JUST WENT OFFLINE arm-build3
JUST WENT OFFLINE arm-pod5
JUST WENT OFFLINE ericsson-build3
JUST WENT OFFLINE ericsson-virtual5
OFFLINE cengn-pod1 FOR 7 ITERATIONS
OFFLINE cisco-virtual1 FOR 7 ITERATIONS
OFFLINE ericsson-virtual8 FOR 7 ITERATIONS
OFFLINE ericsson-virtual9 FOR 7 ITERATIONS
OFFLINE intel-pod3 FOR 7 ITERATIONS
OFFLINE intel-pod6 FOR 7 ITERATIONS
OFFLINE intel-pod8 FOR 7 ITERATIONS
OFFLINE intel-virtual1 FOR 7 ITERATIONS
ONLINE lf-build1 for 6 iterations
ONLINE lf-build2 for 6 iterations
ONLINE lf-pod1 for 6 iterations
ONLINE lf-pod2 for 6 iterations
ONLINE lf-virtual1 for 6 iterations
ONLINE lf-virtual2 for 6 iterations
ONLINE lf-virtual3 for 6 iterations
ONLINE zte-pod1 for 6 iterations
ONLINE zte-pod2 for 6 iterations
ONLINE zte-pod3 for 6 iterations
ONLINE zte-pod4 for 6 iterations
ONLINE zte-virtual1 for 6 iterations
ONLINE zte-virtual2 for 6 iterations
ONLINE zte-virtual3 for 6 iterations
ONLINE zte-virtual4 for 6 iterations
removing online status from arm-build3. slave was online for 1
iterations
removing online status from arm-pod5. slave was online for 1 iterations
removing online status from ericsson-build3. slave was online for 1
iterations
removing online status from ericsson-virtual5. slave was online for 1
iterations
Change-Id: I652ef5460cb1ce45ff4e87828eb779da7febe8b4
Signed-off-by: agardner <agardner@linuxfoundation.org>
|