# Fatal: Failed to install Icinga 2 Agent

**URL:** <https://community.icinga.com/t/fatal-failed-to-install-icinga-2-agent/2736>\
**Category:** Automation & Infrastructure\
**Created:** [November 12, 2019, 3:17pm UTC](https://community.icinga.com/t/fatal-failed-to-install-icinga-2-agent/2736 "2019-11-12T15:17:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Willem](https://community.icinga.com/letter_avatar_proxy/v4/letter/w/898d66/32.png) [@Willem](https://community.icinga.com/u/Willem)\
**Post date:** [November 12, 2019, 3:17pm UTC](https://community.icinga.com/t/fatal-failed-to-install-icinga-2-agent/2736/1 "2019-11-12T15:17:25Z")

</div>

(windows server 2012R2)  
I’ve created a powershell script that that installs agent based on some parameters that i define in some variables upfront.

it works fine on some windows 2012R2 servers but fails on other windows 2012R2 servers with errormsg “Fatal: Failed to install Icinga 2 Agent”

i manually checked all parameters and they all seems to be fine (including ticket)

## script i run :

Icinga2AgentModule -RunInstaller -agentname $fqdn -InstallAgentVersion $RequestedIcingaVersion  
-ParentEndpoints $ParentEndpoints -ParentZone satellite -CAServer $CAServer -Ticket $ticketvalue -downloadurl c:\icinga -AllowUpdates -installnsclient

## error msg i get

Notice: Started script run…  
Notice: Trying to fetch Host IP-Address for hostname: [servername.domain.com](http://servername.domain.com)  
Notice: Setting IP 999.999.999.999 as primary IP for this host for all requests. Access it with &ipaddress& for all JSON requests.  
Notice: Using Icinga version “”, setting certificate directory to “C:\ProgramData\icinga2\etc\icinga2\pki”  
Warning: Icinga 2 Agent does not seem to be installed on the system  
Notice: Installing Icinga 2 Agent from local directory  
Warning: Icinga 2 Agent Installer verification disabled.  
Notice: Installing Icinga 2 Agent  
Fatal: Failed to install Icinga 2 Agent.  
Notice: Using Icinga version “”, setting certificate directory to “C:\ProgramData\icinga2\etc\icinga2\pki”  
Warning: Icinga 2 Agent does not seem to be installed on the system  
Warning: Unable to generate Icinga 2 certificates. Icinga 2 executable not found. It looks like the Icinga 2 Agent is not installed.  
Warning: Configuring Icinga 2 Agent without ApiListener, as certificates have not been generated.  
Warning: Unable to write Icinga 2 configuration. The required directory was not found. Possibly the Icinga 2 Agent is not installed.  
Warning: Icinga 2 config validation not possible. Icinga 2 executable not found. Possibly the Agent is not installed.

---

<div class="post-metadata">

**Author:** ![mcktr](https://community.icinga.com/user_avatar/community.icinga.com/mcktr/32/856_2.png) [@mcktr](https://community.icinga.com/u/mcktr)\
**Post date:** [November 12, 2019, 8:06pm UTC](https://community.icinga.com/t/fatal-failed-to-install-icinga-2-agent/2736/2 "2019-11-12T20:06:26Z")

</div>

Hi,

since Icinga 2 v2.11.0 it is necessary to have at least .NET 4.6 installed on Windows hosts. Windows Server 2012 R2 comes with .NET 4.5.1 by default, please ensure you have .NET 4.6 installed on the hosts where it is not working.

If this is not the problem try to install the MSI directly without a script and see if there is a more verbose error message.

Best regards  
Michael

---

<div class="post-metadata">

**Author:** ![stevie-sy](https://community.icinga.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@stevie-sy](https://community.icinga.com/u/stevie-sy)\
**Post date:** [November 13, 2019, 7:10am UTC](https://community.icinga.com/t/fatal-failed-to-install-icinga-2-agent/2736/3 "2019-11-13T07:10:21Z")

</div>

Did you create the complete PowerShell Script on your own or is it based on the Kickstart script [https://github.com/Icinga/icinga2-powershell-module](https://github.com/Icinga/icinga2-powershell-module)?

You could also take a look at [https://github.com/Icinga/icinga-powershell-framework](https://github.com/Icinga/icinga-powershell-framework). This is new and was presented at the OSMC

---

<div class="post-metadata">

**Author:** ![Willem](https://community.icinga.com/letter_avatar_proxy/v4/letter/w/898d66/32.png) [@Willem](https://community.icinga.com/u/Willem)\
**Post date:** [November 21, 2019, 2:24pm UTC](https://community.icinga.com/t/fatal-failed-to-install-icinga-2-agent/2736/4 "2019-11-21T14:24:04Z")

</div>

@stevie-sy,

yes i used complete PowerShell Script

@mcktr Michael Insel,

my server had .NET 4.5. After upgrading to 4.6 it worked fine.  
thx for your help

Willem
