Page 1 of 1

Bulk Cloning Config Wizard

Posted: Tue Apr 12, 2016 8:29 pm
by Fred Kroeger
Hi - I would like to be able to select more fields in the dropdown list when I do a Bulk Upload using the Bulk Host Cloning and Import Config Wizard
Spefically the Name field but I noticed that it is used in the dropdown list for the Hostname - bit confusing?
Anyway, can anyone assist on what needs to be changed to add fields to the dropdown list.

BTW - If others are interested, could we add it as a feature request?

regards... Fred

Re: Bulk Cloning Config Wizard

Posted: Wed Apr 13, 2016 9:28 am
by lmiltchev
Spefically the Name field but I noticed that it is used in the dropdown list for the Hostname - bit confusing?
I suppose we can change "Name" to "Host Name" as this is the "host_name" directive, and add "Display Name", which will correspond to the "display_name" directive.

FYI, I added an internal feature request about adding the "display_name" field to the "Bulk Host Cloning and Import" wizard (TASK ID 8269).

Re: Bulk Cloning Config Wizard

Posted: Wed Apr 13, 2016 9:41 am
by bheden
If you're deadset on changing it yourself.. making those changes shouldn't be too difficult, if you're comfortable with manipulating/creating configuration wizards. If you *aren't* comfortable (yet), here's a quick primer: https://assets.nagios.com/downloads/nag ... ios-XI.pdf.

Now that you've read and understood all that, you'll need to change a few pieces of code inside of html/includes/configwizards/bulkhostimport/bulkhostimport.inc.php

I'm not going to give you the specifics, just a brief outline of what you'll need to do - keep in mind there is always a bit of trial and error involved when customizing configuration wizards.

1. In the "CONFIGWIZARD_MODE_GETSTAGE2HTML" section, you'll need to add your field as an <option> in those <select>s.
2. In the "CONFIGWIZARD_MODE_GETOBJECTS" section, you'll need to add the logic you require to update the $objs variable before its passed back to XI (specifically in the defaults and the switch($fields[$i]) that follows right after and then in the section that starts with "// Add the host").

Hope this helps!

Re: Bulk Cloning Config Wizard

Posted: Wed Apr 13, 2016 11:44 pm
by Fred Kroeger
Brilliant ! Thanks all.
I'll try and make those changes after the next upgrade.

Fred

Re: Bulk Cloning Config Wizard

Posted: Thu Apr 14, 2016 8:47 am
by lmiltchev
Fred, do you want us to keep the thread open?

Re: Bulk Cloning Config Wizard

Posted: Thu Apr 14, 2016 4:45 pm
by Fred Kroeger
You can close this - I have enough info to get started. If I have any specific questions I'll open it again.

thanks... Fred

Re: Bulk Cloning Config Wizard

Posted: Thu Apr 14, 2016 4:50 pm
by bwallace
Thanks Fred, closing this one out now....