Windows Install error

Hi, I’m new to using icinga; Some time ago I wanted to try it but they did NOT have a version for Windows, now I have realized that they have made one, I’m glad about it. For this reason, I have tried to test it, but when using its Script for automatic installation, which is the following:

[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11';
$ProgressPreference                         = 'SilentlyContinue';
[string]$ScriptFile                         = 'C:\Users\Public\IcingaForWindows.ps1';

Invoke-WebRequest `
    -UseBasicParsing `
    -Uri 'https://packages.icinga.com/IcingaForWindows/IcingaForWindows.ps1' `
    -OutFile $ScriptFile;

& $ScriptFile `
    -ModuleDirectory 'C:\Program Files\WindowsPowerShell\Modules\' `
    -InstallCommand '{"IfW-DirectorSelfServiceKey":{"Values":["651f889ca5f364e89ed709eabde6237fb02050ff"]},"IfW-DirectorUrl":{"Values":["https://icinga.example.com/icingaweb2/director"]}}';

I have run into the following error:

PS C:\Windows\system32> [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11';
PS C:\Windows\system32> $ProgressPreference                         = 'SilentlyContinue';
PS C:\Windows\system32> [string]$ScriptFile                         = 'C:\Users\Public\IcingaForWindows.ps1';
PS C:\Windows\system32>
PS C:\Windows\system32> Invoke-WebRequest `
>>     -UseBasicParsing `
>>     -Uri 'https://packages.icinga.com/IcingaForWindows/IcingaForWindows.ps1' `
>>     -OutFile $ScriptFile;
PS C:\Windows\system32>
PS C:\Windows\system32> & $ScriptFile `
>>     -ModuleDirectory 'C:\Program Files\WindowsPowerShell\Modules\' `
>>     -InstallCommand '{"IfW-DirectorSelfServiceKey":{"Values":["651f889ca5f364e89ed709eabde6237fb02050ff"]},"IfW-DirectorUrl":{"Values":["https://icinga.example.com/icingaweb2/director"]}}';
[Notice]: PowerShell Execution-Policies are configured to run Scripts and/or Modules.
[Notice]: Icinga PowerShell Framework is already installed. Using Framework functions for kickstarter.
[Notice]: Loading Icinga PowerShell Framework.
[Error]: Failed to fetch host/template configuration from Icinga Director Self-Service API because of unhandled exception: 900
[Notice]: Host seems already to be registered within Icinga Director. Trying local Api key if present
[Notice]: No local Api key was found and using your provided template key failed. Please ensure the host is not already registered and drop the set Self-Service key within the Icinga Director for this host.
[Notice]: Starting Icinga for Windows installation
[Error]: Failed to start Icinga for Windows installation, caused by an error while communicating with Icinga Director:

En C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1: 7735 Carácter: 9
+         throw $global:Icinga.InstallWizard.DirectorError;
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (System.Object[]:Object[]) [], RuntimeException
    + FullyQualifiedErrorId :

I hope someone can give me a decisive answer. I would very much like to try this service.

Thank you very much for your time and your attention.

Greetings,
Luke.

you are trying to install against “icinga.example.com” and there is no icinga director there.

First you have to setup your icinga-master on a supported linux machine (icinga2, icingaweb2)
Then you install and setup icinga director if you want to use this script with director selfservice api

After that you run this script against your icinga2 instance

Hi.
I obtain the same error.
Could it be seems related to an old registration?

I obtain:

[Error]: Failed to fetch host/template configuration from Icinga Director Self-Service API because of unhandled exception: 900
[Notice]: Host seems already to be registered within Icinga Director. Trying local Api key if present
[Notice]: No local Api key was found and using your provided template key failed. Please ensure the host is not already registered and drop the set Self-Service key within the Icinga Director for this host.

How could I purge the registration key?
From the Director, I don’t see a API key on the host.

Thanks a lot
Mario

if you klick on the host in icinga director and choose the agent tab there is the “drop self service key” button

Thanks Moreamazingnick, but in this case, the button is not available.

In the tab agent I see:

Configure this Agent via Self Service API
  Documentation
Inherited Template Api Key: fbc8b109e873ca23337832b30e4247ae28c4c729

Icinga for Windows
In case you're using Icinga for Windows, please run this Script:

Use-Icinga;
Start-IcingaAgentInstallWizard `
    -DirectorUrl            'http://myicingahost.mydomain.net/icingaweb2/director/' `
    -SelfServiceAPIKey      'fbc8b109e873ca23337832b30e4247ae28c4c729' `
    -UseDirectorSelfService 1 `
    -OverrideDirectorVars   0 `
    -Reconfigure `
    -RunInstaller

Could it be a misconfiguration on the object?
I tried to delete the host, too, but the problem still persist.

if there is no button there is no api key for this host which means that that your host is currently not paired via the icinga director selfservice api. The error message just tells you that you should check if the host is registered, not that it actually is. so your problem is another one.

1 Like

there was a problem about firewall.
From Windows host I was not able to contact at port 80 Icinga server.
Now I solved.
Thanks a lot