Importing 300 Linux hosts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
wyoder
Posts: 50
Joined: Mon Dec 29, 2014 3:21 pm
Location: Raleigh, NC
Contact:

Importing 300 Linux hosts

Post by wyoder »

Hi, Support Team:

We have 300+ Linux hosts to import into Nagios XI, all with the same services to be monitored. I read with interest the earlier "Bulk Add Hosts" post as well as the "Automated Host Management in Nagios XI" white paper. It appears to me that the most direct and safest way to create these 300 monitors is to:

1. create a single *.cfg file that defines a host and the services for that host
2. place the *.cfg file into /usr/local/nagios/etc/import
3. ensure that it passes the reconfigure verification
4. if so, then clone that file 300+ times by simply altering the hostname and IP address
5. import all at once with the reconfigure_nagios.sh script.

Could you please confirm or offer an alternative approach?

Thanks,
Bill Yoder, Clinipace Worldwide
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Importing 300 Linux hosts

Post by WillemDH »

Hey Wyoder,

This seems like an excellent approach. You could also make one host manually and then use the bulk host cloning wizard. (I've been using it for a long time and it works excellent) If I can give you one more advice, try to make use of service templates for the linked services.

Grtz

WIllem
Nagios XI 5.8.1
https://outsideit.net
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Importing 300 Linux hosts

Post by tmcdonald »

Don't forget hostgroups! Not strictly related to your issue, but with a hostgroup you can have a set of, say, 8 services, and instead of manually attaching them to each host you add, you attach them to a hostgroup. Then when you create a new host that needs those services, you add it to the hostgroup and it picks up the services automatically.
Former Nagios employee
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Importing 300 Linux hosts

Post by gormank »

Post #1 is how I did this. My host definitions have little in them that isn't required.
I have boilerplate host and search and replace values, write files in import and run reconfigure. I can change monitoring by adding the host to hostgroups, and modifying the template.

define host {
host_name hostname
use default_host
alias alias
display_name display_name
address 10.136.243.208
register 1
}

I use templates and hostgroups to keep info out of the host definitions.

I'm not certain this is a good way, but its what I did.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Importing 300 Linux hosts

Post by lmiltchev »

This seems like a good way to import these hosts. Do you have any issues/concerns at the moment? Is it safe to mark this thread as resolved?
Be sure to check out our Knowledgebase for helpful articles and solutions!
wyoder
Posts: 50
Joined: Mon Dec 29, 2014 3:21 pm
Location: Raleigh, NC
Contact:

Re: Importing 300 Linux hosts

Post by wyoder »

In the space of a few hours, I've heard a passel of good ideas from various folks on this topic. Could you therefore leave this case open for a few more days as a way to collect other helpful advice? Close by Friday afternoon should be fine.

Thanks!
--Bill
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Importing 300 Linux hosts

Post by lmiltchev »

No problem, Bill. We will keep this topic open.
Be sure to check out our Knowledgebase for helpful articles and solutions!
wyoder
Posts: 50
Joined: Mon Dec 29, 2014 3:21 pm
Location: Raleigh, NC
Contact:

Re: Importing 300 Linux hosts

Post by wyoder »

It's Friday afternoon, so feel free to close this discussion. I may have additional questions, (like, is there easy-to-understand documentation on how to create service templates?), but I've got enough to go on from this thread to make some progress.

Thanks for everybody's help!
--Bill
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Importing 300 Linux hosts

Post by jdalrymple »

wyoder wrote:like, is there easy-to-understand documentation on how to create service templates?
What specifically are you wondering? There is only one way to create a service template....

Code: Select all

     register           0
Are you looking for advice on the layup of service templates? It's generally environment specific, and to be brutally honest other than "generic-service" I rarely see any good fit for a service template. Host templates on the other hand...
wyoder
Posts: 50
Joined: Mon Dec 29, 2014 3:21 pm
Location: Raleigh, NC
Contact:

Re: Importing 300 Linux hosts

Post by wyoder »

Thank you for your response regarding service templates. "Experience is a great teacher" plus your response have worked well together.

Please close/lock this post at your convenience.

--Bill Yoder
Locked