Forcing a host recache?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
hid3nax
Cacti User
Posts: 68
Joined: Thu Jan 12, 2012 7:48 am

Forcing a host recache?

Post by hid3nax »

Hello everyone.
I picked up administering a huge Cacti installation. It has got nearly 1000 hosts. One of the problems I have noticed that some servers had DNS names in Hostname field instead of IP adresses. This sometimes resulted in unresolvable IPs (the DNS system is weak here) and no SNMP data. So I decided to write a script to find all the DNS hostnames, resolve them and replace with unique IP adresses for the corresponding hosts in the `host` table. All the info is now correct in Cacti-> Devices.

But...

I did some tcpdump'ing and I see that still much DNS names are trying to be resolved when the poller launches. I did some research and found that the old DNS hostnames are still residing in the `poller_item` table. Going to Cacti->Devices, picking particular host and just pressing the Save button seems to update the table and all is well. But I won't be doing that for each of the 1000 host manually with my mouse...

Is there any script, SQL setting or a tool to do that for all hosts, or at least by host ID?

Thanks!
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Forcing a host recache?

Post by BSOD2600 »

two options:
1) Cacti System Utilities -> Rebuild Poller Cache
2) \cacti\cli\rebuild_poller_cache.php
hid3nax
Cacti User
Posts: 68
Joined: Thu Jan 12, 2012 7:48 am

Re: Forcing a host recache?

Post by hid3nax »

Thanks.
I've tried both, but the following problems:
1) from the GUI, the rebuilding cache never completes due to system load probably
2) I've tried the CLI version. It took forever to run. So I cancelled it and ran host by host. Unfortunately, this didn't clear the hostnames in the poller_item. Looks like only pressing the 'Save' button when editing host (even with no changes) seems to clear & regenerate that cache....
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Forcing a host recache?

Post by gandalf »

This qualifies for a bug report, then
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests