Page 1 of 1

Bulk Host Creation

Posted: Thu Nov 14, 2013 11:14 am
by BanditBBS
Am I being dumb here, or wasn't there something called "Host Creation Tool" or something similar before? It wouldn't do services, just hosts. I was just looking for it and can't find it anywhere. I have a list of 150 switches, with their IP and parent and was hoping it allowed setting the parent.

Otherwise, I need to write a script that will write the config files so I can then import them into XI. I would use bulk cloning, but then I'd have to go edit 150 and set the parents!

Re: Bulk Host Creation

Posted: Thu Nov 14, 2013 11:31 am
by BanditBBS
You know, I used mail merge in word and created the config files rather quickly. Feel free to answer my question and then close this thread if you want :)

Re: Bulk Host Creation

Posted: Thu Nov 14, 2013 12:06 pm
by tmcdonald
BanditBBS wrote:You know, I used mail merge in word and created the config files rather quickly.
That made me lose my appetite, but if it works it works.

Were you referring to this? http://exchange.nagios.org/directory/Ad ... ol/details

Re: Bulk Host Creation

Posted: Thu Nov 14, 2013 12:10 pm
by BanditBBS
Yes, that is what I was referring to, thanks.

The mail merge worked great though, just saved as a text file and imported it in, flawless :)

Re: Bulk Host Creation

Posted: Thu Nov 14, 2013 12:39 pm
by WillemDH
Oh cool, I didn't stumble yet on this tool. We can certainly also make good use of something like this! :)

Re: Bulk Host Creation

Posted: Thu Nov 14, 2013 12:42 pm
by BanditBBS
WillemDH wrote:Oh cool, I didn't stumble yet on this tool. We can certainly also make good use of something like this! :)
Its just as useful as the Bulk Host Cloning tool that NagiosXI has. Still didn't support parents, that is why I used a mail merge and as I already stated, took me 2 minutes and worked great. Let me know if you want me to pass on how I did it.

Re: Bulk Host Creation

Posted: Thu Nov 14, 2013 12:53 pm
by WillemDH
Is the only advantage compared to the bulk host creation tool that it can make parents? I can imagine it can also be useful to configure the correct template / hostgroup for each host? Or is this not possible? As with the bulk host cloning tool it always takes all the host groups from the original.. And as each of my servers is in 4 -6 different hostgroups based on location, architecture, type, importance,... It's sometimes annoying when using the bulk tool as aft creation I have to update all the hostgroups..

Re: Bulk Host Creation

Posted: Thu Nov 14, 2013 1:05 pm
by BanditBBS
You could do whatever.....here is what I did.

I was supplied a list of Cisco switches, their IP and their parent in an Excel spreadsheet.

I then started a mail merge wizard in Word. and selected use current document and I pasted this in it:

Code: Select all

define host {
        host_name                       
        use                             generic-switch
        alias                           
        address                         
        parents                         
        hostgroups                      network_ot2_switches
        contact_groups                  network_ottawa
        icon_image                      switch.png
        icon_image_alt                  Switch
        register                        1
        } 
Then select the datasource and chose the Excel file. I then inserted the 3 fields where appropriate and finished the merge saying "edit all" or whatever that option is. I then save the file as a text document and used the import function in the CCM to import that file. it worked great. You could of course adjust that process for your needs, but that is the general idea.