I am struggling to understand the difference in host group inheritance options. I have read the object inheritance documentation probably 4-6 times, but I am still struggling to understand the difference in "+" (append) and "Standard" inheritance. I was under the impression that "standard" inheritance on host or service in bulk modications tool would overwrite the existing configurations with what was specified in the bulk modification.
For instance, if I have a handful of new service checks that I want to add to a host via host groups, but not maintain the previously configured host groups, I could choose "Standard" and that would overwrite what previously existed in the configuration. However if I used "+" it would append it to the previous configuration ie. adding an additional host group to something already configured. I should note that our configuration method is to assign the service checks to a host group then add the host group on to a host.
Is there another document that explains the different inheritance options that I am missing? Is the only option to go to each host manually and remove all of the host groups and then bulk modify?
Lastly, is there additional information on the use case for the "Null" setting? I'm not understanding how that is used in Nagios XI.
Bulk Modication Tool and inheritance settings
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Bulk Modication Tool and inheritance settings
Hi,
Template inheritance can pretty complicated, the best docs we have on this right now are the Nagios Core documentation on Object Inheritance. If you are not used to view the configuration files in Core, it can be a little hard to follow.
Object Inheritance
From the docs:
Plus (+)
Nagios gives preference to local variables instead of values inherited from templates. In most cases local variable values override those that are defined in templates. In some cases it makes sense to allow Nagios to use the values of inherited and local variables together.
Null
Cancelling Inheritance of String Values
In some cases you may not want your host, service, or contact definitions to inherit values of string variables from the templates they reference. If this is the case, you can specify "null" (without quotes) as the value of the variable that you do not want to inherit. Take the following example:
Apologies here but could use a little clarification on this part. Would you be able to write down the exact steps your making in the CCM along with the result vs the expected result, and I can test this on my end? Thank you.For instance, if I have a handful of new service checks that I want to add to a host via host groups, but not maintain the previously configured host groups
Template inheritance can pretty complicated, the best docs we have on this right now are the Nagios Core documentation on Object Inheritance. If you are not used to view the configuration files in Core, it can be a little hard to follow.
Object Inheritance
From the docs:
Plus (+)
Nagios gives preference to local variables instead of values inherited from templates. In most cases local variable values override those that are defined in templates. In some cases it makes sense to allow Nagios to use the values of inherited and local variables together.
Null
Cancelling Inheritance of String Values
In some cases you may not want your host, service, or contact definitions to inherit values of string variables from the templates they reference. If this is the case, you can specify "null" (without quotes) as the value of the variable that you do not want to inherit. Take the following example:
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: Bulk Modication Tool and inheritance settings
@benjaminsmith thank you for your reply. I'm not sure how I missed that the inheritance was specifically for inheritance from templates.
In my case I'm using Nagios XI, I'm mentioning this for context to the actions that I am performing. The way that we have set up host groups and service checks is that we will create a service check, then associate the service check to a host group (ie. Service Check: Application Pool - Alpha, Host Group: AppPool_Alpha), then we assign the host group on to the hosts that would need the service check monitoring for Application Pool - Alpha and this is alongside our base monitoring checks (CPU, RAM, Disk Util, Core Services) that are also assigned via host group (WindowsBase) on the host. Then, say we need to change Application Pool - Alpha check to Application Pool - Beta. We follow the same steps, create the service check, associate it to the eponymous named host group. We think of it as labeling a host with a tag that says "This gets this specific service check". It allows us to nest host groups to create a service check package, but then we can also apply service checks a la carte as needed.
At this point we want to maintain the base service checks however we now need to replace Application Pool - Alpha with Application Pool - Beta. I thought that I recall in the past that I could go to Bulk Modifications Tool (BMT), go to Add Host Group and add the host groups WindowsBase and Application Pool - Beta and the "standard" selection on service inheritance would overwrite what previously existed while "+" would simply append the Application Pool - Beta host group to the already existing host groups ending up with WindowsBase, Application Pool - Alpha, and Application Pool - Beta host groups assigned to the host, therefore assigning the service checks via the host groups to the host in question.
Is the only way to accomplish what I'm describing is to select "Remove Host Group" in BMT, find all of the hosts with the host group in question, remove the host group, then write new configs with the "Add Host Group"?
In my case I'm using Nagios XI, I'm mentioning this for context to the actions that I am performing. The way that we have set up host groups and service checks is that we will create a service check, then associate the service check to a host group (ie. Service Check: Application Pool - Alpha, Host Group: AppPool_Alpha), then we assign the host group on to the hosts that would need the service check monitoring for Application Pool - Alpha and this is alongside our base monitoring checks (CPU, RAM, Disk Util, Core Services) that are also assigned via host group (WindowsBase) on the host. Then, say we need to change Application Pool - Alpha check to Application Pool - Beta. We follow the same steps, create the service check, associate it to the eponymous named host group. We think of it as labeling a host with a tag that says "This gets this specific service check". It allows us to nest host groups to create a service check package, but then we can also apply service checks a la carte as needed.
At this point we want to maintain the base service checks however we now need to replace Application Pool - Alpha with Application Pool - Beta. I thought that I recall in the past that I could go to Bulk Modifications Tool (BMT), go to Add Host Group and add the host groups WindowsBase and Application Pool - Beta and the "standard" selection on service inheritance would overwrite what previously existed while "+" would simply append the Application Pool - Beta host group to the already existing host groups ending up with WindowsBase, Application Pool - Alpha, and Application Pool - Beta host groups assigned to the host, therefore assigning the service checks via the host groups to the host in question.
Is the only way to accomplish what I'm describing is to select "Remove Host Group" in BMT, find all of the hosts with the host group in question, remove the host group, then write new configs with the "Add Host Group"?
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Bulk Modication Tool and inheritance settings
Hi,
I don't believe it worked differently than before, but I'd have to check the version and changelog to verify. I did some testing and was not really able to find another workaround besides the way you are currently doing this. It's also pretty easy to assign and re-assign services to different host groups from the services management page in the CCM.Is the only way to accomplish what I'm describing is to select "Remove Host Group" in BMT, find all of the hosts with the host group in question, remove the host group, then write new configs with the "Add Host Group"?
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: Bulk Modication Tool and inheritance settings
The issue that I'm facing however is with the assignment of host groups to hosts via the Bulk Modification Tool, not with the assignment of services to the host groups.
I thought that there was a way to overwrite the existing host groups on a host rather than append to the existing host groups on the host. If it requires one additional step to remove the host groups before assignment I suppose that's workable though it would be nice to have an overwrite feature if it doesn't exist already.
I thought that there was a way to overwrite the existing host groups on a host rather than append to the existing host groups on the host. If it requires one additional step to remove the host groups before assignment I suppose that's workable though it would be nice to have an overwrite feature if it doesn't exist already.
Re: Bulk Modication Tool and inheritance settings
Yes, one additional step would be required (removing the host groups, prior to assigning the new ones). I can submit a feature request on your behalf if you'd like. Please keep in mind that the decision to implement the enhancement is at the sole discretion of our development team.If it requires one additional step to remove the host groups before assignment I suppose that's workable though it would be nice to have an overwrite feature if it doesn't exist already.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Bulk Modication Tool and inheritance settings
@lmiltchev I would appreciate that. You may mark this thread as closed now if you would like. Thank you for the assistance.
Re: Bulk Modication Tool and inheritance settings
I filed an internal feature request on your behalf. It is in the approval queue at the moment. I will be closing this topic now. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!