Group Template & Host Groups

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Group Template & Host Groups

Post by eloyd »

I re-read your posting and I, too, can find nothing that was not answered.

Would you be willing to restate your question in new words?
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Group Template & Host Groups

Post by slansing »

Yes, please do, we'd like to help clear up any questions you may have. Thanks!
itzik
Posts: 11
Joined: Sun Jul 13, 2014 7:48 am

Re: Group Template & Host Groups

Post by itzik »

guys,

i am not saying you did not answered my question and appreciate your help and support with regard, though i just wanted to make sure i am doing the right thing when configuring host groups, host templates & hosts, if enforcing template on host group does not work OK though just want to verify if the proper way of administrating multiple hosts within host group is to add one host template to each host and then within the template it self add another template and make the changes within, it is a bit cumbersome and i was not sure that this is the way it was meant to be.
just want to get your impression and best practice for host groups host template enforcement as i already understand can`t be enforced to host groups.

hope that clarify my intentions, :roll:

itzik vilmovsky
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Group Template & Host Groups

Post by eloyd »

The easiest way to do this is to use multiple templates. Let's say you have windows machines and linux machines that you're monitoring. And you have two kinds of linux machines: web servers and database servers. So here's what I would do:

Create the following templates as follows:

Code: Select all

generic-server
  linux-server (inherit generic-server and override whatever you need)
    web-server (inherit linux-server and override whatever you need)
    db-server (inherit linux-server and override whatever you need)
  windows-server (inherit generic-server and override whatever you need)
Then assign db-server, web-server, or windows-server to your hosts. Even if db-server and web-server are the same definition, you can easily go back and alter individual aspects later. This lets you base templates on templates on templates, so if you plan your structure ahead of time, you can more easily change things in the future. Note that hostgroups are not even mentioned here.

To actually SET the hosts to the templates in the first place, you will need to do something either with editor magic (vim macros, maybe) or sed or something to change your existing hosts.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Group Template & Host Groups

Post by tmcdonald »

eloyd wrote:To actually SET the hosts to the templates in the first place, you will need to do something either with editor magic (vim macros, maybe) or sed or something to change your existing hosts.
This kind of speaks to the original issue - at some point you will have to do a bit of manual work to make the changes en masse. Whether it is scripted or done manually is up to you.
Former Nagios employee
Locked