How to do automatically download the Checkmk agent

This reminds me of a question I’ve had. When I upgrade the server to a newer version the URL to the agent on that server changes to reflect the new version. Is there a generic URL that I can use in scripts on the client side that will always point to the Linux client rpm or deb file?

If I did not misunderstand you, you might be looking for this: How to download latest version of MK programatically - #12 by baris.leenders

I’m talking about the rpm and/or deb packages that come along with each version of the server.

On my current site I can wget

http://server/sitename/check_mk/agents/check-mk-agent-2.2.0p22-1.noarch.rpm

But if I’ve got that scripted in a kickstart script or similar it’s going to break after I update the server side. All the plugins are linked as well but with no version in the file name so you can mostly rely on those not changing but the rpm and deb packages change every time.

I split the post, as this is taking an entirely different direction.

I suggest you place the agent in a location with a generic name and use that generic file for installations. If you are using automatic agent updates, I would do the same, just with a package that has the agent updater plugin. Then install that agent, register it for updates and Checkmk will take care of the rest.

Best way to download the actual agent also with RAW edition is via REST API.
The endpoint is

/domain-types/agent/actions/download/invoke

Inside the interactive documentation you can find this under “Download agents shipped with Checkmk”.

I would think this is the worst way :wink:
Also with agent updater a simple request against the REST API will give you the actual agent for this explizit machine or a general configured agent. Just what you want.

1 Like

The worst? Hold my beer, I can do worse. :beer:

1 Like