You cannot deploy templates to hosts based on their hostgroup membership. You can configure hostgroups on hosts through a template though.itzik wrote:what is the best practice to add and manage host template upon host groups?
Group Template & Host Groups
Re: Group Template & Host Groups
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Group Template & Host Groups
arbist,
thanks for posting,
thanks for posting,
what do you mean by that?configure hostgroups on hosts through a template though...
Re: Group Template & Host Groups
You can define a template that assigns hostgroup membership, and then apply that template to all the hosts that you want to be a member of that hostgroup.
Former Nagios employee
Re: Group Template & Host Groups
tmcdonald,
i am not sure if i understood what you wrote though i think that what you suggested (if i understood right) is going 200 hosts one by one and adding the template manually... that is exactly what i don`t want to do.
let me know if i understood you right and if not please elaborate further,
thanks for replying and trying to assist anyhow,
itzik vilmovsky
i am not sure if i understood what you wrote though i think that what you suggested (if i understood right) is going 200 hosts one by one and adding the template manually... that is exactly what i don`t want to do.
let me know if i understood you right and if not please elaborate further,
thanks for replying and trying to assist anyhow,
itzik vilmovsky
Re: Group Template & Host Groups
If you have 200 things and you need to put them in a group, at some point or another you will need to touch each of the 200 things. Whether you add them to a hostgroup from the hostgroup config or go to each host individually and add it to a group, you've got a fair amount of work. If you already have a list of the 200 hosts, you can probably script something pretty easily that will add the proper hostgroup line to each of the configs.
Former Nagios employee
Re: Group Template & Host Groups
tmcdonald
you miss the point of this whole thread, i have the hosts already assigned to a host group and even if i don`t adding them its ok and i agree with you that if i am already adding them (which is fat easy then adding template to each) i can insert them the template though that`s not the point.
the point of this thread is to better understand if its possible to assign host template to host group since if after adding them and configuring i will want to do a change to multiple hosts, (add another template/change parent/ETC) then i need to modify 100 and more hosts manually.
read my first post please and better understand the concept,
thanks man
you miss the point of this whole thread, i have the hosts already assigned to a host group and even if i don`t adding them its ok and i agree with you that if i am already adding them (which is fat easy then adding template to each) i can insert them the template though that`s not the point.
the point of this thread is to better understand if its possible to assign host template to host group since if after adding them and configuring i will want to do a change to multiple hosts, (add another template/change parent/ETC) then i need to modify 100 and more hosts manually.
read my first post please and better understand the concept,
thanks man
Re: Group Template & Host Groups
Hostgroups don't have templates assigned to them. Hosts do. So if you change the template used by 500 hosts, you will change the host definition for all 500 hosts at once.
Notice that the hosts "use voip-server" which is a TEMPLATE name, not a HOSTGROUP name. The host (template) named voip-server then uses another template called "smartvox-server" which in turn uses one called "linux-server" (which then uses one called generic-server, both of which are not included here).
If I want to change the notification period from 24x7 to 9x5 for all hosts (let's assume there are more than two) then I just change it in the smartvox-server or voip-server template and it will apply to all hosts that use those templates.
Hostgroups have nothing to do with what I think you are asking.
Code: Select all
define host{
use voip-server
host_name mkgp-d01.localdomain
alias mkgp-d01.localdomain
address 10.1.1.111
hostgroups private
}
define host{
use voip-server
host_name svip-d01.localdomain
alias svip-d01.localdomain
address 10.1.1.109
hostgroups private
}
define hostgroup{
hostgroup_name private
alias VoIP Servers
}
define host{
name smartvox-server
use linux-server
notification_period 24x7
contact_groups voip-support
register 0
}
define host{
name voip-server
use smartvox-server
register 0
}
If I want to change the notification period from 24x7 to 9x5 for all hosts (let's assume there are more than two) then I just change it in the smartvox-server or voip-server template and it will apply to all hosts that use those templates.
Hostgroups have nothing to do with what I think you are asking.
Re: Group Template & Host Groups
If all you want to know is "Can a host template be applied to a hostgroup?" then the answer is no. This applies both to "Can I apply a host template to multiple hosts by putting the hosts in a group and applying the template to that group?" and "Is there such a thing as a hostgroup template?" - either way, the answer is no. We're now trying to offer suggestions for a workaround.
Former Nagios employee
Re: Group Template & Host Groups
thanks for replying such an elaborated informative reply tmcdonald,
so how do you address this claims that i have in my first post?
itzik
so how do you address this claims that i have in my first post?
itzik
Re: Group Template & Host Groups
I'm not sure what claims you are referring to.
If you want to add a template to multiple hosts, it will need to be done one-by-one. Whether you add it by hand or by scripting, you will still at some point need to specify each host.
If you want to add a template to multiple hosts, it will need to be done one-by-one. Whether you add it by hand or by scripting, you will still at some point need to specify each host.
Former Nagios employee