Windows Agent Config validation failed for staged cluster config sync

Hello,

I’m trying to set up an Icinga test environment.
I have already successfully connected two Linux servers.

Now I’m trying to add my first Windows server to Icinga.
When I assign a check to the server I get the following message.

My guess is that it has something to do with the following error, which is displayed on the Windows server


The following message is logged in the startuplog:

[2020-04-30 08:20:26 +0200] information/cli: Icinga application loader (version: v2.11.3)
[2020-04-30 08:20:26 +0200] information/cli: Loading configuration file(s).
[2020-04-30 08:20:26 +0200] critical/config: Error: Object 'apt' of type 'CheckCommand' re-defined: in C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/director-global/director/commands.conf: 1:0-1:24; previous definition: in C:/Program Files/ICINGA2//share/icinga2/include/command-plugins.conf: 1917:1-1917:25
Location: in C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/director-global/director/commands.conf: 1:0-1:24
C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/director-global/director/commands.conf(1): object CheckCommand "apt" {
                                                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/director-global/director/commands.conf(2):     import "plugin-check-command"
C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/director-global/director/commands.conf(3):     command = [ PluginDir + "/check_apt" ]


[2020-04-30 08:20:26 +0200] critical/cli: Config validation failed. Re-run with 'icinga2 daemon -C' after fixing the config.

Unfortunately I don’t know why the message is logged and how I can fix it.
Maybe someone can explain to me why the error occurs and how I can fix it.

Best regards

The apt command is in the ITL and you created the same command with director. get rid of the director one and redeploy.

If it doesnt help, clear the api directory of the agent first, so you get a fresh sync.

Regards,
Carsten

Hi, Carsten,

I’m sorry, but unfortunately the explanation doesn’t really help me yet.

The Director only has the standard commands he imported from ITL or am I missing something here?

Best regards

Imported command should only be visibke under external commands and nit commands in director

Can you review the “api.conf” file on agent win-icinga? Under the “ApiListener” object is the accept_config set to false? It looks like you are syncing you configuration from your Master over to your agent. This is causing the error when validating your Icinga configuration on agent win-icinga.

NOTE: I do not have Icinga Director configured so how to setup client with director may be slightly different than I know.