Bulk HostName Change
-
FOG Server: 1.4.4
Storage Nodes: 1.4.4
Ubuntu: 14.04.5.LTSMy organization is changing the way we name hosts.
I was hoping i could export the hosts as a CSV file, make the changes to the CSV file ie change the host name and add in the OU location so it moves the new hosts to the correct location.
When i try to import the host file i get errors saying “One or more macs are associated with a host”
Is this possible? Or will i have to export the hosts, then delete all hosts and then import edited CSV file?
Thanks in advance.
-
Import is typically used during migration or to add new items. If it encounters a MAC that already exists in the database (associated to a host) it will complain because it has to be unique of course.
So, as far as I know, deleting the host list and importing the list is the only way, but you might want to hold on because I could be wrong.
-
Now this is a dirty way to do it as I don’t have the MYSQL skills or database background. What you can do it go to reports and run an inventory report. Export that. Now cant the column that has the hostname and change it to what you want. Find and replace or just trim your hostname down to asset tag them add whatever your naming convention is. So now you have a new column of hostname and the MAC address that was exported from inventory report. Follow the format for CSV upload here https://wiki.fogproject.org/wiki/index.php?title=Managing_FOG#Hosts
Now under the 4th column add “Description” name this something like import and the date. This will be used to group the hosts you just imported. Go into FOG add whatever hosts you want to change to a group. Delete that group and check and delete hosts. NOTE this will remove all history assigned images settings and login history (Hence Dirty Way) Now import the hosts you want back in. After you successfully import your assets back in go to the hosts tab and search the description you added on import. Select all those hosts and add them to a group to apply all the new settings to. Once you add service settings and AD info they will start renaming your computers and depending on your settings may or may not reboot the computer.