Linux Agent Script download via RestAPI?


Is it possible to download the Linux Agent Script via Director RestAPI?

Please advise


What is the Linux Agent Script?

My guess is that he is referring to this:

have you tried simply quering the link of the download button with different hostnames?
I’m not sure if the script only get’s dynamically created when pressing on the Agent tab of a host or if querying the link would also work.

What is the reason for your question? It seems a bit “strange” to me, wanting to do this. Tbh I think that is what the Director Self-Service API is for.

In our tests everytime if you say the host is an agent, then this tab was actived/open and the script was recrated for the respective host.
I don’t know if the link would work, if the host isn’t defined as agent.
Maybe a better solution would be to download the bash script and change it to be more universal. e.g. pass the values for the variables with arguments. Similar to the powershell framework.

1 Like

Yes. I’m talking about the Linux agent script as @log1c mentioned about.

I don’t know if the Self service API run the script on the client. Does it do that?

The idea is to automate the Agent based clients deployment.


I was a bit mistaken, as the self-service API aims more a Windows agents.
But it can be used with the Directors API as well, but this would need the Agent installed prior to the API actions (e.g. by some kind of automation)

Haven’t used this way myself though, as I, until now, have only used the self-service API for Windows hosts and am new to automation in general.

While the Icinga Powershell framework does everything (installation, configuraiton etc.) for you, the Linux script does only the configuration for you. So be sure that icinga is installed before running the script. That’s why we don’t use it. But if you say you want to use it for automation you can use this script as base for your automation tool.

When I created our automation setup for Linux I used the code snipset from the docs ans this script as well as base.
If you want to use this Linux script as base for your automation also, you only need to to fill this variables from the script with values:

ICINGA2_NODENAME='your server'
ICINGA2_PARENT_ENDPOINTS=('Your endpoint 1' 'your endpoint 2')
ICINGA2_CA_NODE='your master'