Icinga / icingaweb2-module-vsphere

VMware vSphere import source for the Icinga Director
GNU General Public License v2.0
32 stars 8 forks source link

Clean up imported data of source vCenter. "Duplicate entry:" #19

Open jaygopalu opened 6 years ago

jaygopalu commented 6 years ago

Hi,

I do not know how, but i somehow seem to have managed to create duplicate entries on the db with my import from vCenter. Could this happen to VMs with multiple IPs?

I am using MySQL, i ran below sql to identify if there are duplicate entries and yes two records with count 2. select object_name, count(*) c from imported_row group by object_name having c>1;

I did not delete duplicate entries considering those records may have reference in other tables and i may end up with some stale records. How can i safely clean it up? I am okay to drop entire imported data too.

Thank you, Jay

image

jaygopalu commented 6 years ago

It might be is crude, but here is what i did and all is fine right now.

  1. Backed up my db using mysqldump.
  2. deleted content of all tables starting with "import*" using below. truncate table
  3. restarted all services.
  4. added 'import source' again & configured 'sync rule'.

Please share your views and any other means of solving this problem.