# Error During icinga2agent installation

**URL:** <https://community.icinga.com/t/error-during-icinga2agent-installation/2691>\
**Category:** Automation & Infrastructure\
**Created:** [November 6, 2019, 7:40pm UTC](https://community.icinga.com/t/error-during-icinga2agent-installation/2691 "2019-11-06T19:40:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mani.vajrala](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@mani.vajrala](https://community.icinga.com/u/mani.vajrala)\
**Post date:** [November 6, 2019, 7:40pm UTC](https://community.icinga.com/t/error-during-icinga2agent-installation/2691/1 "2019-11-06T19:40:28Z")

</div>

I am getting the below error… during icinga2 agent installation… Can someone give an advice?  
Here, the output

Notice: Started script run…  
Notice: Reading host api token “ERROR: The host “[##################](http://dev-axdevaos-a.nicholas.int/)” has already been registered (IcingaHostSel  
fServiceForm.php:103)” from “C:\ProgramData\icinga2\etc\icinga2\icingadirector.token”  
Notice: Connected successfully to Icinga Director Self-Service API over stored host token.  
Notice: Setting internal Agent Name to “”  
Warning: You have not specified an Agent Name or turned on to auto fetch this information.  
Notice: Trying to fetch Host IP-Address for hostname: ################  
Notice: Setting IP ############ as primary IP for this host for all requests. Access it with &ipaddress& for all JSON re  
quests.  
Notice: Using Icinga version “2.10.5”, setting certificate directory to “C:\ProgramData\icinga2\var\lib\icinga2\certs”  
Notice: Found Icinga 2 Agent version 2.10.5 installed at “C:\Program Files\ICINGA2”  
Warning: Icinga 2 Agent will not be installed. Argument -InstallAgentVersion is not defined.  
Notice: Fetched ticket “ERROR: Got invalid API key “ERROR: The host “[############](http://dev-axdevaos-a.nicholas.int/)” has already been regis  
tered (IcingaHostSelfServiceForm.php:103)”” from Icinga Director  
Notice: Skipping function for generating certificates, as hostname is not specified within the module.  
**Fatal: Exception calling “generateIcingaConfiguration” with “0” argument(s): "Exception calling "checkConfigInputParamet**  
**ersAndThrowException" with “0” argument(s): “Argument -AgentName required for config generation.”"**  
**######## The script encountered several errors during run ########**  
**Fatal: Exception calling “generateIcingaConfiguration” with “0” argument(s): "Exception calling "checkConfigInputParamet**  
ersAndThrowException" with “0” argument(s): “Argument -AgentName required for config generation.”"

Can you please advise on the below error

Fatal: Exception calling “generateIcingaConfiguration” with “0” argument(s): “Exception calling “checkConfigInputParamet  
ersAndThrowException” with “0” argument(s): “Argument -AgentName required for config generation.””  
######## The script encountered several errors during run ########  
Fatal: Exception calling “generateIcingaConfiguration” with “0” argument(s): “Exception calling “checkConfigInputParamet  
ersAndThrowException” with “0” argument(s): “Argument -AgentName required for config generation.””

thanks

---

<div class="post-metadata">

**Author:** ![rsx](https://community.icinga.com/user_avatar/community.icinga.com/rsx/32/2094_2.png) [@rsx](https://community.icinga.com/u/rsx)\
**Post date:** [November 7, 2019, 8:24am UTC](https://community.icinga.com/t/error-during-icinga2agent-installation/2691/2 "2019-11-07T08:24:56Z")

</div>

I got sometimes the same error but was too lazy to identify the root cause. Therefore, I just purged the agent and deleted the according host entry at the director and re-run icinga2-powershell-module.

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [November 7, 2019, 11:35am UTC](https://community.icinga.com/t/error-during-icinga2agent-installation/2691/3 "2019-11-07T11:35:55Z")

</div>

For future questions, please ensure that you use markdown formatting for outputs, logs, configs. Right now, the topic is barely readable.

More help here: [Create topics and master Markdown formatting](https://community.icinga.com/t/create-topics-and-master-markdown-formatting/69)

Cheers,  
Michael
