List agents by name and by label

def jenkins = Jenkins.instance
def computers = jenkins.computers
computers.each {
   //  println "${it.displayName} ${it.hostName}"
}

def labels = jenkins.getLabels()
labels.each {
   println "${it.displayName}"
}