Some cache issues - variables not being deleted?

  • Hi all,


    some issues, well it has been happening quite a lot since the installation. Essentially, it seems if I define some fields/vars then remove later on in order to test and such, they are not deleted. Let me give an example. If I look at the preview for this host x-1


    ==

    zones.d/xzone/hosts.conf


    vars.IPMI = "10.x.x.x"

    vars._override_servicevars = {

    "hp hardware test" = {

    hp_address = "10.x.x.x"

    }

    ==


    But IPMI has been deleted and the override is no longer there as I have removed hp hardware test and IPMI. Yet they still show in the preview when I look at the host.. This is causing issues as when I create a new command/variable and use it with this host, all the old elements stay there.


    Version 2.4.1

    Director 1.3.1


    Distributed setup.


    Any ideas on where I can look to troubleshoot? At this point I am only troubleshooting from the Director itself. Has happened several times previously and I ended up having to delete and then recreate some commands/fields/checks/hosts to make it work with lots of fiddling around.


    Thanks

  • The "vars._override_servicevars" can be removed by either deleting its entry from director database, it should look like:

    MariaDB [director]> select * from icinga_host_var where varvalue like "%10.x.x.x%";

    | xx | _override_servicevars | {"hp hardware test":{"hp_address ":"10.x.x.x"}} | json | NULL |


    then delete the entry:

    MariaDB [director]> delete from icinga_host_var where host_id = "xx";

    Query OK, 3 rows affected (0.01 sec)


    Optionally you can edit /var/lib/icinga2/api/zones/management/director/hosts.conf on all the master nodes and remove the vars override, but normally this is synced from database.

  • Could you walk us through your testing steps?

    How to you attach a service to a host etc. I had this problem in the early stages of my trial and error.

    Linux is dead, long live Linux


    Remember to NEVER EVER use git repositories in a productive environment if you CAN NOT control them

  • Kevin.Honka ,

    To reproduce this situation, you will have to:

    - create a field in the director (url: icingaweb2/director/data/fields);

    - add the field to a service template (url: icingaweb2/director/services/templates) or even host templates (url: icingaweb2/director/hosts/templates)

    - then remove the field either from the service template or host template, without clearing the field value;

    - same can be achieved by removing the field itself from the data fields.


    After this, in the hosts configuration (preview in director) you should see there are still entries of the used field and it's value, as it was defined previously.

  • I am Also facing the same issue , could someone suggest the easy way of doing this ?


    if i Have 100 hosts, i cannot modify all these configurations.