Page 1 of 1
All but 1 Hostgroup
Posted: Wed Oct 21, 2015 10:47 am
by mdennis
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!
Re: All but 1 Hostgroup
Posted: Wed Oct 21, 2015 5:13 pm
by jolson
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
Re: All but 1 Hostgroup
Posted: Sun Oct 25, 2015 10:01 pm
by Box293
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?