Child pages
  • Display Tools Location on All Nodes
Skip to end of metadata
Go to start of metadata

This script can help to get Jenkins tools localtion on all your slaves

If you have many slaves, then it is difficult to view all configs for nodes. Run this small script and get all build tools.

Thanks o lot "domi" for

import hudson.model.*
import hudson.node_monitors.*
import hudson.slaves.*
import java.util.concurrent.*
jenkins = Hudson.instance
TaskListener log;
def getEnviron(computer) {
   def env
   def thread = Thread.start("Getting env from ${}", { env = computer.environment })
   if (thread.isAlive()) thread.interrupt()

def slaveAccessible(computer) {
    getEnviron(computer)?.get('PATH') != null

for (aSlave in jenkins.slaves) {
   def computer =
     println "Checking computer ${}:"
     def isOK = (slaveAccessible(computer) && !computer.offline)
     if (isOK) {

        for (ToolDescriptor<?> desc : ToolInstallation.all()) {
            for (ToolInstallation inst : desc.getInstallations()) {
                println ('\tTool Name: ' + inst.getName());
                println ('\t\tTool Home: ' + inst.translateFor(aSlave,log));
    } else {
        println "  ERROR: can't get PATH from slave: node is offline."
  • No labels