I´ve used icinga2 windows agent with nscp+ plugin. Although it is developed, it doesn´t work on some computers, so I would like to migrate to Icinga2 Power Shell Framework.
I´m using icinga2 director and would like to add a new host. Icinga2 windows agent is running on this machine, and now I would like to install / use the powershell framework.
I´ve opened an elevated powershell with the following commands:
Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process
And after adding the host at icinga the following powershell:
[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.
Nothing happens anymore. Have understood it wrong how to use the powershell module? Any hints welcome
icinga : Der Befehl "icinga" wurde im Modul "icinga-powershell-framework" gefunden, das Modul konnte aber nicht
geladen werden. Wenn Sie weitere Informationen wünschen, führen Sie "Import-Module icinga-powershell-framework" aus.
In Zeile:1 Zeichen:1
+ icinga
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (icinga:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
Well it works, when I set Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process
before.
Can it be that during the installation the system / user needs to be set to ByPass at Execution Policy? Is there any chance to get a signed / valid execution policy?
Hm, I am not the expert for that (@cstein might know more),
but I think that the problem is, that Microsoft wants developers to throw money
at them to comply with their security circus and the added workload
is too much for a small amount of comfort.
But I might be wrong here.
If I remove all files from C:\Programm Files\Windows Powershell\icinga-powershellframework and install it from scratch - I get the following output. It get stuck at a different position (last line).
[Notice]: PowerShell Execution-Policies are configured to run Scripts and/or Modules.
[Notice]: Downloading Icinga PowerShell Framework into "C:\Users\wadmin\AppData\Local\Temp\icinga-powershell-framework-zip"
[Notice]: Installing Icinga PowerShell Framework into "C:\Program Files\WindowsPowerShell\Modules\"
[Notice]: Installing new Icinga PowerShell Framework version
[Notice]: Unblocking Icinga PowerShell Framework files
[Notice]: Applying pending migrations required for Icinga for Windows v1.8.0
[Notice]: Applying pending migrations required for Icinga for Windows v1.10.0
[Notice]: Applying pending migrations required for Icinga for Windows v1.10.1
[Notice]: Applying pending migrations required for Icinga for Windows v1.12.0
[Notice]: The task "Renew Certificate" has been successfully registered at location "\Icinga\Icinga for Windows\".
[Notice]: Applying pending migrations required for Icinga for Windows v1.12.1
[Notice]: The task "Renew Certificate" has been successfully registered at location "\Icinga\Icinga for Windows\".
[Notice]: Applying pending migrations required for Icinga for Windows v1.12.2
[Notice]: The task "Renew Certificate" has been successfully registered at location "\Icinga\Icinga for Windows\".
[Warning]: The service "icingapowershell" is not installed
[Warning]: The service "icingapowershell" is not installed
[Notice]: Applying pending migrations required for Icinga for Windows v1.12.3
[Notice]: The task "Renew Certificate" has been successfully registered at location "\Icinga\Icinga for Windows\".
[Warning]: The service "icingapowershell" is not installed
[Warning]: The service "icingapowershell" is not installed
[Notice]: Applying pending migrations required for Icinga for Windows v1.13.0
[Notice]: Windows Eventlog configuration has been written successfully to use severity level: warning - Please restart the Icinga Agent to apply this change
[Notice]: The task "Set Process Priority" has been successfully registered at location "\Icinga\Icinga for Windows\".
[Notice]: Applying pending migrations required for Icinga for Windows v1.13.0.1
[Notice]: The task "Set Process Priority" has been successfully registered at location "\Icinga\Icinga for Windows\".
Yes, I could install it now after deleting all files and installing it again using two different Execution policy scopes: LocalMachine and CurrentUser. It seems that LocalMachine did the trick.
But I am not 100% sure, if the installation works. Really new to this kind of configuration.
It looks like your installation is getting stuck after loading the Icinga PowerShell Framework. This could be due to leftover configurations or execution policy restrictions. Here’s how you can resolve it:
Ensure Execution Policy is Set Correctly
Before proceeding, ensure the execution policy is correctly set to Unrestricted
$currentPolicy = Get-ExecutionPolicy -Scope LocalMachine
If ($currentPolicy -ne 'Unrestricted') {
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine -Force
Write-Host "Execution policy changed to Unrestricted."
} Else {
Write-Host "Execution policy already set to Unrestricted."
}
Restart PowerShell after applying this change.
** Cleanup Existing Icinga PowerShell Modules**
Before reinstalling, remove any existing Icinga modules to prevent conflicts: