Complete the code to mark a Jenkins agent as offline.
agent.set[1](true)Setting offline to true marks the agent as offline in Jenkins.
Complete the code to check if a Jenkins agent is currently offline.
if (agent.is[1]()) { println("Agent is offline") }
The method isOffline() returns true if the agent is offline.
Fix the error in the code to reconnect an offline Jenkins agent.
if (agent.isOffline()) { agent.[1]() }
The connect() method is used to reconnect an offline agent.
Fill both blanks to set an offline cause and then mark the agent offline.
agent.setOfflineCause(new [1]("Maintenance")) agent.set[2](true)
Use OfflineCause.UserCause to specify a user-defined offline reason, then set offline to true.
Fill all three blanks to create a map of agent names to their offline status if they are offline.
def offlineAgents = agents.collectEntries { agent -> [(agent.[1]()): agent.is[2]() [3] true] }
Use getName() to get the agent's name, check if it is Offline with isOffline(), and compare with == true.
