My company is using Nagios XI, so I'm wondering how I get a *,!hostgroup relation through the UI. I know I could just add all hostgroups and then remove the undesired group, but with template inheritance and hostgroups being assigned in multiple places, I'm looking for an overriding way to add all but a certain hostgroup to a host.
Thanks!
All but 1 Hostgroup
Re: All but 1 Hostgroup
Unfortunately there's no way to negate a hostgroup via the Web GUI. The workaround at this time is to make use of that static directory: https://assets.nagios.com/downloads/nag ... ios-XI.pdf
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: All but 1 Hostgroup
I believe it can be done using a free variable.
There is actually a way to do this in the CCM but it is a hack and does have one caveat I will explain...
You can negate hosts using the free variables settings on the Misc Settings tab.
Add a free variable
Variable Name = host_name
Variable value = !YOUR-HOST.COM,!YOUR-OTHER-HOST.COM
Now for the caveat....
This works perfectly fine if you have a service definition where you are adding hostgroups and want to just exclude a couple hosts. This will fail miserably if you also are adding individual hosts (in addition to hostgroups) because the free variable you set will in fact overwrite the individual hosts you have.
Does this work for you?
There is actually a way to do this in the CCM but it is a hack and does have one caveat I will explain...
You can negate hosts using the free variables settings on the Misc Settings tab.
Add a free variable
Variable Name = host_name
Variable value = !YOUR-HOST.COM,!YOUR-OTHER-HOST.COM
Now for the caveat....
This works perfectly fine if you have a service definition where you are adding hostgroups and want to just exclude a couple hosts. This will fail miserably if you also are adding individual hosts (in addition to hostgroups) because the free variable you set will in fact overwrite the individual hosts you have.
Does this work for you?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.