debops-contrib / ansible-checkmk_server

Setup Check_MK monitoring server
GNU General Public License v3.0
9 stars 3 forks source link

Periodically run `cmk --update-dns-cache` #50

Open ypid opened 7 years ago

ypid commented 7 years ago

Hi

I just noticed that the DNS cache seems to be not updated automatically at least in my deployments (manually setup). Is the DNS cache periodically refreshed when using this role?

ganto commented 7 years ago

Thanks a lot for hint. So far that's not something that is taken care of by the role. I do this manually whenever I know that a DNS address of a host changed. Maybe I could add a task to refresh the DNS cache whenever the role is run?

drybjed commented 7 years ago

I don't like the idea of using Ansible as a dependency for periodical tasks. Ansible can be used to configure a cron entry to do this just fine. You can even involve batch to run the task when system is idle, if this is something intensive. Let the hosts take care of this problem themselves, don't involve sysadmins.

ypid commented 7 years ago

Thanks for the feedback. I would propose a cron job for this.

ganto commented 7 years ago

I don't really like the idea of a cronjob in this case. DNS changes is not something that "happen" spontaneously. If the IP address of a host is updated, then you need to update the host configuration anyway as the debops-contrib.checkmk_agent role will "hard-code" the IP address as agent property. Also I wouldn't want to wait for an hour (or so) until the DNS cache is updated. Additionally you might also need to update the host parent association (not yet implemented in this role) if you changed the subnet for example. To solve this issue properly there is more effort needed. That's why I do it manually so far...

ypid commented 7 years ago

Understandable. But it is not always the case that the one who updates the DNS also thinks about or even knowns about to run check_mk --update-dns-cache. Even when you do it manually I would at least run the update weekly or so to catch the case that this is forgotten (not saying that this has just happened to me :wink:).