Node setup wizard comparable to Powershell

So far I’ve deployed ~60 Windows servers using Powershell and it’s worked well.

#Import Icinga2Agent module, needs to be available in path
Import-Module .\Icinga2Agent.psm1

# Set install parameters
$icinga = Icinga2AgentModule -DirectorUrl 'https://fqdn/icingaweb2/director/' -DirectorAuthToken 'string' -IgnoreSSLErrors -Debugmode -RunInstaller;
			

The script doesn’t seem that complex, although I have to sign the certificate request on my Icinga server after completing the installation on server. I’m happy with that.

I am now looking at my workstations in greater detail, mainly trying to decide the best approach to deploy in an efficient manner. From my understanding it is currently not possible to apply flags to the MSI so that it works in a similar fashion to my Powershell.

I’d like to replicate the the above process by initially installing the MSI silently then running the node wizard, unfortunately I’m finding the wording between the Powershell options and node wizard different.
Before I sit and go through trial and error, is there anyone that could confirm the options needed to simply replicate the above Director based setup through the Setup wizard?

Thanks

Hi,

the graphical Windows wizard shipped with the MSI uses the node setup CLI command in the background from icinga2.exe itself. The MSI cannot be instrumented to run further commands, it only installs the package.

This is described in the documentation here.

You can follow along the steps in the source code if that helps clarifying the question.

Cheers,
Michael

I think may be I didn’t express myself clearly.
At present I want to install the MSI silently, without a reboot etc, no configuration.

Then afterwards psexec to the host and run the commandline icinga node setup to finish the configuration. There is either the wizard or setup as options, ideally I’d like to use the setup option. I’m looking for which command line flags are analogous to the powershell.

Hi,

that’s exactly what I have described. The Powershell script is an addon to Icinga 2, the node setup CLI command is provided natively. Hence my suggestion to follow along with the official docs and the steps to achieve that. I cannot provide a 1:1 mapping since I never used the PS script myself. But I am sure you can map that yourself with the tables provided in the docs, and some trial and error.

Cheers,
Michael

From reading it through it looks like the icinga2 command line doesnt support Director unlike the Powershell module. I’m therefore barking up the wrong tree.

I see, the Director thingy. That integration solely exists in the Powershell script, nowhere else. But before you start digging into the current module, keep in mind that this will be replaced with the new Icinga for Windows framework. This is where I’d look into if I were you.

Cheers,
Michael

I was aware of that, but we won’t consider it for at least 3 months, we need to see its stable etc.
The way you refer to Director, it seems like an unloved component. I find it really quick and easy to use.

Hi,

I personally don’t like how the old PS module interacts with the Director API. This works around the design principles of the Icinga cluster, and lacks a general strategy imho. This is something I cannot hide, sorry. Although there have been steps taken to unify the strategy in future iterations.

The script won’t work for example in a three level cluster, when an agent doesn’t have a direct connection to the master, only the satellite. The best thing would be that the agent (and PS script) may talk to the satellite and forward these details throughout the cluster protocol, towards the master where this can be fetched by the Director again. This is something which is considered in future versions, thus requiring a change in the architecture of the cluster. I’m currently writing a draft concept also with that idea in mind in https://github.com/Icinga/icinga2/issues/7814

Cheers,
Michael

1 Like