Re-definied Command error


Uploading: image.png(1)…

Hi, it’s me again :), I’ve just been getting this error message for every command I own. No sooner have I fixed one than the next error comes up. That can’t be right, can it? Can someone explain to me why this thing is causing problems and how to fix it :wink:

remove the following line

include_recursive “conf.d”

From your configuration file

/etc/icinga2/icinga2.conf

And recheck the output of icinga daemon

hi,

I have already deactivated this line. I still have the features-enabled/conf.d line

[2022-03-03 07:53:11 +0100] critical/config: Error: Object 'by_ssh' of type 'CheckCommand' re-defined: in [stage]/zones.d/director-global/commands.conf: 13:1-13:28; previous definition: in /usr/share/icinga2/include/command-plugins.conf: 2157:1-2157:28
Location: in [stage]/zones.d/director-global/commands.conf: 13:1-13:28
[stage]/zones.d/director-global/commands.conf(11): }
[stage]/zones.d/director-global/commands.conf(12): 
[stage]/zones.d/director-global/commands.conf(13): object CheckCommand "by_ssh" {
                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[stage]/zones.d/director-global/commands.conf(14):     import "plugin-check-command"
[stage]/zones.d/director-global/commands.conf(15):     command = [ PluginDir + "/check_ssh" ]
[2022-03-03 07:53:11 +0100] critical/cli: Config validation failed. Re-run with 'icinga2 daemon -C' after fixing the config.

The last output shows where the duplicate definition comes from:

/usr/share/icinga2/include/command-plugins.conf

Remove that file - you may want to backup it first.

grafik

I was able to rewind the changes via the director deployments. However, the director now wants to roll out the changes that caused the error. Is there anything I can do to prevent or delete the deployments from rolling out?

There is no easy director reset to a previous state, you can only revert every single change :frowning:

You need to fix the issue in director. Once the issue is fixed in director you might need to run the following commands in order to get icinga in a running state:

rm -rf /var/lib/icinga2/api/zones/*
rm -rf /var/lib/icinga2/api/zones-stage/*
systemctl restart icinga2

Check the state of the icinga2 process and the configuration:

systemctl status icinga2
icinga2 daemon -C

After icinga is in a running state you can trigger a deployment in director.

It looks like you re-created the commands from the ITL, but not excluded the ITL.

So if you want to keep your own commands, comment out the ITL inclusion on all the systems syncing the zone “director-global”.

If it was an error to re-create the commands, delete them from the Director and use the ones from ITL.

I have now rolled out the changes. What exactly should I do now? :slight_smile:

The problem is that I work with this command. Would it help if I restore a backup of the icinga master from 5 days ago?

i was able to solve the problem but now i get a new error. do you know how i can solve the problem?

image

It seams that you have created a loop:
In your template “Hardware Check” you probably import “Hardware Check” as well.
so review your template “Hardware Check” in the director and inspect the field “imports”

Good morning everyone,

My final solution now was to make a backup of the master and the db where the rollout is not present. To solve the hardware check import I removed an import that was wrong and did a rollback in the director.

Thank you for your quick and competent solution to this stupid problem I had.