Error During icinga2agent installation

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 “##################” 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 “############” 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

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.

1 Like

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

Cheers,
Michael