icinga-powershell-framework
icinga-powershell-framework copied to clipboard
Installing the agent fails
Hey, I hope this is the right place to post this.
Im trying to install the windows agent on a customers server. Ive already installed multiple agents in the same network. This last agent installation however always fails and i have no idea where to start looking.
This is the error message i get when i try to install the agent via IMC after executing the ps script:
And this is the error i get when i try to install via the installer file from https://packages.icinga.com/IcingaForWindows/stable/agent/ :
Maybe you could point me in the right direction or have another way i could try to install the agent.
My powershell version is 4.0 And the system is Windows Server 2012 R2
Hello,
Thank you for the issue. Was it a clean install or did you upgrade from an existing Agent?
In case it was a new installation, please have a look for the following Directories:
C:\Program Files\ICINGA2
C:\ProgramData\icinga2
If any of them are present, try to delete the Icinga 2 folders and try again.
Which version of Icinga for Windows are you using?
Hello,
Hi, thanks for the quick reply
Thank you for the issue. Was it a clean install or did you upgrade from an existing Agent?
It was a clean install
In case it was a new installation, please have a look for the following Directories:
C:\Program Files\ICINGA2 C:\ProgramData\icinga2
Only the folder in Program Files existed and it was empty, i do however have a folder named icinga-framework-service in programms aswell
If any of them are present, try to delete the Icinga 2 folders and try again.
I deleted the empty folder and tried again, but i have the same issue
Which version of Icinga for Windows are you using?
Both IMC and just downloading the installer try the latest version which seems to be 2.13.1-x86_64
This is weird. Once you deleted both folders, could you try to manually download the Agent msi installer and try installing it from UI?
Does the installer stop again or does it complete properly?
This is weird. Once you deleted both folders, could you try to manually download the Agent msi installer and try installing it from UI?
Does the installer stop again or does it complete properly?
Thats where the second error image is from. You do mean the one i can download from https://packages.icinga.com/IcingaForWindows/stable/agent/ , right?
Yes, thats correct. I just wanted to ensure that the folders are not present once you try to install the MSI package over the UI. In case the folders are present, there might be a problem with the installation in case something failed.
Is this the only system the Agent is unable to install?
Yes, thats correct. I just wanted to ensure that the folders are not present once you try to install the MSI package over the UI. In case the folders are present, there might be a problem with the installation in case something failed.
Is this the only system the Agent is unable to install?
Ah ok. Yes, this is the only system, it worked fine on every other system, both in the same network and in others.
This is weird. Have you retested the installation once the directories were removed? If not, does it help to install a different version of the Agent?
Sorry for the late reply, i was sick and am just getting back into things.
This is weird. Have you retested the installation once the directories were removed? If not, does it help to install a different version of the Agent?
I have tried both but it didnt help. I will try restarting the server tonight and try again tomorrow and then report back if it helped.
Sadly installing the agent still doesnt work even after restarting the server. Something else ive noticed while trying to reinstall was, that script execution policy was pretty strict on this server so i used powershell.exe -executionpolicy bypass -file file\name to execute the ps script anyway. Maybe that wasnt sufficient?
I seem to remember that this workaround worked on a different system, but im not 100% on that.
No other ideas? I still need help with this, please.
I tried to dig into this but I have no idea at the moment on why the Icinga Agent installation fails. Some other issues required me to install the Icinga Agent in different versions over and over again and I never run into this specific problem, that the installation just fails and no error is printed at all.
Can you please try the following:
Uninstall-IcingaComponent -Name 'agent' -RemovePackageFiles
This should make sure that everything related to the Icinga Agent is removed.
Are you sure .NET Framework 4.6 is installed for the Icinga Agent? Also once uninstalled with above command, please try to install the Icinga Agent directly over the .msi again, without Icinga for Windows.
I tried to dig into this but I have no idea at the moment on why the Icinga Agent installation fails. Some other issues required me to install the Icinga Agent in different versions over and over again and I never run into this specific problem, that the installation just fails and no error is printed at all.
Can you please try the following:
Uninstall-IcingaComponent -Name 'agent' -RemovePackageFiles
This should make sure that everything related to the Icinga Agent is removed.
Are you sure .NET Framework 4.6 is installed for the Icinga Agent? Also once uninstalled with above command, please try to install the Icinga Agent directly over the .msi again, without Icinga for Windows.
I've tried your suggestions, but the outcome is the same. .NET Framework 4.8 is installed. Maybe im looking in the wrong place, but i download the .msi from https://packages.icinga.com/windows/ , is that wrong?
I did however manage to install icinga v2.4.4.exe from there but that created different problems.
The package source is the correct one. The only explanation I would have, is that there are some registry entries preventing the Icinga Agent from installing.
I would suggest the following:
- Run
Uninstall-IcingaComponent -Name 'agent' -RemovePackageFiles
- Ensure that
C:\ProgramData\icinga2
has been removed - Ensure that
C:\Program Files\ICINGA2
has been removed - Check the installed software package and ensure
Icinga
is not installed - Check with
Get-Service icinga2
, that the service is no longer installed
If all of the above apply, I would suggest to open the registry and lookup for icinga
through the entire system, If there are keys present, you will have to double check if theses are required or related to something and in case they are not, delete them.
Please make a backup of the system before doing so!
Once everything is cleaned up, I would expect the Icinga Agent to install with the latest packages from https://packages.icinga.com/windows/
Just out of curiosity: Have you checked if an antivirus solution or the Microsoft Defender is causing the installation to fail?
The package source is the correct one. The only explanation I would have, is that there are some registry entries preventing the Icinga Agent from installing.
I would suggest the following:
* Run `Uninstall-IcingaComponent -Name 'agent' -RemovePackageFiles` * Ensure that `C:\ProgramData\icinga2` has been removed * Ensure that `C:\Program Files\ICINGA2` has been removed * Check the installed software package and ensure `Icinga` is not installed * Check with `Get-Service icinga2`, that the service is no longer installed
If all of the above apply, I would suggest to open the registry and lookup for
icinga
through the entire system, If there are keys present, you will have to double check if theses are required or related to something and in case they are not, delete them.Please make a backup of the system before doing so!
Once everything is cleaned up, I would expect the Icinga Agent to install with the latest packages from https://packages.icinga.com/windows/
Sorry for the late reply, i was busy with other stuff, thankfully getting the agent up and running is not super time critical.
I followed your instructions and now im getting this new error when trying to install anything icinga related:
[Error]: Unable to load the Icinga PowerShell Framework. Please check your PowerShell execution policies for possible pr oblems. Error: System.Management.Automation.MethodInvocationException: Ausnahme beim Aufrufen von "Substring" mit 2 Argument(en): "Der Index und die Länge müssen sich auf eine Position in der Zeichenfolge beziehen. Parametername: length" ---> System.ArgumentOutOfRangeException: Der Index und die Länge müssen sich auf eine Position in der Zeichenfolge beziehen. Parametername: length bei System.String.Substring(Int32 startIndex, Int32 length) bei CallSite.Target(Closure , CallSite , Object , Int32 , Object ) --- Ende der internen Ausnahmestapelüberwachung --- bei System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception ex ception) bei System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) bei System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) bei System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
Im not really that familiar with powershell, so this looks rather bad. Maybe you have any ideas.