Page 1 of 1

Bulk Host Cloning Wizard: not copying host templates

Posted: Fri Jul 31, 2020 3:27 pm
by umunix
We recently upgraded from Nagios XI 5.4.13 -> 5.7.2
The 'Bulk Host Cloning and Import' wizard was updated from 2.0.2 to 2.1.3 as part of this.

After the upgrade, hosts that we clone using the cloning wizard no longer seem to be properly cloning the hosts' host template(s).

Everything else seems to clone correctly, however, inevitably all of the hosts we clone get the "generic-host" host template despite what had been set on the host. I tried cloning two different hosts that were each using a different host template, and both ended up with the generic-host template.

Kind regards
Richard

Re: Bulk Host Cloning Wizard: not copying host templates

Posted: Fri Jul 31, 2020 3:41 pm
by lmiltchev
Can you show us the config of the host that you are cloning?

I haven't been able to reproduce the issue in house. I cloned a "dummy" host, which used a custom template, e.g.

Code: Select all

define host {
    host_name                   dummy
    use                         my_custom_template
    address                     127.0.0.1
    ...
    register                    1
}
and the wizard copied the template to the new hosts just fine.

Example:

Code: Select all

define host {
    host_name                   dummy clone 1
    use                         my_custom_template
    address                     1.2.3.4
    ...
    register                    1
}

Re: Bulk Host Cloning Wizard: not copying host templates

Posted: Fri Jul 31, 2020 4:29 pm
by umunix
This is the host I've tried cloning a few times:

Code: Select all

define host {
	host_name			adry
	use				ist_linux_host_template
	alias				vipbatuat1
	address				10.0.12.237
	hostgroups			+ist_linux_virtual_machines_host_group
	register			1
	}	
The resulting cloned host ends up with this config for some reason:

Code: Select all

define host {
    host_name    vnl-vipbatuat01
    use          generic-host
    address      10.0.13.69
    register     1
}

Re: Bulk Host Cloning Wizard: not copying host templates

Posted: Fri Jul 31, 2020 4:42 pm
by lmiltchev
Can you PM me your latest profile?

Admin > System Profile > Download Profile

What are the fields that you are selecting in Step 2 of the wizard? Is the "Options" check-box selected? I will try to lab this in house.

Re: Bulk Host Cloning Wizard: not copying host templates

Posted: Tue Aug 04, 2020 10:46 am
by umunix
I was about to send you our profile when I decided to quickly to see if there were any PHP warnings/error in the logs for the cloning wizard, and found this:

Code: Select all

[Tue Aug 04 10:30:36.180048 2020] [:error] [pid 97336] [client 10.176.3.20:58892] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/configwizards/bulkhostimport/bulkhostimport.inc.php on line 532, referer: https://guardian.cc.umanitoba.ca/nagiosxi/config/monitoringwizard.php
[Tue Aug 04 10:30:36.180092 2020] [:error] [pid 97336] [client 10.176.3.20:58892] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/configwizards/bulkhostimport/bulkhostimport.inc.php on line 543, referer: https://guardian.cc.umanitoba.ca/nagiosxi/config/monitoringwizard.php
[Tue Aug 04 10:30:36.182064 2020] [:error] [pid 97336] [client 10.176.3.20:58892] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/configwizards/bulkhostimport/bulkhostimport.inc.php on line 728, referer: https://guardian.cc.umanitoba.ca/nagiosxi/config/monitoringwizard.php
I found this thread https://support.nagios.com/forum/viewto ... =6&t=50008 which looks like the same problem. The solution suggested here appears to have solved the problem

Best,
Richard

Re: Bulk Host Cloning Wizard: not copying host templates

Posted: Tue Aug 04, 2020 11:42 am
by scottwilkerson
umunix wrote:I was about to send you our profile when I decided to quickly to see if there were any PHP warnings/error in the logs for the cloning wizard, and found this:

Code: Select all

[Tue Aug 04 10:30:36.180048 2020] [:error] [pid 97336] [client 10.176.3.20:58892] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/configwizards/bulkhostimport/bulkhostimport.inc.php on line 532, referer: https://guardian.cc.umanitoba.ca/nagiosxi/config/monitoringwizard.php
[Tue Aug 04 10:30:36.180092 2020] [:error] [pid 97336] [client 10.176.3.20:58892] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/configwizards/bulkhostimport/bulkhostimport.inc.php on line 543, referer: https://guardian.cc.umanitoba.ca/nagiosxi/config/monitoringwizard.php
[Tue Aug 04 10:30:36.182064 2020] [:error] [pid 97336] [client 10.176.3.20:58892] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/configwizards/bulkhostimport/bulkhostimport.inc.php on line 728, referer: https://guardian.cc.umanitoba.ca/nagiosxi/config/monitoringwizard.php
I found this thread https://support.nagios.com/forum/viewto ... =6&t=50008 which looks like the same problem. The solution suggested here appears to have solved the problem

Best,
Richard
Great!

Glad to hear it is resolved.

Locking thread