Host Template applied to Host Group
Host Template applied to Host Group
I'm attempting to apply a host template using host groups. Meaning: host A is a member of XYZ host group and, therefore, has host template X applied. This does not appear to work as expected.
- If I apply host template X to host A directly it works fine
- If I apply host template X to a host group that host A is in, and remove host template X from host A directly, I get an error that certain required parameters are missing (the standard "you need to have check intervals and things set up").
I know those parameters are set up properly in the template as applying the template directly works just fine. Why is applying the template via host group not doing the same?
- If I apply host template X to host A directly it works fine
- If I apply host template X to a host group that host A is in, and remove host template X from host A directly, I get an error that certain required parameters are missing (the standard "you need to have check intervals and things set up").
I know those parameters are set up properly in the template as applying the template directly works just fine. Why is applying the template via host group not doing the same?
Re: Host Template applied to Host Group
A template has to have at least one host defined to it in order for it to work.
So, you'd have to set up host-a to template-X, then apply the hostgroup. The order is important, in this case.
Hope that helps!
So, you'd have to set up host-a to template-X, then apply the hostgroup. The order is important, in this case.
Hope that helps!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Host Template applied to Host Group
Appreciate it, this particular template has about 200 hosts directly related to it currently. I was experimenting with one of those hosts to see if I could assign to all of those via group. Regarding the order....would I need to have a template (any template) assigned to host a, then apply to the group, then remove the placeholder template from host a?jdunitz wrote:A template has to have at least one host defined to it in order for it to work.
So, you'd have to set up host-a to template-X, then apply the hostgroup. The order is important, in this case.
Hope that helps!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Template applied to Host Group
No matter what, you need a host definition for each host. The definition can be as simpe as
that said, if the host is simple like this, everything that is required would need to be in the template.
But you cannot take a template and apply it to a host group, hostgroups do not have templates.
Code: Select all
define host {
host_name myhost
use mytemplate
register 1
}
But you cannot take a template and apply it to a host group, hostgroups do not have templates.
Re: Host Template applied to Host Group
Right...but a host cannot pick up all of it's information (save for the basics above) from being a member of a host group? Another way to ask that...what is the purpose of adding a hostgroup to a host template?scottwilkerson wrote:No matter what, you need a host definition for each host. The definition can be as simpe asthat said, if the host is simple like this, everything that is required would need to be in the template.Code: Select all
define host { host_name myhost use mytemplate register 1 }
But you cannot take a template and apply it to a host group, hostgroups do not have templates.
Really, this answer doesn't make a lot of sense. If I apply the template to the host directly everything is fine. If I apply the template to a host group that the host is in and remove the template being directly applied it doesn't work.
In that scenario, if I didn't have a basic host definition I would not be able to apply a template to it directly correct?
Last edited by rkane on Fri Feb 14, 2020 4:00 pm, edited 1 time in total.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Template applied to Host Group
If you want all hosts that have that template applied to be added to the hostgrouprkane wrote:what is the purpose of adding a hostgroup to a host template?
Re: Host Template applied to Host Group
ahhhhhhh!!!scottwilkerson wrote:If you want all hosts that have that template applied to be added to the hostgrouprkane wrote:what is the purpose of adding a hostgroup to a host template?
So backwards of what I'm thinking. The template is applied directly to all the hosts and the group membership is defined by the fact that the template is applied to that host.
Re: Host Template applied to Host Group
Yeah, it could be a bit confusing. Let us know if it's ok to lock this thread. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Host Template applied to Host Group
OK, to lock, thank youlmiltchev wrote:Yeah, it could be a bit confusing. Let us know if it's ok to lock this thread. Thanks!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Template applied to Host Group
Great!rkane wrote:OK, to lock, thank youlmiltchev wrote:Yeah, it could be a bit confusing. Let us know if it's ok to lock this thread. Thanks!
Locking thread