Icinga local installation powershell

Hello all,

My servers dont have access to the web and i chose in self service API settings to install agent from local network. The path and everything is there, i regenerated the selfservice API key but when i run it, it again tries to download the agent from the web… Im using the kickstart script from the Agent tab in host template

Do you know how i can control this? I have the installation on a network drive and all it needs is to either install it from there or dont install it at all. Possilby i run the SCCM first to install agent.msi, for kickstart script to only configure it later for me.

BR,
Terro

you can place the binaries on a internal webserver or networkshare

you have to set the agent version here too in order for icinga director to provide the right url to the binary

I found out that the problem is the kickstart powershell script from: https://packages.icinga.com/IcingaForWindows/stable/ifw.repo.json

Is there a way to use the selfservice script without it going looking to the internet for the PS, i can provide the file locally on file server.

Or would that require rewriting of the whole script?

Thank you,
Terro

which script do you use?

The script im using is:

[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":["aaaaaaaaaaaaaaaaaaaaaaaa"]},"IfW-DirectorUrl":{"Values":["http://icinga/icingaweb2/director/"]},"IfW-StableRepository":{"Values":["https://packages.icinga.com/IcingaForWindows/stable"]}}' `
    -IcingaRepository 'https://packages.icinga.com/IcingaForWindows/stable/ifw.repo.json'

This is the script provided by the director selfservice, to be used to deploy a certain host template.

I have also tried the Offline kickstart script:

$global:IcingaFrameworkKickstartSource = 'C:\icinga\kickstart\icinga-powershell-kickstart.ps1';

$Script = Get-Content -Path $global:IcingaFrameworkKickstartSource -Raw;
$Script += "`r`n`r`n Start-IcingaFrameworkWizard;";

Invoke-Command -ScriptBlock ([Scriptblock]::Create($Script));

This one errors out:

[Error]: Unable to load the Icinga PowerShell Framework. Please check your PowerShell execution policies for possible problems. Error: System.Management.Automation.CommandNotFoundException: Th
e term 'Use-Icinga' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path
 is correct and try again.
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

the kickstarter is deprecated.

you can use the icinga powersehll framework to create a local mirror of packages.icinga.com

Hello again, im really sorry but this whole thing is a mess and i cannot make it work.

Now im having an issue syncing the repo to the local PC. It starts, gets to 17% progress, then powershell just closes and no files get written to local folder.