02-26-2010 11:45 AM
Recently I tried to do a bulk import of devices in my DCR. What I did was to export all the data into a CSV file, modify the hostname and display name so i could put an identifier on there, and then re-import in the database. Instead of updating all the devices it added duplicates in for them all. How do I resolve this so I dont have the duplicates.
Chris
02-26-2010 12:12 PM
What fields are populated for these devices?
02-26-2010 12:15 PM
The following fields were exported and had values. I changed host_name and display_name to different values and reimported the csv file. I now have duplicate devices for each router. One for example is 0001_RTR.company.com and the other is MSP_0001_RTR.company.com. The MSP_ is the part i added onto the hostname and display name. management_ip_address host_name domain_name display_name sysObjectID mdf_type snmp_v2_ro_comm_string snmp_v2_rw_comm_string primary_password primary_enable_password chris
02-27-2010 10:52 AM
DCR is using the display name attribute as the unique identifier for devices. Therefore, when you change that field, DCR thinks the device entry is new. I filed CSCtf29117 to request an enhancement to allow exporting of the DCR device ID which would facilitate being able to change display name in bulk like this.
As a workaround in the time being, you would need to use the web interface to change the display name of each device individually. You could also script the dcrcli command line interface to update. For example, get all the DCR IDs using the lsids command, then foreach one, update the display_name attribute. In pseudo-code:
foreach id $(dcrcli -u admin cmd=lsids all)
do
current_display_name = get_disp_name($id)
dcr_id = get_dcr_id($id)
dcrcli -u admin cmd=mod id=$dcr_id -a display_name="MSP_$current_display_name"
done
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide