Automated Icinag2 Agent installation on Windows Servers

Hi team,

I have been struggling to find the better path for automated Icinga2 agent & NSclient++ installation on windows servers.

Can you someone advise any documentation or any powershell scripts that i can find for automated icinga2 agent installlation.

thanks,
Mani

Hi,

this highly depends on your environment. If you have a configuration management at hand I recommend to use this to deploy the Windows Agent across your servers. In the documentation you find notes about how to silently install the Windows Agent with msiexec: https://icinga.com/docs/icinga2/latest/doc/06-distributed-monitoring/#silent-windows-setup.

If you also want to automate the configuration you can trigger the node setup. An example can be found here: https://icinga.com/docs/icinga2/latest/doc/06-distributed-monitoring/#node-setup-with-agentssatellites. On Windows you must calling the icinga2.exe with your paramters for example:

C:\Program Files\ICINGA2\bin\icinga2.exe node setup ...

You can also have a look into the Windows Powershell module: https://github.com/Icinga/icinga2-powershell-module. Unfortunately I don’t have any experience with this module, so I can’t say anything about it.

Kind regards
Michael

Unfortunately… we don’t configuration management tool (CHEF/PUPPET/Ansible). Just thinking to use the poweshell-module…

I am just trying to figure out possibilities without configuration managment technology

I made a simple BAT file to use PSEXEC to run the automated install of NSC++.

@ECHO OFF
echo Running on %1…
psexec -his -accepteula -nobanner \%1 msiexec /qn /l* C:\NSCP_install_log.txt /i “\example.com\share\SoftwareDist\NSClient++\NSCP-0.5.3.4-x64.msi” INSTALLLOCATION=“C:\Program Files\NSClient++” CONF_CAN_CHANGE=1 ALLOWED_HOSTS=“127.0.0.1,10.2.2.30,10.2.2.31,10.2.2.32,10.2.2.33” NSCLIENT_PWD=[your_password_here] CONF_CHECKS=1 CONF_NSCLIENT=1
copy “\example.com\share\SoftwareDist\NSClient++\nsclient.ini” “\%1\C$\Program Files\NSClient++\nsclient.ini”
psexec -his -nobanner \%1 net stop nscp
psexec -his -nobanner \%1 net start nscp
echo Done.
echo.

Powershell is very different/inconsistent between Server versions. We used PSEXEC to deploy Chocolately which makes it very easy to get all servers on PS 5.1. Then use Chocolately to deploy OpenSSH Server on all of your Windows Servers to be like Server 2019. Now you have all of the power and flexibility of SSH key authentication like a Linux box.