Page 1 of 1
Importing 300 Linux hosts
Posted: Tue Oct 06, 2015 10:35 am
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
Re: Importing 300 Linux hosts
Posted: Tue Oct 06, 2015 11:15 am
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
Re: Importing 300 Linux hosts
Posted: Tue Oct 06, 2015 12:34 pm
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.
Re: Importing 300 Linux hosts
Posted: Tue Oct 06, 2015 12:58 pm
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.
Re: Importing 300 Linux hosts
Posted: Tue Oct 06, 2015 3:16 pm
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?
Re: Importing 300 Linux hosts
Posted: Tue Oct 06, 2015 3:30 pm
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
Re: Importing 300 Linux hosts
Posted: Tue Oct 06, 2015 4:31 pm
by lmiltchev
No problem, Bill. We will keep this topic open.
Re: Importing 300 Linux hosts
Posted: Fri Oct 09, 2015 2:57 pm
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
Re: Importing 300 Linux hosts
Posted: Fri Oct 09, 2015 10:05 pm
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....
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...
Re: Importing 300 Linux hosts
Posted: Tue May 31, 2016 8:01 am
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