Bulk Host Creation

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Bulk Host Creation

Post 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!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Bulk Host Creation

Post 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 :)
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Bulk Host Creation

Post 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
Former Nagios employee
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Bulk Host Creation

Post 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 :)
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Bulk Host Creation

Post by WillemDH »

Oh cool, I didn't stumble yet on this tool. We can certainly also make good use of something like this! :)
Nagios XI 5.8.1
https://outsideit.net
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Bulk Host Creation

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Bulk Host Creation

Post 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..
Nagios XI 5.8.1
https://outsideit.net
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Bulk Host Creation

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Locked