[SOLVED] How to update agent.jar on Windows agent?

Hello,
I have a Jenkins controller version 2.346.3 on RedHat 7
I have several Windows agents which connect to it at launch. Their remoting version is 4.13.3.

When I upgrade my Jenkins controller, the agent.jar used by my Windows agents may be out of date, and I will have to upgrade the jar on every agent. (I had already to do this last time I upgraded my Jenkins controller)
Is there a way to make Jenkins automatically update this jar at startup for instance ?
Maybe if the Jenkins controller launches Windows agents itself via ssh ?

Thanks for your help :slight_smile:

How are you connecting your agents? Generally, I thought most connection methods update the agent.jar during the start up.

Yes, if you switch from inbound agents to ssh agents, the Jenkins controller will automatically update the agent.jar file.

Inbound agents are controlled by the operating system and the person who installed them. Outbound agents (like ssh) are managed by the Jenkins controller.

Thank you Mark for confirming that !
I’m going to try it.

It worked !

I did the following actions (it may help other users) :

  1. Install openSSH Server on the PC used for Windows agent
  2. Start OpenSSH Server service
  3. Configure PATH on Windows to match JDK 11
  4. Create agent on my Jenkins controller with “Launch agent via SSH” method
  5. Add the right credentials
  6. Modify “Host Key Verification Strategy” to “Non verifying Verification Strategy” (I’m not concerned by security issues for now)
  7. Modify “Prefix Start Agent Command” to add “cd /d D:\ &&”, because I wanted to run my agent on D:\ drive
  8. Start agent

Now, my Windows agent is up and running. Jenkins controller has automatically uploaded a remoting.jar in version 4.13.3 (which was expected, because my controller is in version 2.346.3)