Windows-Agent installation

Hello everybody

I have a problem installing the windows agent with the powershell module.
I would like to (unfortunately have to) install the Windows agents so that they only register with the Icinga CA and that the basic configuration of the agents is created. Any further configuration must then be made from the Icinga server. So I installed the Powershell module on the Windows client (Win 2016) and created an installscript that I can run on any Windows system in this Icinga zone. Unfortunately, there is a problem and I can not go on my own. The infrastructure looks like this at the moment:
1 Icinga Master
3 satellites, each with its own zone. The clients connected to the satellites can not reach the master directly. likewise, the master can not reach the clients to the satellite.

I pulled the Powershell module from github, because the Icinga on the centos server is in version 2.10.5, the agent for the Windows clients too (but the same error also occurs in other versions on 2.10.9 and 2.10. 4)

On the Windows client, the following 3 files are located under c:\ProgramData\icinga2\var\lib\icinga2\certs:

ca.crt
win-sgfi7git1p2.workgroup.crt
win-sgfi7git1p2.workgroup.key

“icinga ca list” returns an empty list

Attached the script for the installation and the output as a log file.

install.log (9.0 KB)

I would be happy if someone could help me. I really do not know anymore.

this is the install script:

Import-Module Icinga2Agent;
$icinga = Icinga2AgentModule `
    -FetchAgentFQDN `
    -InstallAgentVersion '2.10.5' `
    -ParentZone      'master' `
    -ParentEndpoints 'icinga.intranet.lan' `
    -CAServer        'icinga.intranet.lan' `
    -DownloadUrl 'http://icinga.intranet.lan/' `
    -AgentInstallDirectory 'C:\Icinga2' `
    -CAProxy $TRUE `
    -CACertificatePath 'C:\crt\ca.crt' `
    -AgentListenPort '5665' `
    -AcceptConfig $TRUE `
    -AgentAddFirewallRule $TRUE `
    -IcingaDisableLogging $TRUE `
    -AllowUpdates $TRUE `
    -IcingaServiceUser 'NT AUTHORITY\SYSTEM';
 
exit $icinga.install()

regards, Frank


Hallo zusammen,

Ich habe ein Problem bei der Installation der Windows-Agenten mit dem powershell modul.
Ich möchte (muß leider) die Windows-Agenten so installieren, daß sie sich nur bei der Icinga-CA registrieren und daß die Grundkonfiguration der Agents erstellt wird. Jegliche weitere konfiguration muß dann vom Icinga-Server aus vorgenommen werden. Ich habe mir also das Powershell modul auf den windows-Client (Win 2016) installiert und ein installscript erstellt, daß ich auf jedem Windows-System in dieser Icinga-Zone ausführen kann. Leider gibt es dabei ein Problem, und ich komme alleine nicht mehr weiter. Die Infrastruktur sieht im Moment so aus:
1 Icinga Master
3 Satelliten mit jeweils einer eingenen Zone. Die Clients, die an den Satelliten können den Master nicht direkt erreichen. ebenso kann der Master die Clients an den Satelliten nicht erreichen.

Das Powershell-Modul hab ich von github gezogen, da das Icinga auf dem centos-Server ist in Version 2.10.5, der Agent für die Windows-Clients ebenfalls (der gleiche Fehler tritt aber auch bei anderen Versionen auf 2.10.9 und 2.10.4)

auf dem Windows-Client liegen unter c:\ProgramData\icinga2\var\lib\icinga2\certs die folgenden 3 Dateien:

ca.crt                                                                                       
win-sgfi7git1p2.workgroup.crt                                                                
win-sgfi7git1p2.workgroup.key                                                                

“icinga ca list” gibt mir eine leere Liste zurück

Anbei das Script für die Installation und die Ausgabe als Logfile.

install.log (9.0 KB)

Ich würde mich freuen, wenn mir jemand helfen könnte. Ich weiß echt nicht mehr weiter.

MfG, Frank

I’ve read your post several times, but still haven’t understood what you are trying to achieve.

In the text you write The clients connected to the satellites but your install script points to the master. …can not reach the master directly but the logfile tells

Downloading Icinga 2 Agent Binary from “http://icinga.intranet.lan/Icinga2-v2.10.5-x86_64.msi

Can you share more details about your setup?

ok, i’ll try it again - that’s my test setup:

master = icinga.intranet.lan (here runs icinga2, icingaweb2, http (s) for download agent software)
satellite1 = sat1.intranet.lan (here runs icinga2, http (s) for download agent software)
satellite2 = sat2.intranet.lan (here runs icinga2, http (s) for download agent software)

There is only one connection between master and satellites via port 5665

Clients can be reached from both the master and the satellites.

I did my tests only in a small experimental environment in the master zone, but in the real environment I get the same errors. In principle, it should work the same way in the satellite zones. So I want to install an agent on a client and just create the certificate. It should be signed manually on the Icinga server (master).
I thought so, that the software should be downloaded to the client either from the master or from a satellite depending on the zone. The Powershell installation scripts are then customized for each zone.

regards Frank


ok, ich versuche es noch einmal - das ist mein Test-Setup:

master = icinga.intranet.lan (hier läuft icinga2, icingaweb2, http(s) für Download Agent-Software)
satellite1 = sat1.intranet.lan (hier läuft icinga2, http(s) für Download Agent-Software)
satellite2 = sat2.intranet.lan (hier läuft icinga2, http(s) für Download Agent-Software)
Zwischen Master und Satelliten besteht nur eine Verbindung über Port 5665

sowohl vom Master als auch von den Satelliten aus sind Clients erreichbar.

Meine Tests habe ich nur in einer kleinen Experimentierumgebung in der Masterzone durchgeführt, aber in der reellen Umgebung bekomme ich die gleichen Fehler. Prinzipiell soll es aber in den Satellitenzonen genauso funktionieren. Ich möchte also einen Agent auf einem Client installieren und nur das Zertifikat erstellen lassen. Signiert werden soll es dann manuell auf dem Icinga-Server (master).
Gedacht hatte ich mir das so, daß die Software in Abhängigkeit von der Zone entweder vom Master oder von einem Satelliten auf den Client heruntergeladen werden soll. Die Powershell-Installations-Scripte sind für jede Zone dann entsprechend angepasst.

MfG, Frank

First, I’d recommend to run your tests with a more similar environment e.g. AD connected clients instead of workgroup members. This will also help you to avoid this bug.

For installing agents belonging to your satelites you need to use the CA Proxy feature instead of -CAServer.

It does not matter if the ca-server option is included in the script. I tried this without this option, nothing has changed.