Page 1 of 1

Getting sql errors when using bulk import tool

Posted: Wed Feb 11, 2015 11:54 am
by WillemDH
Hello,

When we try to use the bulk modification tool to add a hostgroup to a host, we get

SQL: SQL Error [nagiosql] : Duplicate entry '1294-124' for key 'PRIMARY'

After some testing it seem this happens when the hostgroup is already assigned to the host. Shouldn't this be prevented when choosing the hosts where the hostgroup has to be added?

Grtz

Willem

Re: Getting sql errors when using bulk import tool

Posted: Wed Feb 11, 2015 11:56 am
by abrist
It should be. Is the group inherited from a template,etc. or is it set on the actual host config??

Re: Getting sql errors when using bulk import tool

Posted: Wed Feb 11, 2015 11:57 am
by WillemDH
No the group is set on the actual host config.

Re: Getting sql errors when using bulk import tool

Posted: Wed Feb 11, 2015 11:59 am
by abrist
Do you know where it is getting that relationship? What is output for the relationship icon in the CCM for the host?

Re: Getting sql errors when using bulk import tool

Posted: Wed Feb 11, 2015 12:15 pm
by WillemDH
Andy,

Example:
Relation to Contactgroups, entry: xi_dig_dummy_contact_group
Relation to Hostgroups, entry: all_srv_os_windows_2008
Relation to Hostgroups, entry: all_srv_inf_vir_vmw
Relation to Hostgroups, entry: all_srv_loc_dg
Relation to Hostgroups, entry: all_srv_rol_vmware
Relation to Hosttemplates, entry: dig_windows_server_prio2

So when when I try to add all_srv_rol_vmware with the bulk host modifcation wizard again, I can select it (while it should be greyed out or sth) and then it gives the error.

As I said we only see this when the host already has the hostgroup configured (on host level). At the moment I select 'Save' we get the sql error. See screenshot. When going to the host in CCM, the status is "not applied", so we manually have to do an "apply configuration" afterwards.

Grtz

Willem

Re: Getting sql errors when using bulk import tool

Posted: Wed Feb 11, 2015 12:55 pm
by lmiltchev
So when when I try to add all_srv_rol_vmware with the bulk host modifcation wizard again, I can select it (while it should be greyed out or sth) and then it gives the error.
This is a bug - I filed an internal bug report (TASK ID 4993).
When going to the host in CCM, the status is "not applied", so we manually have to do an "apply configuration" afterwards.
This is the expected behavior. Actually you must apply configuration after clicking on the "Save" button - that's why the "Apply Configuration" button "shows up". It is not very clear from the web UI though... I just spoke to our devs about this. They will probably make it "stand out" - the button would be colored in red or we will put a red asterisk next to it (similar to how it is in the CCM).

Re: Getting sql errors when using bulk import tool

Posted: Wed Feb 11, 2015 12:57 pm
by WillemDH
Thanks for confirming it's a bug Ludmill. You can close the thread. I'll spread the news to my colleagues you guys are on it and they should not add hostgroups to hosts which already have them... :) You can close the thread.