We just discovered that when an agent is already marked offline, going to a page such as: http://ourjenkins/computer/agent-x/markOffline still display the UI to put it offline, and actually trigger it back online when hitting the "Mark offline" submit button.
See the attached gif to see the steps in action.
- Put an agent offline
- Go to an URL http://yourjenkins/computer/agent-x/markOffline where agent-x is the name of your agent
- Click on "mark offline" button
- The agent is put back online when clicking on the "mark offline" button
- the UI should show that the agent is already offline when going to the "/markOffline" URL, and at the very least hitting the button shouldn't switch it back online