Page 1 of 2

Bulk Cloning adding contact

Posted: Mon Mar 14, 2016 9:05 am
by BanditBBS
When using bulk cloning it *sometimes* adds my name as a contact on the new hosts. I can't find a pattern and haven't investigated too much yet, but its beginning to become a problem as I too often forget to go check since it shouldn't be doing it in the first place. Has anyone else experienced this behavior?

Re: Bulk Cloning adding contact

Posted: Mon Mar 14, 2016 10:57 am
by lmiltchev
Can you briefly describe how do you do the cloning? We will try to recreate the issue in house.

Re: Bulk Cloning adding contact

Posted: Mon Mar 14, 2016 12:39 pm
by BanditBBS
All of my hosts use templates and the templates set check intervals and contacts and other required information.

I select a host to clone, select all the services and then enter "address,hostname" list into the box. Most of the time there are multiple hosts, 3-4. I uncheck the remove parent and hostgroups box and hit next. On that screen I either hit finish or sometimes I hit next, next, next and then finish. Not sure if this is happening if I hit the first finish and/or if I do the next next next finish. I haven't tried to replicate much yet, been too busy, but noticed it is happening more often and it adds my name to the host as a contact, therefore breaking the inherited contacts on the templates.

The services also have my contact added to them when they should have none.

EDIT #1: I replicate it over and over again by hitting the first FINISH and not next, next, next, finish.

Re: Bulk Cloning adding contact

Posted: Mon Mar 14, 2016 4:56 pm
by lmiltchev
When using bulk cloning it *sometimes* adds my name as a contact on the new hosts.
The services also have my contact added to them when they should have none.
Is your contact a member of a contact group, that is added to one of these (host or service) templates?

Can you show us a sample config of the templates, and the host/services you are cloning?

Re: Bulk Cloning adding contact

Posted: Tue Mar 15, 2016 8:28 am
by BanditBBS
Ludmil, nope, my contact is not on any of these hosts, I get alerts for literally one of the hosts in my system :)

Host Template:

Code: Select all

define host {
       name                                     rose_nh_generic_host
       parents                                  robot-rose
       check_command                            check_robot_check_xi_host_ping!3000.0!80%!5000.0!100%!!!!10.143.162.194
       max_check_attempts                       2
       check_interval                           5
       retry_interval                           1
       check_period                             xi_timeperiod_24x7
       event_handler_enabled                    1
       flap_detection_enabled                   1
       process_perf_data                        1
       retain_status_information                1
       retain_nonstatus_information             1
       contact_groups                           ROSE_NAGIOS_ALL_CG
       notification_interval                    0
       notification_period                      xi_timeperiod_24x7
       notifications_enabled                    1
       register                                 0

}
Service Template:

Code: Select all

define service {
       name                                     rose_nh_generic-service-5
       service_description                      Generic Rosetta Stone Service(5 Min)
       is_volatile                              0
       max_check_attempts                       3
       check_interval                           5
       retry_interval                           2
       active_checks_enabled                    1
       passive_checks_enabled                   1
       check_period                             24x7
       parallelize_check                        1
       obsess_over_service                      1
       check_freshness                          0
       event_handler_enabled                    1
       flap_detection_enabled                   1
       process_perf_data                        1
       retain_status_information                1
       retain_nonstatus_information             1
       notification_interval                    0
       notification_period                      24x7
       notification_options                     w,c,u,r,
       notifications_enabled                    1
       register                                 0

}
I select a host that has no setting except an IP and the host template assigned. It has about 11 services on it all using the service template above. They only have a command set, all other settings are inherited by the template and/or host(contacts).

I select all services and put in a list of 4 new hostnames,address in the box. I uncheck the replace parents, hit next and then finish. Everything is fine except my name is added as a contact to the 4 new hosts and the 44 new services.

Re: Bulk Cloning adding contact

Posted: Tue Mar 15, 2016 11:22 am
by lmiltchev
Ludmil, nope, my contact is not on any of these hosts, I get alerts for literally one of the hosts in my system
I would assume your contact is NOT added to the "ROSE_NAGIOS_ALL_CG" contactgroup... Can you confirm?

I would expect to see all members of the "ROSE_NAGIOS_ALL_CG" contactgroup to be added to the services of any host, using the "rose_nh_generic_host" template via implied inheritance. If your contact is not a member of "ROSE_NAGIOS_ALL_CG", it's beyond me how in a world it is added to the host & services... I am usually pretty good with finding bugs, and breaking stuff, but so far I haven't been able to recreate this... :(

Re: Bulk Cloning adding contact

Posted: Tue Mar 15, 2016 12:27 pm
by BanditBBS
lmiltchev wrote:
Ludmil, nope, my contact is not on any of these hosts, I get alerts for literally one of the hosts in my system
I would assume your contact is NOT added to the "ROSE_NAGIOS_ALL_CG" contactgroup... Can you confirm?

I would expect to see all members of the "ROSE_NAGIOS_ALL_CG" contactgroup to be added to the services of any host, using the "rose_nh_generic_host" template via implied inheritance. If your contact is not a member of "ROSE_NAGIOS_ALL_CG", it's beyond me how in a world it is added to the host & services... I am usually pretty good with finding bugs, and breaking stuff, but so far I haven't been able to recreate this... :(
Ludmil,

Nope, it is not a member of the contactgroup. You are also expecting the wrong things to happen though. The host and services on the host that I am copying have no contacts on them at all, so the copies that are made should have no contacts or contactgroups assigned as well, just the templates. let me record a video and PM you the link to show you :)

Re: Bulk Cloning adding contact

Posted: Tue Mar 15, 2016 12:37 pm
by BanditBBS
I can reproduce EVERY time I do this. Regardless if I hit next, finish or next next next finish.

The issue I believe is since the host and services have no contacts it is setting a default contact.

Re: Bulk Cloning adding contact

Posted: Tue Mar 15, 2016 1:57 pm
by lmiltchev
I was able to reproduce the issue. It's annoying!
According to the Nagios Core documentation, "the directives in read are required, , while those in black are optional"...
https://assets.nagios.com/downloads/nag ... .html#host

My initial thought was - OK, the "contacts" and the "contact_groups" directives are required, so if you don't have a contact or a contactgroup assigned, the "Bulk Host Cloning and Import" wizard will assign the user running the wizard as a "default" contact (so that configuration won't fail)... Well, not really.

1. Defining a host/service without a contact or a contactgroup won't cause apply configuration to fail. You will only see some warnings.

2. I had a valid contactgroup assigned to the host I was cloning, but the Bulk wizard still added me as a contact...

I would say this is a bug. I will discuss it with our developers before I file it though.

Re: Bulk Cloning adding contact

Posted: Tue Mar 15, 2016 2:14 pm
by lmiltchev
Update: The bug was verified by our developers, so I filed it internally (TASK ID 8026).