-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Hi there :)
We are currently installing the PowerShell framework, plugins and the Icinga Agent with a self-written script on some servers and via Ansible on others
Now most of the machines have the problem that the plugins will be installed inside the framework folder instead of the PowerShell modules folder, but not all of them. Strangely on a second run it works without problem on some hosts.
Following is the output of the Installer:
PS C:\temp\CQ-icinga2-agent-offline_installer> .\Install-Framework-and-agent-offline-v1.0.0.ps1 -setting settingsfile
Loading ConfigXML C:\temp\CQ-icinga2-agent-offline_installer\settingsfile
[Notice]: Removing Icinga Agent directory: "C:\ProgramData\icinga2"
[Notice]: Icinga Agent was successfully removed
True
[Notice]: Stopping service "icingapowershell"
[Notice]: Icinga PowerShell Service was successfully removed
[Error]: Your user and/or machine execution policies are configured as "AllSigned" or "RemoteSigned". This means you can only execute PowerShell scripts and modules which are signed by a trusted publisher. Please have a look at https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_signing?view=powershell-7 for further details about how to sign modules and scripts to ensure Icinga for Windows is running properly on your system.
[Notice]: Downloading Icinga PowerShell Framework into "C:\Users\username~1\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]: Icinga PowerShell Framework seems to be successfully installed
[Notice]: To use the Icinga PowerShell Framework in the future, please initialize it by running the command "Use-Icinga" inside your PowerShell
[Notice]: Using hostname "servername" for the Icinga Agent configuration
[Notice]: Downloading "Icinga Plugins" into "C:\Users\username\AppData\Local\Temp\tmp_icinga36823945.d"
[Notice]: Installing module into "C:\Users\username\AppData\Local\Temp\tmp_icinga36823945.d"
[Notice]: Using content of folder "C:\Users\username\AppData\Local\Temp\tmp_icinga36823945.d\icinga-powershell-plugins-1.5.1" for updates
[Notice]: Plugins Module Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\icinga-powershell-plugins" is not present. Creating Directory
[Notice]: Copying files to Plugins
[Notice]: Cleaning temporary content
[Notice]: Unblocking Icinga PowerShell Files
Import-Module : The specified module 'icinga-powershell-plugins' was not loaded because no valid module file was found in any module directory.
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\lib\core\framework\Install-IcingaFrameworkComponent.psm1:114 char:5
+ Import-Module $RepositoryName;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (icinga-powershell-plugins:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
[Notice]: Icinga Plugins update has been completed. Please start a new PowerShell to apply it
[Notice]: The wizard is complete. These are the configured settings:
========
-AcceptConnections 0
-AddFirewallRule 0
-Ticket '12345'
-EmptyTicket 0
-InstallFrameworkPlugins 1
-PluginsUrl 'C:\temp\CQ-icinga2-agent-offline_installer\icinga-powershell-plugins-1.5.1.zip'
-InstallFrameworkService 0
-RunInstaller
========
====
Start-IcingaAgentInstallWizard -AcceptConnections 0 -AddFirewallRule 0 -Ticket '12345' -EmptyTicket 0 -InstallFrameworkPlugins 1 -PluginsUrl 'C:\temp\CQ-icinga2-agent-offline_installer\icinga-powershell-plugins-1.5.1.zip' -InstallFrameworkService 0 -RunInstaller
====
[Notice]: Downloading Icinga 2 Agent installer "Icinga2-v2.12.4-x86_64.msi" into temp directory "C:\Users\username~1\AppData\Local\Temp\Icinga2-v2.12.4-x86_64.msi"
[Notice]: Installing new Icinga Agent version into "C:\Program Files\ICINGA2"
[Notice]: Icinga Agent was successfully installed
[Notice]: Successfully backed up Icinga 2 Agent default config
[Notice]: Your hostname was successfully changed to "servername"
[Notice]: The Icinga Service User already has permission to run as service
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writeable by the Icinga Service User "NT Authority\SYSTEM"
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writeable by the Icinga Service User "NT Authority\SYSTEM"
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writeable by the Icinga Service User "NT Authority\SYSTEM"
[Notice]: Service User successfully updated
[Notice]: Background daemon Cmdlet "Start-IcingaServiceCheckDaemon" has been configured
[Notice]: Feature "checker" was successfully disabled
[Notice]: Feature "notification" was successfully disabled
[Notice]: Feature "api" was successfully enabled
[Notice]: Generating host certificates for host "servername"
[Notice]: information/base: Writing private key to 'C:\ProgramData\icinga2\var\lib\icinga2\certs\servername.key'.
information/base: Writing X509 certificate to 'C:\ProgramData\icinga2\var\lib\icinga2\certs\servername.crt'.
[Warning]: Your trusted master certificate is not present. Fetching from your CA server is required
[Notice]: Fetching trusted master certificate from "satellitename"
[Notice]: information/cli: Retrieving TLS certificate for 'satellitename:5665'.
Version: 3
Subject: CN = satellitename
Issuer: CN = Icinga CA
Valid From: Sep 22 13:44:20 2020 GMT
Valid Until: Sep 19 13:44:20 2035 GMT
Serial: yes
Signature Algorithm: sha256WithRSAEncryption
Subject Alt Names: satellitename
Fingerprint: 42
***
*** You have to ensure that this certificate actually matches the parent
*** instance's certificate in order to avoid man-in-the-middle attacks.
***
information/pki: Writing certificate to file 'C:\ProgramData\icinga2\var\lib\icinga2\certs\trusted-parent.crt'.
[Warning]: Your ca.crt is not present. Manuall copy or fetching from your Icinga CA is required.
[Notice]: information/cli: Writing CA certificate to file 'C:\ProgramData\icinga2\var\lib\icinga2\certs\ca.crt'.
information/cli: !!!!!!
information/cli: !!! Certificate request for CN 'servername' is pending. Waiting for approval from the parent Icinga instance.
information/cli: !!!!!!
[Notice]: Icinga certificates successfully installed
[Notice]: Api configuration has been written successfully
[Notice]: Icinga Agent zones.conf has been written successfully
[Passed]: Icinga Agent service is installed
[Passed]: Directory "C:\ProgramData\icinga2\etc" is accessible and writeable by the Icinga Service User "NT Authority\SYSTEM"
[Passed]: Directory "C:\ProgramData\icinga2\var" is accessible and writeable by the Icinga Service User "NT Authority\SYSTEM"
[Passed]: Directory "C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache" is accessible and writeable by the Icinga Service User "NT Authority\SYSTEM"
[Passed]: Icinga Agent configuration is valid
[Passed]: Icinga Agent debug log is disabled
[Notice]: Restarting service "icinga2"
[Notice]: Updating Icinga PowerShell Service binary
[Notice]: Service User successfully updated
[Notice]: Restarting service "icingapowershell"
[Notice]: Stopping service "icingapowershell"
[Notice]: Service User successfully updated
True
Ok.
[Warning]: Please run "Write-IcingaFrameworkCodeCache" in addition to ensure your cache is updated. This should be done after each update of the Framework in case the feature was disabled during the update run.As can bee seen there is the same notice/error as described in #237 that should be already fixed.
Only difference is that we are not using the PowerShell gallery to install the modules.
I'm not sure were this error originates from, as the Modules root is correctly set:
[Notice]: Installing Icinga PowerShell Framework into "C:\Program Files\WindowsPowerShell\Modules\"
Not sure what else to check though.
If you have any ideas what we could check, we'll do so :)