title: How to check if Jenkins node1 is free for the job, if not check for the node 2 and trigger the build on node2?
body: <p>I have a job which has the node name as a parameter(Made possible using <a href="https://wiki.jenkins.io/display/JENKINS/NodeLabel+Parameter+Plugin" rel="nofollow noreferrer">NodeLabel Parameter Plugin</a>). 
  I will trigger the job always with node1 as the parameter. I want the job to see node 1 is online and free(no other builds are going on in that node). If node1 is free run this job on node1 else this job should find a free node and run it on that(ie; trigger this same job in other node (eg; node2) if node1 is not free).
  How can I do that? How can I know whether a node is free? I don't want my job to be waiting for a node to complete other builds.</p>