Bulk hostname change

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

Moderators: Developers, Moderators

Post Reply
User avatar
jt555
Cacti User
Posts: 56
Joined: Sat Nov 17, 2007 3:37 pm
Location: Atlanta, Ga

Bulk hostname change

Post by jt555 »

I have a situation where i have to change the hostnames of ~800 devices.
I bulk changed them directly in the database then rebuild the poller cache. The poller cache still retained the old hostnames.

Also tried to Reapply Suggested Names on Graph Templates and Data Source Templates (and rebuilt poller cache after each step) but no change.

The only way I can see the poller cache get updated is if I update a hostname manually - I can't do that for 800 hosts.

I looked into the API but it's unclear which call triggers the cache to be updated.

Running Version 1.1.7.

Thanks in advance
JT
User avatar
jt555
Cacti User
Posts: 56
Joined: Sat Nov 17, 2007 3:37 pm
Location: Atlanta, Ga

Re: Bulk hostname change

Post by jt555 »

Where are the hostnames stored for the polling cache?

I would like to bulk-upodate that table in addtion to the hosts table so that after re-building the cache, the new hostnames will be used.

alternatively, what api call can I use to trigger this change?

please help.
thanks
JT555
User avatar
jt555
Cacti User
Posts: 56
Joined: Sat Nov 17, 2007 3:37 pm
Location: Atlanta, Ga

Re: Bulk hostname change

Post by jt555 »

Ok guys, here's the answer:

1- disable all the devices you want to bulk hostname change.
2- bulk change their hostnames in the DB:
2.1- update host set hostname='new_name' where hostname='old_name'
3- enable all those hosts from way back in step 1.

thanks everyone, you guys are awesome.
:wink:
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Bulk hostname change

Post by Osiris »

You missed the step to rebuild the poller cache afterwards. Glad you figured it out.
Before history, there was a paradise, now dust.
User avatar
jt555
Cacti User
Posts: 56
Joined: Sat Nov 17, 2007 3:37 pm
Location: Atlanta, Ga

Re: Bulk hostname change

Post by jt555 »

Actually, there was one more step:
Any Data Input Methods in use by the hosts have to be saved/updated.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests