Hi,
We have a few hosts with the address field filled with it's cname and not IP. This is on purpose: this way, when we migrate to an alternative site, the current working server keeps being monitored. However, the only way we found so far to reset the IP nagios associates with a given name is to reboot the server. Is there a way to make nagios search for new DNS information? Restarting the service also doesn't work.
Reset Nagios DNS Cache
Re: Reset Nagios DNS Cache
There are multiple ways to flush the DNS cache depending on what daemon you use. Also, you could have entries hardcoded into /etc/hosts. See the following document for info on flushing the cache:
http://www.cyberciti.biz/faq/rhel-debia ... dns-cache/
http://www.cyberciti.biz/faq/rhel-debia ... dns-cache/
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Reset Nagios DNS Cache
Actually - restarting the Nagios service *should* be the way to handle this. Nagios does it's DNS resolution at the time that the configs are read. Perhaps you're getting bitten by retention data - I've never fiddled with this to understand how it works deep under the hood. I'll do that now.vmesquita wrote:Restarting the service also doesn't work.
** EDIT Update **
Verified. I setup a check that just runs ifconfig using check_by_ssh. See attachments...
Sooo... is it possible that you're pointing towards slow replicating DNS servers in your environment or some such? The default XI config seems to react properly to a monitoring engine restart.
You do not have the required permissions to view the files attached to this post.
Re: Reset Nagios DNS Cache
Hi jdalrymple,
Nagios was poiting to the old IP address 2 days after the change, and DNS is configured with 1 hour time to live. What was odd is that if I ping the name, I get the correct IP address, however restarting and reloading Nagios didn't change anything, it kept pointing to the old address until I rebooted.the whole server.
Next time times happens, I'll try the strategies on the document you posted before and report back.
Nagios was poiting to the old IP address 2 days after the change, and DNS is configured with 1 hour time to live. What was odd is that if I ping the name, I get the correct IP address, however restarting and reloading Nagios didn't change anything, it kept pointing to the old address until I rebooted.the whole server.
Next time times happens, I'll try the strategies on the document you posted before and report back.
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Reset Nagios DNS Cache
I would verify that Nagios is restarting properly and that you don't have multiple Nagios monitoring engine processes running. As you can see from my demonstration, it works as advertised.