Is it possible, using code, to determine if a build agent is currently running any steps/builds? I've looked through GridNode and AgentManager but am not seeing any functionality to support that.
Below statement can check whether or not "someagent:8811" running some steps:
!system.buildEngine.getRunningSteps("someagent:8811").isEmpty()