Icinga rest api and hosts.conf

Iam facing a issue with icinga rest api. If I update, lets say ip address of a host A to X, via icinga rest api, the ip of host A gets updated to X.

But now if I again change the ip of host A to Y. But now I do not use rest api, rather update the ip address of host A in hosts.conf file and then restart Icinga, the ip of host A is still the old ip X which was updated via rest api.

Is this the desired behavior that we cannot override the properties via hosts.conf, which were updated using rest api. If so, is there any workaround to achieve what I want to?

Hello @vishalsevani!

There should be a /var/lib/icinga2/modified-attributes.conf which you may want to edit.

Best,
AK

Mh don’t edit this file, that’s the core managing this one. For a workaround, you can try to remove the modified attribute in there.

In terms of mixing the configuration methods, I strongly advise against this. Either use the REST API for create/modify/delete OR the static configuration files.

Cheers,
Michael

3 Likes

Thanks for replies, folks.

@dnsmichi, I was hoping to find a workaround to make use of both, api and static conf files. But if both cannot work together, I guess I will have to take harder route and use only static conf files.