Director does not work after migration

(Benny) #1

Hello Everyone,

I am facing some issues with director module recently.
Originally, I have compiled icinga2 (2.10) with a non-root account and install to a customize directory.
it is working fine.
However, consider the compile process is complicated, I decided to install icinga2 (2.11 )from the repo now.
Therefore, on the same system, I have 2 set of icinga2 in different location.
I stop version 2.10 icinga2 and start version 2.11 icinga2.
version 2.11 icinga2 use the same database as version 2.10 icinga2, everything working fine.
version 2.11 icinga2 can read the database and get all the existed configuration from the database.

However, the director module is not good.
I run the kickstart Wizard and run the import.
When I try to deploy changes, it show the following error.

====
[2019-10-03 10:19:48 +1000] critical/config: Error: Validation failed for object ‘PRDCPCluster2’ of type ‘Host’; Attribute ‘check_command’: Object ‘hostalive_by_ssh’ of type ‘CheckCommand’ does not exist.
Location: in [stage]/zones.d/director-global/host_templates.conf: 46:5-46:38
[stage]/zones.d/director-global/host_templates.conf(44):
[stage]/zones.d/director-global/host_templates.conf(45): template Host “normal-template” {
[stage]/zones.d/director-global/host_templates.conf(46): check_command = “hostalive_by_ssh”
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[stage]/zones.d/director-global/host_templates.conf(47): groups = [ “Normal” ]
[stage]/zones.d/director-global/host_templates.conf(48): }

the above log is just one of the example.
All the previous check I setup on version 2.10 icinga2 report the same error.
It seems complain about the check command does not existed.
If I remove the check e.g. “hostalive_by_ssh”, from above example, it will be good.
This “hostalive_by_ssh” is existed in “External Commands” section in version 2.11 icinga2.
In version 2.10 icinga2, it is in “Commands” section.

anyone have any ideas what happen in here and how to fix this? :frowning_face:
Should I re-construct all the check commands?

(Aflatto) #2

As you have stated in your intro, the systems are in 2 different locations, and i am venturing a guess that your original director is pointed at the file location of the original ( compiled) icinga instance.

Can you post the constants.conf file and your icinga2.conf files of both installations ?

(Benny) #3

Thanks for the reply.
Forget the mention, I install icingaweb2 from Repo as well.
Therefore, they are 2 independent icinga2 and icingaweb2.

Also, I believe I have fix the problem.
I notice all the commands I setup in version 2.10 icinga2 are disappear in version 2.11 icinga2 “commands” section. They are all in “external commands” in Director.
I check the Director database table “icinga_command” and notice the object_type are “external_object”. I compare my test platform and realize the object_type of the commands create from Director should be “object”.
I take a risk which manually update the “object_type” in the back-end database.

This fix the problem! and I can make new changes from Director again.
I have spend 3 days to troubleshoot this problem.
I dont know what cause this object_type change and hopefully no other negative effects to other data in the database. :slight_smile: